Skip to content

Commit 30f6e3b

Browse files
authored
Merge pull request #43 from LeeLeahy2/type-mismatches
Fix type mismatches
2 parents 37e7639 + 695b0f5 commit 30f6e3b

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/Parse_NMEA.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ bool sempNmeaFindAsterisk(SEMP_PARSE_STATE *parse, uint8_t data)
201201
parse->crc ^= data;
202202

203203
// Verify that enough space exists in the buffer
204-
if ((parse->length + NMEA_BUFFER_OVERHEAD) > parse->bufferLength)
204+
if ((uint32_t)(parse->length + NMEA_BUFFER_OVERHEAD) > parse->bufferLength)
205205
{
206206
// sentence too long
207207
sempPrintf(parse->printDebug,

src/Parse_Unicore_Hash.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ void sempUnicoreHashValidatCrc(SEMP_PARSE_STATE *parse)
8181
}
8282

8383
// Verify that enough space exists in the buffer
84-
if ((parse->length + UNICORE_HASH_BUFFER_OVERHEAD) > parse->bufferLength)
84+
if ((uint32_t)(parse->length + UNICORE_HASH_BUFFER_OVERHEAD) > parse->bufferLength)
8585
{
8686
// Sentence too long
8787
sempPrintf(parse->printDebug,
@@ -108,7 +108,7 @@ void sempUnicoreHashValidatCrc(SEMP_PARSE_STATE *parse)
108108
// Validate the checksum
109109
void sempUnicoreHashValidateChecksum(SEMP_PARSE_STATE *parse)
110110
{
111-
int checksum;
111+
uint32_t checksum;
112112
SEMP_SCRATCH_PAD *scratchPad = (SEMP_SCRATCH_PAD *)parse->scratchPad;
113113

114114
// Determine if a CRC was used for this message
@@ -268,7 +268,7 @@ bool sempUnicoreHashFindAsterisk(SEMP_PARSE_STATE *parse, uint8_t data)
268268
parse->crc ^= data;
269269

270270
// Verify that enough space exists in the buffer
271-
if ((parse->length + UNICORE_HASH_BUFFER_OVERHEAD) > parse->bufferLength)
271+
if ((uint32_t)(parse->length + UNICORE_HASH_BUFFER_OVERHEAD) > parse->bufferLength)
272272
{
273273
// sentence too long
274274
sempPrintf(parse->printDebug,

src/SparkFun_Extensible_Message_Parser.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ SEMP_PARSE_STATE * sempAllocateParseStructure(
7676
// Allocate the parser
7777
length = parseBytes + scratchPadBytes;
7878
parse = (SEMP_PARSE_STATE *)malloc(length + bufferLength);
79-
sempPrintf(printDebug, "parse: %p", parse);
79+
sempPrintf(printDebug, "parse: %p", (void *)parse);
8080

8181
// Initialize the parse structure
8282
if (parse)
@@ -85,13 +85,13 @@ SEMP_PARSE_STATE * sempAllocateParseStructure(
8585
memset(parse, 0, length);
8686

8787
// Set the scratch pad area address
88-
parse->scratchPad = ((void *)parse) + parseBytes;
88+
parse->scratchPad = ((uint8_t *)parse) + parseBytes;
8989
parse->printDebug = printDebug;
9090
sempPrintf(parse->printDebug, "parse->scratchPad: %p", parse->scratchPad);
9191

9292
// Set the buffer address and length
9393
parse->bufferLength = bufferLength;
94-
parse->buffer = (uint8_t *)(parse->scratchPad + scratchPadBytes);
94+
parse->buffer = ((uint8_t *)parse->scratchPad + scratchPadBytes);
9595
sempPrintf(parse->printDebug, "parse->buffer: %p", parse->buffer);
9696
}
9797
return parse;
@@ -131,8 +131,8 @@ void sempPrintParserConfiguration(SEMP_PARSE_STATE *parse, Print *print)
131131
{
132132
sempPrintln(print, "SparkFun Extensible Message Parser");
133133
sempPrintf(print, " Name: %p (%s)", parse->parserName, parse->parserName);
134-
sempPrintf(print, " parsers: %p", parse->parsers);
135-
sempPrintf(print, " parserNames: %p", parse->parserNames);
134+
sempPrintf(print, " parsers: %p", (void *)parse->parsers);
135+
sempPrintf(print, " parserNames: %p", (void *)parse->parserNames);
136136
sempPrintf(print, " parserCount: %d", parse->parserCount);
137137
sempPrintf(print, " printError: %p", parse->printError);
138138
sempPrintf(print, " printDebug: %p", parse->printDebug);

0 commit comments

Comments
 (0)