mirror of
https://github.com/rafagafe/tiny-json.git
synced 2024-11-17 11:35:30 +00:00
tiny-json.c(84): warning C4204: Nicht dem Standard entsprechende Erweiterung: Initialisierung für zusammengesetzten Typ ist keine Konstante
tiny-json.c(296): warning C4244: "Initialisierung": Konvertierung von "__int64" in "const unsigned int", möglicher Datenverlust
This commit is contained in:
parent
1fe46ee557
commit
72f015286d
15
tiny-json.c
15
tiny-json.c
@ -81,14 +81,11 @@ json_t const* json_createWithPool( char *str, jsonPool_t *pool ) {
|
|||||||
|
|
||||||
/* Parse a string to get a json. */
|
/* Parse a string to get a json. */
|
||||||
json_t const* json_create( char* str, json_t mem[], unsigned int qty ) {
|
json_t const* json_create( char* str, json_t mem[], unsigned int qty ) {
|
||||||
jsonStaticPool_t spool = {
|
jsonStaticPool_t spool;
|
||||||
.mem = mem,
|
spool.mem = mem;
|
||||||
.qty = qty,
|
spool.qty = qty;
|
||||||
.pool = {
|
spool.pool.init = poolInit;
|
||||||
.init = poolInit,
|
spool.pool.alloc = poolAlloc;
|
||||||
.alloc = poolAlloc
|
|
||||||
}
|
|
||||||
};
|
|
||||||
return json_createWithPool( str, &spool.pool );
|
return json_createWithPool( str, &spool.pool );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -293,7 +290,7 @@ static char* numValue( char* ptr, json_t* property ) {
|
|||||||
static char const min[] = "-9223372036854775808";
|
static char const min[] = "-9223372036854775808";
|
||||||
static char const max[] = "9223372036854775807";
|
static char const max[] = "9223372036854775807";
|
||||||
unsigned int const maxdigits = ( negative? sizeof min: sizeof max ) - 1;
|
unsigned int const maxdigits = ( negative? sizeof min: sizeof max ) - 1;
|
||||||
unsigned int const len = ptr - value;
|
unsigned int const len = ( unsigned int const ) ( ptr - value );
|
||||||
if ( len > maxdigits ) return 0;
|
if ( len > maxdigits ) return 0;
|
||||||
if ( len == maxdigits ) {
|
if ( len == maxdigits ) {
|
||||||
char const tmp = *ptr;
|
char const tmp = *ptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user