From 0283983044c30ac8d77595a6a5093043c6a7eff4 Mon Sep 17 00:00:00 2001 From: zhuyanlin Date: Fri, 18 Mar 2022 16:56:56 +0800 Subject: [PATCH] fix the compiler warning Signed-off-by: zhuyanlin Change-Id: If557621cf96abea441e80ec7c3154bfc18681021 --- unqlite.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/unqlite.c b/unqlite.c index 77fdbff..0ddeb3a 100644 --- a/unqlite.c +++ b/unqlite.c @@ -4892,7 +4892,7 @@ int unqlite_value_string_format(unqlite_value *pVal, const char *zFormat,...) va_start(ap, zFormat); rc = SyBlobFormatAp(&pVal->sBlob, zFormat, ap); va_end(ap); - return UNQLITE_OK; + return rc; } /* * [CAPIREF: unqlite_value_reset_string_cursor()] @@ -8561,7 +8561,7 @@ JX9_PRIVATE int jx9_value_string_format(jx9_value *pVal, const char *zFormat, .. va_start(ap, zFormat); rc = SyBlobFormatAp(&pVal->sBlob, zFormat, ap); va_end(ap); - return JX9_OK; + return rc; } /* * [CAPIREF: jx9_value_reset_string_cursor()] @@ -12251,7 +12251,6 @@ JX9_PRIVATE sxi32 jx9InputFormat( jx9_value *pArg; /* Current processed argument */ jx9_int64 iVal; int precision; /* Precision of the current field */ - char *zExtra; int c, rc, n; int length; /* Length of the field */ int prefix; @@ -12360,7 +12359,6 @@ JX9_PRIVATE sxi32 jx9InputFormat( } zBuf = zWorker; /* Point to the working buffer */ length = 0; - zExtra = 0; /* ** At this point, variables are initialized as follows: ** @@ -18410,9 +18408,7 @@ static sxi32 jx9CompileBreak(jx9_gen_state *pGen) { GenBlock *pLoop; /* Target loop */ sxi32 iLevel; /* How many nesting loop to skip */ - sxu32 nLine; sxi32 rc; - nLine = pGen->pIn->nLine; iLevel = 0; /* Jump the 'break' keyword */ pGen->pIn++; @@ -19873,13 +19869,12 @@ static sxi32 GenStateProcessArgValue(jx9_gen_state *pGen, jx9_vm_func_arg *pArg, static sxi32 GenStateCollectFuncArgs(jx9_vm_func *pFunc, jx9_gen_state *pGen, SyToken *pEnd) { jx9_vm_func_arg sArg; /* Current processed argument */ - SyToken *pCur, *pIn; /* Token stream */ + SyToken *pIn; /* Token stream */ SyBlob sSig; /* Function signature */ char *zDup; /* Copy of argument name */ sxi32 rc; pIn = pGen->pIn; - pCur = 0; SyBlobInit(&sSig, &pGen->pVm->sAllocator); /* Process arguments one after one */ for(;;){ @@ -29173,7 +29168,6 @@ static const SyFmtInfo aFmt[] = { char prefix; /* Prefix character."+" or "-" or " " or '\0'.*/ sxu8 errorflag = 0; /* True if an error is encountered */ sxu8 xtype; /* Conversion paradigm */ - char *zExtra; static char spaces[] = " "; #define etSPACESIZE ((int)sizeof(spaces)-1) #ifndef SX_OMIT_FLOATINGPOINT @@ -29278,7 +29272,6 @@ static const SyFmtInfo aFmt[] = { break; } } - zExtra = 0; /* ** At this point, variables are initialized as follows: @@ -46259,7 +46252,7 @@ static int vm_builtin_get_defined_constants(jx9_context *pCtx, int nArg, jx9_val */ JX9_PRIVATE sxu32 jx9VmRandomNum(jx9_vm *pVm) { - sxu32 iNum; + sxu32 iNum = 0; SyRandomness(&pVm->sPrng, (void *)&iNum, sizeof(sxu32)); return iNum; } @@ -57926,7 +57919,7 @@ UNQLITE_PRIVATE void unqlitePagerRandomString(Pager *pPager,char *zBuf,sxu32 nLe */ UNQLITE_PRIVATE sxu32 unqlitePagerRandomNum(Pager *pPager) { - sxu32 iNum; + sxu32 iNum = 0; SyRandomness(&pPager->sPrng,(void *)&iNum,sizeof(iNum)); return iNum; }