diff --git a/README-FIX.md b/README-FIX.md new file mode 100644 index 0000000..cc97e58 --- /dev/null +++ b/README-FIX.md @@ -0,0 +1,8 @@ +# tiny-json update + +## update warnings: + +- tiny-json.c: In function 'parseString': +- tiny-json.c:124:13: warning: pointer targets in return differ in signedness [-Wpointer-sign] +- tiny-json.c:128:17: warning: pointer targets in passing argument 1 of 'getCharFromUnicode' differ in signedness [-Wpointer-sign] +- tiny-json.c:105:13: note: expected 'const char *' but argument is of type 'unsigned char *' diff --git a/tiny-json.c b/tiny-json.c index 4f28f13..7522afa 100644 --- a/tiny-json.c +++ b/tiny-json.c @@ -102,7 +102,7 @@ static bool isHexaDigit( unsigned char nibble ) { * @Param str Pointer to first digit. * @retval '?' If the four characters are hexadecimal digits. * @retcal '\0' In other cases. */ -static char getCharFromUnicode( char const* str ) { +static unsigned char getCharFromUnicode( unsigned char const* str ) { unsigned int i; for( i = 0; i < 4; ++i ) if ( !isHexaDigit( str[i] ) ) @@ -121,7 +121,7 @@ static char* parseString( char* str ) { for( ; *head >= ' '; ++head, ++tail ) { if ( *head == '\"' ) { *tail = '\0'; - return ++head; + return (char*)++head; } if ( *head == '\\' ) { if ( *++head == 'u' ) {