diff --git a/src/lib/nbt.cpp b/src/lib/nbt.cpp index d6893f2..300264a 100644 --- a/src/lib/nbt.cpp +++ b/src/lib/nbt.cpp @@ -43,29 +43,29 @@ int endianness_example() { namespace NBT { namespace helper { - ErrorOr readInt8(uint8_t* data[], uint64_t dataSize, uint64_t currentPosition) { + ErrorOr readInt8(uint8_t data[], uint64_t dataSize, uint64_t currentPosition) { //TODO: implement return ErrorOr((int8_t) 0); } - ErrorOr readInt16(uint8_t* data[], uint64_t dataSize, uint64_t currentPosition) { + ErrorOr readInt16(uint8_t data[], uint64_t dataSize, uint64_t currentPosition) { //TODO: implement return ErrorOr((int16_t) 0); } - ErrorOr readInt32(uint8_t* data[], uint64_t dataSize, uint64_t currentPosition) { + ErrorOr readInt32(uint8_t data[], uint64_t dataSize, uint64_t currentPosition) { //TODO: implement return ErrorOr((int32_t) 0); } - ErrorOr readInt64(uint8_t* data[], uint64_t dataSize, uint64_t currentPosition) { + ErrorOr readInt64(uint8_t data[], uint64_t dataSize, uint64_t currentPosition) { //TODO: implement return ErrorOr((int64_t) 0); } //FIXME: we just assume that float is a single-precision IEEE754 // floating point number - ErrorOr readFloat32(uint8_t* data[], uint64_t dataSize, uint64_t currentPosition) { + ErrorOr readFloat32(uint8_t data[], uint64_t dataSize, uint64_t currentPosition) { //TODO: implement assuming standard single-precision IEEE754 float // Alternatively, maybe calculate a floating point number by using // the stored value as math instructions? @@ -74,14 +74,14 @@ namespace NBT { //FIXME: we just assume that double is a double-precision IEEE754 // floating point number - ErrorOr readFloat64(uint8_t* data[], uint64_t dataSize, uint64_t currentPosition) { + ErrorOr readFloat64(uint8_t data[], uint64_t dataSize, uint64_t currentPosition) { //TODO: implement assuming standard double-precision IEEE754 float // Alternatively, maybe calculate a floating point number by using // the stored value as math instructions? return ErrorOr(0.0); } - ErrorOr> readInt8Array(uint8_t* data[], uint64_t dataSize, uint64_t currentPosition) { + ErrorOr> readInt8Array(uint8_t data[], uint64_t dataSize, uint64_t currentPosition) { //TODO: implement return ErrorOr>({0}); } @@ -89,23 +89,23 @@ namespace NBT { // Maybe use a struct that holds decoded (de-Java-fied) string // data, decoded size, and original size? Original size is needed // so the parser knows where to continue. - //ErrorOr<> readString(uint8_t* data[], uint64_t dataSize, uint64_t currentPosition) { + //ErrorOr<> readString(uint8_t data[], uint64_t dataSize, uint64_t currentPosition) { //TODO: implement // return ErrorOr<>(""); //} - ErrorOr> readInt32Array(uint8_t* data[], uint64_t dataSize, uint64_t currentPosition) { + ErrorOr> readInt32Array(uint8_t data[], uint64_t dataSize, uint64_t currentPosition) { //TODO: implement return ErrorOr>({0}); } - ErrorOr> readInt64Array(uint8_t* data[], uint64_t dataSize, uint64_t currentPosition) { + ErrorOr> readInt64Array(uint8_t data[], uint64_t dataSize, uint64_t currentPosition) { //TODO: implement return ErrorOr>({0}); } } - bool validateRawNBTData(uint8_t* data[], uint64_t dataSize){ + bool validateRawNBTData(uint8_t data[], uint64_t dataSize){ //state machine? //TODO: implement return false; diff --git a/src/lib/nbt.h++ b/src/lib/nbt.h++ index 1ca5cfb..450b4b9 100644 --- a/src/lib/nbt.h++ +++ b/src/lib/nbt.h++ @@ -41,30 +41,30 @@ namespace NBT { namespace helper { - ErrorOr readInt8(uint8_t* data[], uint64_t dataSize, uint64_t currentPosition); + ErrorOr readInt8(uint8_t data[], uint64_t dataSize, uint64_t currentPosition); - ErrorOr readInt16(uint8_t* data[], uint64_t dataSize, uint64_t currentPosition); + ErrorOr readInt16(uint8_t data[], uint64_t dataSize, uint64_t currentPosition); - ErrorOr readInt32(uint8_t* data[], uint64_t dataSize, uint64_t currentPosition); + ErrorOr readInt32(uint8_t data[], uint64_t dataSize, uint64_t currentPosition); - ErrorOr readInt64(uint8_t* data[], uint64_t dataSize, uint64_t currentPosition); + ErrorOr readInt64(uint8_t data[], uint64_t dataSize, uint64_t currentPosition); //FIXME: we just assume that float is a single-precision IEEE754 // floating point number - ErrorOr readFloat32(uint8_t* data[], uint64_t dataSize, uint64_t currentPosition); + ErrorOr readFloat32(uint8_t data[], uint64_t dataSize, uint64_t currentPosition); //FIXME: we just assume that double is a double-precision IEEE754 // floating point number - ErrorOr readFloat64(uint8_t* data[], uint64_t dataSize, uint64_t currentPosition); + ErrorOr readFloat64(uint8_t data[], uint64_t dataSize, uint64_t currentPosition); - ErrorOr> readInt8Array(uint8_t* data[], uint64_t dataSize, uint64_t currentPosition); + ErrorOr> readInt8Array(uint8_t data[], uint64_t dataSize, uint64_t currentPosition); - //ErrorOr<> readString(uint8_t* data[], uint64_t dataSize, uint64_t currentPosition); + //ErrorOr<> readString(uint8_t data[], uint64_t dataSize, uint64_t currentPosition); - ErrorOr> readInt32Array(uint8_t* data[], uint64_t dataSize, uint64_t currentPosition); + ErrorOr> readInt32Array(uint8_t data[], uint64_t dataSize, uint64_t currentPosition); - ErrorOr> readInt64Array(uint8_t* data[], uint64_t dataSize, uint64_t currentPosition); + ErrorOr> readInt64Array(uint8_t data[], uint64_t dataSize, uint64_t currentPosition); } - bool validateRawNBTData(uint8_t* data[], int length); + bool validateRawNBTData(uint8_t data[], int length); }