From 72f015286d8871fe0f8e9536249e88d8ec5387af Mon Sep 17 00:00:00 2001 From: "Jesko (Cetus)" Date: Sat, 28 Mar 2020 19:35:44 +0100 Subject: [PATCH] =?UTF-8?q?tiny-json.c(84):=20warning=20C4204:=20Nicht=20d?= =?UTF-8?q?em=20Standard=20entsprechende=20Erweiterung:=20Initialisierung?= =?UTF-8?q?=20f=C3=BCr=20zusammengesetzten=20Typ=20ist=20keine=20Konstante?= =?UTF-8?q?=20tiny-json.c(296):=20warning=20C4244:=20"Initialisierung":=20?= =?UTF-8?q?Konvertierung=20von=20"=5F=5Fint64"=20in=20"const=20unsigned=20?= =?UTF-8?q?int",=20m=C3=B6glicher=20Datenverlust?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tiny-json.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tiny-json.c b/tiny-json.c index ce27497..5c164e2 100644 --- a/tiny-json.c +++ b/tiny-json.c @@ -81,14 +81,11 @@ json_t const* json_createWithPool( char *str, jsonPool_t *pool ) { /* Parse a string to get a json. */ json_t const* json_create( char* str, json_t mem[], unsigned int qty ) { - jsonStaticPool_t spool = { - .mem = mem, - .qty = qty, - .pool = { - .init = poolInit, - .alloc = poolAlloc - } - }; + jsonStaticPool_t spool; + spool.mem = mem; + spool.qty = qty; + spool.pool.init = poolInit; + spool.pool.alloc = poolAlloc; 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 max[] = "9223372036854775807"; 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 ) { char const tmp = *ptr;