From: drh <> Date: Fri, 6 Oct 2023 14:59:40 +0000 (+0000) Subject: Fix compiler warnings. X-Git-Tag: version-3.45.0~116^2~101 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e690d5ad80ae90573fce913b0c01d05aaac0c769;p=thirdparty%2Fsqlite.git Fix compiler warnings. FossilOrigin-Name: 5227add3c8d509de2e081249163fafdf30ac3173a6d710957f3c3b6f03e7017e --- diff --git a/manifest b/manifest index 555f873fb7..53be387052 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improvements\sto\serror\shandling. -D 2023-10-06T14:52:49.860 +C Fix\scompiler\swarnings. +D 2023-10-06T14:59:40.414 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -670,7 +670,7 @@ F src/hash.h 3340ab6e1d13e725571d7cee6d3e3135f0779a7d8e76a9ce0a85971fa3953c51 F src/hwtime.h f9c2dfb84dce7acf95ce6d289e46f5f9d3d1afd328e53da8f8e9008e3b3caae6 F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71 F src/insert.c 3f0a94082d978bbdd33c38fefea15346c6c6bffb70bc645a71dc0f1f87dd3276 -F src/json.c fe8cd7b38e947a89fbe8b8099a88ee363d02a6747009ba5246a517de1e15159f +F src/json.c e1a4c5ffadbeaab6dfd9dfb687f8c7a0b9e012ad2ec8b74223e75f86295a5a5e F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa F src/loadext.c 98cfba10989b3da6f1807ad42444017742db7f100a54f1032af7a8b1295912c0 F src/main.c 618aeb399e993cf561864f4b0cf6a331ee4f355cf663635f8d9da3193a46aa40 @@ -2124,8 +2124,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 6409d307915f8969f12df2d5ffa961645bd4db7ccfbd6f52237a217b6a867252 -R bb54780cc2adfb5e91d01e5a38070ac9 +P b41dd237fb6c0dd7daedeaaf81dbc4fdb31cf511fd32cd3d4ee69db34e389915 +R d43877b0997e4344224eb4366c47821e U drh -Z 4eb2d45211dd6d4bee3b0c79a0072e1a +Z 0dbbe0cfb7ed03f93b950daed7da83cd # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 950949b618..cd9e86ced9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -b41dd237fb6c0dd7daedeaaf81dbc4fdb31cf511fd32cd3d4ee69db34e389915 \ No newline at end of file +5227add3c8d509de2e081249163fafdf30ac3173a6d710957f3c3b6f03e7017e \ No newline at end of file diff --git a/src/json.c b/src/json.c index 69c9e67b6b..b2053af9ec 100644 --- a/src/json.c +++ b/src/json.c @@ -3267,7 +3267,7 @@ static u32 jsonRenderBlob( break; } case JSONB_INT5: { /* Integer literal in hexadecimal notation */ - int k = 2; + u32 k = 2; sqlite3_uint64 u = 0; const char *zIn = (const char*)&pParse->aBlob[i+n]; if( zIn[0]=='+' || zIn[0]=='-' ){ @@ -3281,7 +3281,7 @@ static u32 jsonRenderBlob( break; } case JSONB_FLOAT5: { /* Float literal missing digits beside "." */ - int k = 0; + u32 k = 0; const char *zIn = (const char*)&pParse->aBlob[i+n]; if( zIn[0]=='+' || zIn[0]=='-' ){ if( zIn[0]=='-' ) jsonAppendChar(pOut, '-'); @@ -3753,14 +3753,14 @@ static u32 jsonLookupBlobStep( k = jsonbArrayCount(pParse, iRoot); i = 2; if( zPath[2]=='-' && sqlite3Isdigit(zPath[3]) ){ - unsigned int x = 0; + unsigned int nn = 0; i = 3; do{ - x = x*10 + zPath[i] - '0'; + nn = nn*10 + zPath[i] - '0'; i++; }while( sqlite3Isdigit(zPath[i]) ); - if( x>k ) return 0; - k -= x; + if( nn>k ) return 0; + k -= nn; } if( zPath[i]!=']' ){ *pzErr = zPath; @@ -3997,7 +3997,7 @@ static void jsonExtractFromBlob( ){ const char *zPath = (const char*)sqlite3_value_text(pPath); const char *zErr = 0; - u32 i; + u32 i = 0; JsonParse px; if( zPath==0 ) return; memset(&px, 0, sizeof(px)); @@ -4031,6 +4031,9 @@ static void jsonExtractFromBlob( } i = jsonLookupBlobStep(&px, 0, zPath, &zErr); jsonStringReset(&jx); + }else{ + sqlite3_result_error(ctx, "bad path", -1); + return; } if( i