/ Check-in [a063f7c4]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix harmless compiler warnings.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: a063f7c426d1ac066bf05cc03288f49b1c92e06a8cb2bc271cce9bd3022a74ea
User & Date: drh 2019-03-26 16:21:11
Context
2019-03-26
16:47
Fix a problem with window frames that use "BETWEEN <start> AND 0 PRECEDING". check-in: 7927b6b0 user: dan tags: trunk
16:21
Fix harmless compiler warnings. check-in: a063f7c4 user: drh tags: trunk
13:08
Add support for new window functions related features - GROUPS frames, RANGE frames with logical start and end points, the EXCLUDE clause and window chaining. check-in: c6da3911 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/misc/fileio.c.

   154    154     }
   155    155     pBuf = sqlite3_malloc64( nIn ? nIn : 1 );
   156    156     if( pBuf==0 ){
   157    157       sqlite3_result_error_nomem(ctx);
   158    158       fclose(in);
   159    159       return;
   160    160     }
   161         -  if( nIn==fread(pBuf, 1, (size_t)nIn, in) ){
          161  +  if( nIn==(sqlite3_int64)fread(pBuf, 1, (size_t)nIn, in) ){
   162    162       sqlite3_result_blob64(ctx, pBuf, nIn, sqlite3_free);
   163    163     }else{
   164    164       sqlite3_result_error_code(ctx, SQLITE_IOERR);
   165    165       sqlite3_free(pBuf);
   166    166     }
   167    167     fclose(in);
   168    168   }

Changes to src/sqlite.h.in.

   185    185   **
   186    186   ** See also: SQL functions [sqlite_compileoption_used()] and
   187    187   ** [sqlite_compileoption_get()] and the [compile_options pragma].
   188    188   */
   189    189   #ifndef SQLITE_OMIT_COMPILEOPTION_DIAGS
   190    190   int sqlite3_compileoption_used(const char *zOptName);
   191    191   const char *sqlite3_compileoption_get(int N);
          192  +#else
          193  +# define sqlite3_compileoption_used(X) 0
          194  +# define sqlite3_compileoption_get(X)  ((void*)0)
   192    195   #endif
   193    196   
   194    197   /*
   195    198   ** CAPI3REF: Test To See If The Library Is Threadsafe
   196    199   **
   197    200   ** ^The sqlite3_threadsafe() function returns zero if and only if
   198    201   ** SQLite was compiled with mutexing code omitted due to the

Changes to src/window.c.

   328    328   static void percent_rankStepFunc(
   329    329     sqlite3_context *pCtx, 
   330    330     int nArg,
   331    331     sqlite3_value **apArg
   332    332   ){
   333    333     struct CallCount *p;
   334    334     UNUSED_PARAMETER(nArg); assert( nArg==0 );
          335  +  UNUSED_PARAMETER(apArg);
   335    336     p = (struct CallCount*)sqlite3_aggregate_context(pCtx, sizeof(*p));
   336    337     if( p ){
   337    338       p->nTotal++;
   338    339     }
   339    340   }
   340    341   static void percent_rankInvFunc(
   341    342     sqlite3_context *pCtx, 
   342    343     int nArg,
   343    344     sqlite3_value **apArg
   344    345   ){
   345    346     struct CallCount *p;
   346    347     UNUSED_PARAMETER(nArg); assert( nArg==0 );
          348  +  UNUSED_PARAMETER(apArg);
   347    349     p = (struct CallCount*)sqlite3_aggregate_context(pCtx, sizeof(*p));
   348    350     p->nStep++;
   349    351   }
   350    352   static void percent_rankValueFunc(sqlite3_context *pCtx){
   351    353     struct CallCount *p;
   352    354     p = (struct CallCount*)sqlite3_aggregate_context(pCtx, sizeof(*p));
   353    355     if( p ){
................................................................................
   371    373   static void cume_distStepFunc(
   372    374     sqlite3_context *pCtx, 
   373    375     int nArg,
   374    376     sqlite3_value **apArg
   375    377   ){
   376    378     struct CallCount *p;
   377    379     UNUSED_PARAMETER(nArg); assert( nArg==0 );
          380  +  UNUSED_PARAMETER(apArg);
   378    381     p = (struct CallCount*)sqlite3_aggregate_context(pCtx, sizeof(*p));
   379    382     if( p ){
   380    383       p->nTotal++;
   381    384     }
   382    385   }
   383    386   static void cume_distInvFunc(
   384    387     sqlite3_context *pCtx, 
   385    388     int nArg,
   386    389     sqlite3_value **apArg
   387    390   ){
   388    391     struct CallCount *p;
   389    392     UNUSED_PARAMETER(nArg); assert( nArg==0 );
          393  +  UNUSED_PARAMETER(apArg);
   390    394     p = (struct CallCount*)sqlite3_aggregate_context(pCtx, sizeof(*p));
   391    395     p->nStep++;
   392    396   }
   393    397   static void cume_distValueFunc(sqlite3_context *pCtx){
   394    398     struct CallCount *p;
   395    399     p = (struct CallCount*)sqlite3_aggregate_context(pCtx, 0);
   396    400     if( p ){
................................................................................
   438    442   static void ntileInvFunc(
   439    443     sqlite3_context *pCtx, 
   440    444     int nArg,
   441    445     sqlite3_value **apArg
   442    446   ){
   443    447     struct NtileCtx *p;
   444    448     assert( nArg==1 ); UNUSED_PARAMETER(nArg);
          449  +  UNUSED_PARAMETER(apArg);
   445    450     p = (struct NtileCtx*)sqlite3_aggregate_context(pCtx, sizeof(*p));
   446    451     p->iRow++;
   447    452   }
   448    453   static void ntileValueFunc(sqlite3_context *pCtx){
   449    454     struct NtileCtx *p;
   450    455     p = (struct NtileCtx*)sqlite3_aggregate_context(pCtx, sizeof(*p));
   451    456     if( p && p->nParam>0 ){
................................................................................
  2351   2356     ExprList *pOrderBy = pMWin->pOrderBy;
  2352   2357     Vdbe *v = sqlite3GetVdbe(pParse);
  2353   2358     int csrWrite;                   /* Cursor used to write to eph. table */
  2354   2359     int csrInput = p->pSrc->a[0].iCursor;     /* Cursor of sub-select */
  2355   2360     int nInput = p->pSrc->a[0].pTab->nCol;    /* Number of cols returned by sub */
  2356   2361     int iInput;                               /* To iterate through sub cols */
  2357   2362     int addrNe;                     /* Address of OP_Ne */
  2358         -  int addrGosubFlush;             /* Address of OP_Gosub to flush: */
  2359         -  int addrInteger;                /* Address of OP_Integer */
         2363  +  int addrGosubFlush = 0;         /* Address of OP_Gosub to flush: */
         2364  +  int addrInteger = 0;            /* Address of OP_Integer */
  2360   2365     int addrEmpty;                  /* Address of OP_Rewind in flush: */
  2361   2366     int regStart = 0;               /* Value of <expr> PRECEDING */
  2362   2367     int regEnd = 0;                 /* Value of <expr> FOLLOWING */
  2363   2368     int regNew;                     /* Array of registers holding new input row */
  2364   2369     int regRecord;                  /* regNew array in record form */
  2365   2370     int regRowid;                   /* Rowid for regRecord in eph table */
  2366   2371     int regNewPeer = 0;             /* Peer values for new row (part of regNew) */