Resolve some compiler warnings

This commit is contained in:
Eric Tang
2017-07-15 07:06:20 -07:00
parent b329485ac9
commit 85b709bad9
2 changed files with 4 additions and 4 deletions

View File

@@ -7,9 +7,9 @@ uint8_t readUInt8(config_buffer_t *buffer) {
} }
uint16_t readUInt16(config_buffer_t *buffer) { uint16_t readUInt16(config_buffer_t *buffer) {
uint16_t uInt16 = *(uint16_t *)(buffer->buffer + buffer->offset); uint16_t uInt16 = readUInt8(buffer);
buffer->offset += 2; uInt16 |= readUInt8(buffer) << 8;
return uInt16; return uInt16;
} }
@@ -27,7 +27,7 @@ const char *readString(config_buffer_t *buffer, uint16_t *len) {
const char *string; const char *string;
*len = readCompactLength(buffer); *len = readCompactLength(buffer);
string = buffer->buffer + buffer->offset; string = (const char *)(buffer->buffer + buffer->offset);
buffer->offset += *len; buffer->offset += *len;
return string; return string;
} }

View File

@@ -13,7 +13,7 @@
// Typedefs: // Typedefs:
typedef struct { typedef struct {
uint8_t const buffer[EEPROM_SIZE]; uint8_t buffer[EEPROM_SIZE];
uint16_t offset; uint16_t offset;
} config_buffer_t; } config_buffer_t;