NBT: Implement readInt8 helper closing #2
parent
12e9533772
commit
4f760f44be
|
@ -44,8 +44,8 @@ int endianness_example() {
|
||||||
namespace NBT {
|
namespace NBT {
|
||||||
namespace helper {
|
namespace helper {
|
||||||
ErrorOr<int8_t> readInt8(uint8_t data[], uint64_t dataSize, uint64_t currentPosition) {
|
ErrorOr<int8_t> readInt8(uint8_t data[], uint64_t dataSize, uint64_t currentPosition) {
|
||||||
//TODO: implement
|
if (dataSize<=currentPosition) return ErrorOr<int8_t>(true, ErrorCodes::RANGE_ERROR);
|
||||||
return ErrorOr<int8_t>((int8_t) 0);
|
return ErrorOr<int8_t>((int8_t) data[currentPosition]);
|
||||||
}
|
}
|
||||||
|
|
||||||
ErrorOr<int16_t> readInt16(uint8_t data[], uint64_t dataSize, uint64_t currentPosition) {
|
ErrorOr<int16_t> readInt16(uint8_t data[], uint64_t dataSize, uint64_t currentPosition) {
|
||||||
|
|
Loading…
Reference in New Issue