Index: ext/misc/json1.c ================================================================== --- ext/misc/json1.c +++ ext/misc/json1.c @@ -1845,10 +1845,12 @@ ){ int i; int inStr = 0; char *z; JsonString *pStr; + UNUSED_PARAM(argc); + UNUSED_PARAM(argv); pStr = (JsonString*)sqlite3_aggregate_context(ctx, 0); #ifdef NEVER /* pStr is always non-NULL since jsonArrayStep() or jsonObjectStep() will ** always have been called to initalize it */ if( NEVER(!pStr) ) return; Index: src/func.c ================================================================== --- src/func.c +++ src/func.c @@ -1669,17 +1669,17 @@ if( bValue==0 ) sqlite3VdbeMemRelease(pRes); } } #ifndef SQLITE_OMIT_WINDOWFUNC static void minMaxValue(sqlite3_context *context){ - return minMaxValueFinalize(context, 1); + minMaxValueFinalize(context, 1); } #else # define minMaxValue 0 #endif /* SQLITE_OMIT_WINDOWFUNC */ static void minMaxFinalize(sqlite3_context *context){ - return minMaxValueFinalize(context, 0); + minMaxValueFinalize(context, 0); } /* ** group_concat(EXPR, ?SEPARATOR?) */ @@ -1720,12 +1720,12 @@ sqlite3_context *context, int argc, sqlite3_value **argv ){ int n; - assert( argc==1 || argc==2 ); StrAccum *pAccum; + assert( argc==1 || argc==2 ); if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return; pAccum = (StrAccum*)sqlite3_aggregate_context(context, sizeof(*pAccum)); /* pAccum is always non-NULL since groupConcatStep() will have always ** run frist to initialize it */ if( ALWAYS(pAccum) ){ @@ -1733,11 +1733,11 @@ if( argc==2 ){ n += sqlite3_value_bytes(argv[1]); }else{ n++; } - if( n>=pAccum->nChar ){ + if( n>=(int)pAccum->nChar ){ pAccum->nChar = 0; }else{ pAccum->nChar -= n; memmove(pAccum->zText, &pAccum->zText[n], pAccum->nChar); } Index: src/main.c ================================================================== --- src/main.c +++ src/main.c @@ -1738,11 +1738,11 @@ ** and there are active VMs, then return SQLITE_BUSY. If a function ** is being overridden/deleted but there are no active VMs, allow the ** operation to continue but invalidate all precompiled statements. */ p = sqlite3FindFunction(db, zFunctionName, nArg, (u8)enc, 0); - if( p && (p->funcFlags & SQLITE_FUNC_ENCMASK)==enc && p->nArg==nArg ){ + if( p && (p->funcFlags & SQLITE_FUNC_ENCMASK)==(u32)enc && p->nArg==nArg ){ if( db->nVdbeActive ){ sqlite3ErrorWithMsg(db, SQLITE_BUSY, "unable to delete/modify user-function due to active statements"); assert( !db->mallocFailed ); return SQLITE_BUSY; Index: src/parse.y ================================================================== --- src/parse.y +++ src/parse.y @@ -545,11 +545,11 @@ if( A ){ A->pWinDefn = R; }else{ sqlite3WindowListDelete(pParse->db, R); } -#endif // SQLITE_OMIT_WINDOWFUNC +#endif /* SQLITE_OMIT_WINDOWFUNC */ #if SELECTTRACE_ENABLED /* Populate the Select.zSelName[] string that is used to help with ** query planner debugging, to differentiate between multiple Select ** objects in a complex query. ** @@ -1700,6 +1700,6 @@ } } filter_opt(A) ::= . { A = 0; } filter_opt(A) ::= FILTER LP WHERE expr(X) RP. { A = X; } -%endif // SQLITE_OMIT_WINDOWFUNC +%endif /* SQLITE_OMIT_WINDOWFUNC */ Index: src/tokenize.c ================================================================== --- src/tokenize.c +++ src/tokenize.c @@ -262,11 +262,11 @@ if( lastToken==TK_RP && getToken(&z)==TK_LP ){ return TK_FILTER; } return TK_ID; } -#endif // SQLITE_OMIT_WINDOWFUNC +#endif /* SQLITE_OMIT_WINDOWFUNC */ /* ** Return the length (in bytes) of the token that begins at z[0]. ** Store the token type in *tokenType before returning. */ @@ -602,11 +602,11 @@ || tokenType==TK_ILLEGAL || tokenType==TK_WINDOW ); #else if( tokenType>=TK_SPACE ){ assert( tokenType==TK_SPACE || tokenType==TK_ILLEGAL ); -#endif // SQLITE_OMIT_WINDOWFUNC +#endif /* SQLITE_OMIT_WINDOWFUNC */ if( db->u1.isInterrupted ){ pParse->rc = SQLITE_INTERRUPT; break; } if( tokenType==TK_SPACE ){ @@ -632,11 +632,11 @@ assert( n==4 ); tokenType = analyzeOverKeyword((const u8*)&zSql[4], lastTokenParsed); }else if( tokenType==TK_FILTER ){ assert( n==6 ); tokenType = analyzeFilterKeyword((const u8*)&zSql[6], lastTokenParsed); -#endif // SQLITE_OMIT_WINDOWFUNC +#endif /* SQLITE_OMIT_WINDOWFUNC */ }else{ sqlite3ErrorMsg(pParse, "unrecognized token: \"%.*s\"", n, zSql); break; } } Index: src/window.c ================================================================== --- src/window.c +++ src/window.c @@ -149,10 +149,12 @@ int nArg, sqlite3_value **apArg ){ i64 *p = (i64*)sqlite3_aggregate_context(pCtx, sizeof(*p)); if( p ) (*p)++; + UNUSED_PARAMETER(nArg); + UNUSED_PARAMETER(apArg); } static void row_numberValueFunc(sqlite3_context *pCtx){ i64 *p = (i64*)sqlite3_aggregate_context(pCtx, sizeof(*p)); sqlite3_result_int64(pCtx, (p ? *p : 0)); } @@ -179,10 +181,12 @@ sqlite3_value **apArg ){ struct CallCount *p; p = (struct CallCount*)sqlite3_aggregate_context(pCtx, sizeof(*p)); if( p ) p->nStep = 1; + UNUSED_PARAMETER(nArg); + UNUSED_PARAMETER(apArg); } static void dense_rankValueFunc(sqlite3_context *pCtx){ struct CallCount *p; p = (struct CallCount*)sqlite3_aggregate_context(pCtx, sizeof(*p)); if( p ){ @@ -211,10 +215,12 @@ p->nStep++; if( p->nValue==0 ){ p->nValue = p->nStep; } } + UNUSED_PARAMETER(nArg); + UNUSED_PARAMETER(apArg); } static void rankValueFunc(sqlite3_context *pCtx){ struct CallCount *p; p = (struct CallCount*)sqlite3_aggregate_context(pCtx, sizeof(*p)); if( p ){ @@ -233,11 +239,11 @@ sqlite3_context *pCtx, int nArg, sqlite3_value **apArg ){ struct CallCount *p; - assert( nArg==1 ); + UNUSED_PARAMETER(nArg); assert( nArg==1 ); p = (struct CallCount*)sqlite3_aggregate_context(pCtx, sizeof(*p)); if( p ){ if( p->nTotal==0 ){ p->nTotal = sqlite3_value_int64(apArg[0]); @@ -272,11 +278,11 @@ sqlite3_context *pCtx, int nArg, sqlite3_value **apArg ){ struct CallCount *p; - assert( nArg==1 ); + assert( nArg==1 ); UNUSED_PARAMETER(nArg); p = (struct CallCount*)sqlite3_aggregate_context(pCtx, sizeof(*p)); if( p ){ if( p->nTotal==0 ){ p->nTotal = sqlite3_value_int64(apArg[0]); @@ -312,11 +318,11 @@ sqlite3_context *pCtx, int nArg, sqlite3_value **apArg ){ struct NtileCtx *p; - assert( nArg==2 ); + assert( nArg==2 ); UNUSED_PARAMETER(nArg); p = (struct NtileCtx*)sqlite3_aggregate_context(pCtx, sizeof(*p)); if( p ){ if( p->nTotal==0 ){ p->nParam = sqlite3_value_int64(apArg[0]); p->nTotal = sqlite3_value_int64(apArg[1]); @@ -367,10 +373,11 @@ sqlite3_context *pCtx, int nArg, sqlite3_value **apArg ){ struct LastValueCtx *p; + UNUSED_PARAMETER(nArg); p = (struct LastValueCtx*)sqlite3_aggregate_context(pCtx, sizeof(*p)); if( p ){ sqlite3_value_free(p->pVal); p->pVal = sqlite3_value_dup(apArg[0]); if( p->pVal==0 ){ @@ -384,10 +391,12 @@ sqlite3_context *pCtx, int nArg, sqlite3_value **apArg ){ struct LastValueCtx *p; + UNUSED_PARAMETER(nArg); + UNUSED_PARAMETER(apArg); p = (struct LastValueCtx*)sqlite3_aggregate_context(pCtx, sizeof(*p)); if( ALWAYS(p) ){ p->nVal--; if( p->nVal==0 ){ sqlite3_value_free(p->pVal); @@ -444,37 +453,40 @@ static void noopStepFunc( /*NO_TEST*/ sqlite3_context *p, /*NO_TEST*/ int n, /*NO_TEST*/ sqlite3_value **a /*NO_TEST*/ ){ /*NO_TEST*/ + UNUSED_PARAMETER(p); /*NO_TEST*/ + UNUSED_PARAMETER(n); /*NO_TEST*/ + UNUSED_PARAMETER(a); /*NO_TEST*/ assert(0); /*NO_TEST*/ } /*NO_TEST*/ -static void noopValueFunc(sqlite3_context *p){ /*no-op*/; } +static void noopValueFunc(sqlite3_context *p){ UNUSED_PARAMETER(p); /*no-op*/ } /* Window functions that use all window interfaces: xStep, xFinal, ** xValue, and xInverse */ #define WINDOWFUNCALL(name,nArg,extra) { \ nArg, (SQLITE_UTF8|SQLITE_FUNC_WINDOW|extra), 0, 0, \ name ## StepFunc, name ## FinalizeFunc, name ## ValueFunc, \ - name ## InvFunc, name ## Name \ + name ## InvFunc, name ## Name, {0} \ } /* Window functions that are implemented using bytecode and thus have ** no-op routines for their methods */ #define WINDOWFUNCNOOP(name,nArg,extra) { \ nArg, (SQLITE_UTF8|SQLITE_FUNC_WINDOW|extra), 0, 0, \ noopStepFunc, noopValueFunc, noopValueFunc, \ - noopStepFunc, name ## Name \ + noopStepFunc, name ## Name, {0} \ } /* Window functions that use all window interfaces: xStep, the ** same routine for xFinalize and xValue and which never call ** xInverse. */ #define WINDOWFUNCX(name,nArg,extra) { \ nArg, (SQLITE_UTF8|SQLITE_FUNC_WINDOW|extra), 0, 0, \ name ## StepFunc, name ## ValueFunc, name ## ValueFunc, \ - noopStepFunc, name ## Name \ + noopStepFunc, name ## Name, {0} \ } /* ** Register those built-in window functions that are not also aggregates. @@ -629,10 +641,12 @@ } return WRC_Continue; } static int selectWindowRewriteSelectCb(Walker *pWalker, Select *pSelect){ + UNUSED_PARAMETER(pWalker); + UNUSED_PARAMETER(pSelect); return WRC_Prune; } /* @@ -1541,12 +1555,12 @@ int csrEnd = pParse->nTab++; int regStart; /* Value of PRECEDING */ int regEnd; /* Value of FOLLOWING */ int addrGoto; int addrTop; - int addrIfPos1; - int addrIfPos2; + int addrIfPos1 = 0; + int addrIfPos2 = 0; int regSize = 0; assert( pMWin->eStart==TK_PRECEDING || pMWin->eStart==TK_CURRENT || pMWin->eStart==TK_FOLLOWING @@ -1862,13 +1876,13 @@ VdbeCoverage(v); sqlite3VdbeAddOp2(v, OP_Rewind, pMWin->iEphCsr, lblEmpty); VdbeCoverageNeverTaken(v); if( bReverse ){ - int addr = sqlite3VdbeCurrentAddr(v); + int addr2 = sqlite3VdbeCurrentAddr(v); windowAggStep(pParse, pMWin, csrLead, 0, regArg, regSize); - sqlite3VdbeAddOp2(v, OP_Next, csrLead, addr); + sqlite3VdbeAddOp2(v, OP_Next, csrLead, addr2); VdbeCoverage(v); sqlite3VdbeAddOp2(v, OP_Rewind, csrLead, lblEmpty); VdbeCoverageNeverTaken(v); } addrNext = sqlite3VdbeCurrentAddr(v); Index: tool/lempar.c ================================================================== --- tool/lempar.c +++ tool/lempar.c @@ -548,11 +548,11 @@ j>=0 && #endif #if YY_SHIFT_MAX+YYWILDCARD>=YY_ACTTAB_COUNT j0 ){ #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n", @@ -1064,11 +1064,13 @@ ** Return the fallback token corresponding to canonical token iToken, or ** 0 if iToken has no fallback. */ int ParseFallback(int iToken){ #ifdef YYFALLBACK - if( iToken