/ Check-in [d05becd8]
Login

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

Overview
Comment:Fix harmless compiler warnings seen with MSVC 2015.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | vsix2015
Files: files | file ages | folders
SHA1: d05becd873a03a366843a34e7f4c732dd8f88c86
User & Date: mistachkin 2015-04-19 21:43:16
Context
2015-04-19
23:39
Modify the 'mkvsix' tool itself to support the Visual Studio 2015 CTP. check-in: e0b7a191 user: mistachkin tags: vsix2015
21:43
Fix harmless compiler warnings seen with MSVC 2015. check-in: d05becd8 user: mistachkin tags: vsix2015
19:53
Document the NMAKE_ARGS environment variable as well. check-in: 977fd39c user: mistachkin tags: vsix2015
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/fts3/fts3_tokenizer.c.

   275    275     nInput = sqlite3_value_bytes(argv[argc-1]);
   276    276     zInput = (const char *)sqlite3_value_text(argv[argc-1]);
   277    277   
   278    278     pHash = (Fts3Hash *)sqlite3_user_data(context);
   279    279     p = (sqlite3_tokenizer_module *)sqlite3Fts3HashFind(pHash, zName, nName+1);
   280    280   
   281    281     if( !p ){
   282         -    char *zErr = sqlite3_mprintf("unknown tokenizer: %s", zName);
   283         -    sqlite3_result_error(context, zErr, -1);
   284         -    sqlite3_free(zErr);
          282  +    char *zErr2 = sqlite3_mprintf("unknown tokenizer: %s", zName);
          283  +    sqlite3_result_error(context, zErr2, -1);
          284  +    sqlite3_free(zErr2);
   285    285       return;
   286    286     }
   287    287   
   288    288     pRet = Tcl_NewObj();
   289    289     Tcl_IncrRefCount(pRet);
   290    290   
   291    291     for(i=1; i<argc-1; i++){

Changes to ext/misc/fuzzer.c.

   872    872     fuzzer_rule *pRule;
   873    873     unsigned int h;
   874    874   
   875    875     pNew = sqlite3_malloc( sizeof(*pNew) + (int)strlen(zWord) + 1 );
   876    876     if( pNew==0 ) return 0;
   877    877     memset(pNew, 0, sizeof(*pNew));
   878    878     pNew->zBasis = (char*)&pNew[1];
   879         -  pNew->nBasis = (int)strlen(zWord);
          879  +  pNew->nBasis = (fuzzer_len)strlen(zWord);
   880    880     memcpy(pNew->zBasis, zWord, pNew->nBasis+1);
   881    881     pRule = pCur->pVtab->pRule;
   882    882     while( fuzzerSkipRule(pRule, pNew, pCur->iRuleset) ){
   883    883       pRule = pRule->pNext;
   884    884     }
   885    885     pNew->pRule = pRule;
   886    886     pNew->n = -1;

Changes to src/insert.c.

  2017   2017         ** should be inserted. This is faster.
  2018   2018         **
  2019   2019         ** If any of the indexed columns use a collation sequence other than
  2020   2020         ** BINARY, this optimization is disabled. This is because the user 
  2021   2021         ** might change the definition of a collation sequence and then run
  2022   2022         ** a VACUUM command. In that case keys may not be written in strictly
  2023   2023         ** sorted order.  */
  2024         -      int i;
  2025   2024         for(i=0; i<pSrcIdx->nColumn; i++){
  2026   2025           char *zColl = pSrcIdx->azColl[i];
  2027   2026           assert( zColl!=0 );
  2028   2027           if( sqlite3_stricmp("BINARY", zColl) ) break;
  2029   2028         }
  2030   2029         if( i==pSrcIdx->nColumn ){
  2031   2030           useSeekResult = OPFLAG_USESEEKRESULT;

Changes to src/pager.c.

  3040   3040     Pager *pPager,                  /* Pager object */
  3041   3041     PgHdr *pList,                   /* List of frames to log */
  3042   3042     Pgno nTruncate,                 /* Database size after this commit */
  3043   3043     int isCommit                    /* True if this is a commit */
  3044   3044   ){
  3045   3045     int rc;                         /* Return code */
  3046   3046     int nList;                      /* Number of pages in pList */
  3047         -#if defined(SQLITE_DEBUG) || defined(SQLITE_CHECK_PAGES)
  3048   3047     PgHdr *p;                       /* For looping over pages */
  3049         -#endif
  3050   3048   
  3051   3049     assert( pPager->pWal );
  3052   3050     assert( pList );
  3053   3051   #ifdef SQLITE_DEBUG
  3054   3052     /* Verify that the page list is in accending order */
  3055   3053     for(p=pList; p && p->pDirty; p=p->pDirty){
  3056   3054       assert( p->pgno < p->pDirty->pgno );
................................................................................
  3059   3057   
  3060   3058     assert( pList->pDirty==0 || isCommit );
  3061   3059     if( isCommit ){
  3062   3060       /* If a WAL transaction is being committed, there is no point in writing
  3063   3061       ** any pages with page numbers greater than nTruncate into the WAL file.
  3064   3062       ** They will never be read by any client. So remove them from the pDirty
  3065   3063       ** list here. */
  3066         -    PgHdr *p;
  3067   3064       PgHdr **ppNext = &pList;
  3068   3065       nList = 0;
  3069   3066       for(p=pList; (*ppNext = p)!=0; p=p->pDirty){
  3070   3067         if( p->pgno<=nTruncate ){
  3071   3068           ppNext = &p->pDirty;
  3072   3069           nList++;
  3073   3070         }
................................................................................
  3079   3076     pPager->aStat[PAGER_STAT_WRITE] += nList;
  3080   3077   
  3081   3078     if( pList->pgno==1 ) pager_write_changecounter(pList);
  3082   3079     rc = sqlite3WalFrames(pPager->pWal, 
  3083   3080         pPager->pageSize, pList, nTruncate, isCommit, pPager->walSyncFlags
  3084   3081     );
  3085   3082     if( rc==SQLITE_OK && pPager->pBackup ){
  3086         -    PgHdr *p;
  3087   3083       for(p=pList; p; p=p->pDirty){
  3088   3084         sqlite3BackupUpdate(pPager->pBackup, p->pgno, (u8 *)p->pData);
  3089   3085       }
  3090   3086     }
  3091   3087   
  3092   3088   #ifdef SQLITE_CHECK_PAGES
  3093   3089     pList = sqlite3PcacheDirtyList(pPager->pPCache);

Changes to src/pragma.c.

   160    160   #endif /* SQLITE_PAGER_PRAGMAS */
   161    161   
   162    162   /*
   163    163   ** Generate code to return a single integer value.
   164    164   */
   165    165   static void returnSingleInt(Parse *pParse, const char *zLabel, i64 value){
   166    166     Vdbe *v = sqlite3GetVdbe(pParse);
   167         -  int mem = ++pParse->nMem;
          167  +  int nMem = ++pParse->nMem;
   168    168     i64 *pI64 = sqlite3DbMallocRaw(pParse->db, sizeof(value));
   169    169     if( pI64 ){
   170    170       memcpy(pI64, &value, sizeof(value));
   171    171     }
   172         -  sqlite3VdbeAddOp4(v, OP_Int64, 0, mem, 0, (char*)pI64, P4_INT64);
          172  +  sqlite3VdbeAddOp4(v, OP_Int64, 0, nMem, 0, (char*)pI64, P4_INT64);
   173    173     sqlite3VdbeSetNumCols(v, 1);
   174    174     sqlite3VdbeSetColName(v, 0, COLNAME_NAME, zLabel, SQLITE_STATIC);
   175         -  sqlite3VdbeAddOp2(v, OP_ResultRow, mem, 1);
          175  +  sqlite3VdbeAddOp2(v, OP_ResultRow, nMem, 1);
   176    176   }
   177    177   
   178    178   
   179    179   /*
   180    180   ** Set the safety_level and pager flags for pager iDb.  Or if iDb<0
   181    181   ** set these values for all pagers.
   182    182   */
................................................................................
   333    333     aFcntl[1] = zLeft;
   334    334     aFcntl[2] = zRight;
   335    335     aFcntl[3] = 0;
   336    336     db->busyHandler.nBusy = 0;
   337    337     rc = sqlite3_file_control(db, zDb, SQLITE_FCNTL_PRAGMA, (void*)aFcntl);
   338    338     if( rc==SQLITE_OK ){
   339    339       if( aFcntl[0] ){
   340         -      int mem = ++pParse->nMem;
   341         -      sqlite3VdbeAddOp4(v, OP_String8, 0, mem, 0, aFcntl[0], 0);
          340  +      int nMem = ++pParse->nMem;
          341  +      sqlite3VdbeAddOp4(v, OP_String8, 0, nMem, 0, aFcntl[0], 0);
   342    342         sqlite3VdbeSetNumCols(v, 1);
   343    343         sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "result", SQLITE_STATIC);
   344         -      sqlite3VdbeAddOp2(v, OP_ResultRow, mem, 1);
          344  +      sqlite3VdbeAddOp2(v, OP_ResultRow, nMem, 1);
   345    345         sqlite3_free(aFcntl[0]);
   346    346       }
   347    347       goto pragma_out;
   348    348     }
   349    349     if( rc!=SQLITE_NOTFOUND ){
   350    350       if( aFcntl[0] ){
   351    351         sqlite3ErrorMsg(pParse, "%s", aFcntl[0]);

Changes to src/shell.c.

   332    332   static int stdin_is_interactive = 1;
   333    333   
   334    334   /*
   335    335   ** The following is the open SQLite database.  We make a pointer
   336    336   ** to this database a static variable so that it can be accessed
   337    337   ** by the SIGINT handler to interrupt database processing.
   338    338   */
   339         -static sqlite3 *db = 0;
          339  +static sqlite3 *globalDb = 0;
   340    340   
   341    341   /*
   342    342   ** True if an interrupt (Control-C) has been received.
   343    343   */
   344    344   static volatile int seenInterrupt = 0;
   345    345   
   346    346   /*
................................................................................
   801    801   /*
   802    802   ** This routine runs when the user presses Ctrl-C
   803    803   */
   804    804   static void interrupt_handler(int NotUsed){
   805    805     UNUSED_PARAMETER(NotUsed);
   806    806     seenInterrupt++;
   807    807     if( seenInterrupt>2 ) exit(1);
   808         -  if( db ) sqlite3_interrupt(db);
          808  +  if( globalDb ) sqlite3_interrupt(globalDb);
   809    809   }
   810    810   #endif
   811    811   
   812    812   /*
   813    813   ** This is the callback routine that the shell
   814    814   ** invokes for each row of a query result.
   815    815   */
................................................................................
  1905   1905   ** Make sure the database is open.  If it is not, then open it.  If
  1906   1906   ** the database fails to open, print an error message and exit.
  1907   1907   */
  1908   1908   static void open_db(ShellState *p, int keepAlive){
  1909   1909     if( p->db==0 ){
  1910   1910       sqlite3_initialize();
  1911   1911       sqlite3_open(p->zDbFilename, &p->db);
  1912         -    db = p->db;
  1913         -    if( db && sqlite3_errcode(db)==SQLITE_OK ){
  1914         -      sqlite3_create_function(db, "shellstatic", 0, SQLITE_UTF8, 0,
         1912  +    globalDb = p->db;
         1913  +    if( p->db && sqlite3_errcode(p->db)==SQLITE_OK ){
         1914  +      sqlite3_create_function(p->db, "shellstatic", 0, SQLITE_UTF8, 0,
  1915   1915             shellstaticFunc, 0, 0);
  1916   1916       }
  1917         -    if( db==0 || SQLITE_OK!=sqlite3_errcode(db) ){
         1917  +    if( p->db==0 || SQLITE_OK!=sqlite3_errcode(p->db) ){
  1918   1918         fprintf(stderr,"Error: unable to open database \"%s\": %s\n", 
  1919         -          p->zDbFilename, sqlite3_errmsg(db));
         1919  +          p->zDbFilename, sqlite3_errmsg(p->db));
  1920   1920         if( keepAlive ) return;
  1921   1921         exit(1);
  1922   1922       }
  1923   1923   #ifndef SQLITE_OMIT_LOAD_EXTENSION
  1924   1924       sqlite3_enable_load_extension(p->db, 1);
  1925   1925   #endif
  1926         -    sqlite3_create_function(db, "readfile", 1, SQLITE_UTF8, 0,
         1926  +    sqlite3_create_function(p->db, "readfile", 1, SQLITE_UTF8, 0,
  1927   1927                               readfileFunc, 0, 0);
  1928         -    sqlite3_create_function(db, "writefile", 2, SQLITE_UTF8, 0,
         1928  +    sqlite3_create_function(p->db, "writefile", 2, SQLITE_UTF8, 0,
  1929   1929                               writefileFunc, 0, 0);
  1930   1930     }
  1931   1931   }
  1932   1932   
  1933   1933   /*
  1934   1934   ** Do C-language style dequoting.
  1935   1935   **
................................................................................
  2582   2582   /*
  2583   2583   ** If an input line begins with "." then invoke this routine to
  2584   2584   ** process that line.
  2585   2585   **
  2586   2586   ** Return 1 on error, 2 to exit, and 0 otherwise.
  2587   2587   */
  2588   2588   static int do_meta_command(char *zLine, ShellState *p){
  2589         -  int i = 1;
         2589  +  int h = 1;
  2590   2590     int nArg = 0;
  2591   2591     int n, c;
  2592   2592     int rc = 0;
  2593   2593     char *azArg[50];
  2594   2594   
  2595   2595     /* Parse the input line into tokens.
  2596   2596     */
  2597         -  while( zLine[i] && nArg<ArraySize(azArg) ){
  2598         -    while( IsSpace(zLine[i]) ){ i++; }
  2599         -    if( zLine[i]==0 ) break;
  2600         -    if( zLine[i]=='\'' || zLine[i]=='"' ){
  2601         -      int delim = zLine[i++];
  2602         -      azArg[nArg++] = &zLine[i];
  2603         -      while( zLine[i] && zLine[i]!=delim ){ 
  2604         -        if( zLine[i]=='\\' && delim=='"' && zLine[i+1]!=0 ) i++;
  2605         -        i++; 
         2597  +  while( zLine[h] && nArg<ArraySize(azArg) ){
         2598  +    while( IsSpace(zLine[h]) ){ h++; }
         2599  +    if( zLine[h]==0 ) break;
         2600  +    if( zLine[h]=='\'' || zLine[h]=='"' ){
         2601  +      int delim = zLine[h++];
         2602  +      azArg[nArg++] = &zLine[h];
         2603  +      while( zLine[h] && zLine[h]!=delim ){ 
         2604  +        if( zLine[h]=='\\' && delim=='"' && zLine[h+1]!=0 ) h++;
         2605  +        h++; 
  2606   2606         }
  2607         -      if( zLine[i]==delim ){
  2608         -        zLine[i++] = 0;
         2607  +      if( zLine[h]==delim ){
         2608  +        zLine[h++] = 0;
  2609   2609         }
  2610   2610         if( delim=='"' ) resolve_backslashes(azArg[nArg-1]);
  2611   2611       }else{
  2612         -      azArg[nArg++] = &zLine[i];
  2613         -      while( zLine[i] && !IsSpace(zLine[i]) ){ i++; }
  2614         -      if( zLine[i] ) zLine[i++] = 0;
         2612  +      azArg[nArg++] = &zLine[h];
         2613  +      while( zLine[h] && !IsSpace(zLine[h]) ){ h++; }
         2614  +      if( zLine[h] ) zLine[h++] = 0;
  2615   2615         resolve_backslashes(azArg[nArg-1]);
  2616   2616       }
  2617   2617     }
  2618   2618   
  2619   2619     /* Process the input line.
  2620   2620     */
  2621   2621     if( nArg==0 ) return 0; /* no tokens, no error */
................................................................................
  2983   2983         fprintf(stderr, "Error: out of memory\n");
  2984   2984         xCloser(sCtx.in);
  2985   2985         return 1;
  2986   2986       }
  2987   2987       nByte = strlen30(zSql);
  2988   2988       rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
  2989   2989       import_append_char(&sCtx, 0);    /* To ensure sCtx.z is allocated */
  2990         -    if( rc && sqlite3_strglob("no such table: *", sqlite3_errmsg(db))==0 ){
         2990  +    if( rc && sqlite3_strglob("no such table: *", sqlite3_errmsg(p->db))==0 ){
  2991   2991         char *zCreate = sqlite3_mprintf("CREATE TABLE %s", zTable);
  2992   2992         char cSep = '(';
  2993   2993         while( xRead(&sCtx) ){
  2994   2994           zCreate = sqlite3_mprintf("%z%c\n  \"%s\" TEXT", zCreate, cSep, sCtx.z);
  2995   2995           cSep = ',';
  2996   2996           if( sCtx.cTerm!=sCtx.cColSep ) break;
  2997   2997         }
................................................................................
  3003   3003           return 1;
  3004   3004         }
  3005   3005         zCreate = sqlite3_mprintf("%z\n)", zCreate);
  3006   3006         rc = sqlite3_exec(p->db, zCreate, 0, 0, 0);
  3007   3007         sqlite3_free(zCreate);
  3008   3008         if( rc ){
  3009   3009           fprintf(stderr, "CREATE TABLE %s(...) failed: %s\n", zTable,
  3010         -                sqlite3_errmsg(db));
         3010  +                sqlite3_errmsg(p->db));
  3011   3011           sqlite3_free(sCtx.z);
  3012   3012           xCloser(sCtx.in);
  3013   3013           return 1;
  3014   3014         }
  3015   3015         rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
  3016   3016       }
  3017   3017       sqlite3_free(zSql);
  3018   3018       if( rc ){
  3019   3019         if (pStmt) sqlite3_finalize(pStmt);
  3020         -      fprintf(stderr,"Error: %s\n", sqlite3_errmsg(db));
         3020  +      fprintf(stderr,"Error: %s\n", sqlite3_errmsg(p->db));
  3021   3021         xCloser(sCtx.in);
  3022   3022         return 1;
  3023   3023       }
  3024   3024       nCol = sqlite3_column_count(pStmt);
  3025   3025       sqlite3_finalize(pStmt);
  3026   3026       pStmt = 0;
  3027   3027       if( nCol==0 ) return 0; /* no columns, no error */
................................................................................
  3038   3038         zSql[j++] = '?';
  3039   3039       }
  3040   3040       zSql[j++] = ')';
  3041   3041       zSql[j] = 0;
  3042   3042       rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0);
  3043   3043       sqlite3_free(zSql);
  3044   3044       if( rc ){
  3045         -      fprintf(stderr, "Error: %s\n", sqlite3_errmsg(db));
         3045  +      fprintf(stderr, "Error: %s\n", sqlite3_errmsg(p->db));
  3046   3046         if (pStmt) sqlite3_finalize(pStmt);
  3047   3047         xCloser(sCtx.in);
  3048   3048         return 1;
  3049   3049       }
  3050         -    needCommit = sqlite3_get_autocommit(db);
  3051         -    if( needCommit ) sqlite3_exec(db, "BEGIN", 0, 0, 0);
         3050  +    needCommit = sqlite3_get_autocommit(p->db);
         3051  +    if( needCommit ) sqlite3_exec(p->db, "BEGIN", 0, 0, 0);
  3052   3052       do{
  3053   3053         int startLine = sCtx.nLine;
  3054   3054         for(i=0; i<nCol; i++){
  3055   3055           char *z = xRead(&sCtx);
  3056   3056           /*
  3057   3057           ** Did we reach end-of-file before finding any columns?
  3058   3058           ** If so, stop instead of NULL filling the remaining columns.
................................................................................
  3083   3083                           sCtx.zFile, startLine, nCol, i);
  3084   3084         }
  3085   3085         if( i>=nCol ){
  3086   3086           sqlite3_step(pStmt);
  3087   3087           rc = sqlite3_reset(pStmt);
  3088   3088           if( rc!=SQLITE_OK ){
  3089   3089             fprintf(stderr, "%s:%d: INSERT failed: %s\n", sCtx.zFile, startLine,
  3090         -                  sqlite3_errmsg(db));
         3090  +                  sqlite3_errmsg(p->db));
  3091   3091           }
  3092   3092         }
  3093   3093       }while( sCtx.cTerm!=EOF );
  3094   3094   
  3095   3095       xCloser(sCtx.in);
  3096   3096       sqlite3_free(sCtx.z);
  3097   3097       sqlite3_finalize(pStmt);
  3098         -    if( needCommit ) sqlite3_exec(db, "COMMIT", 0, 0, 0);
         3098  +    if( needCommit ) sqlite3_exec(p->db, "COMMIT", 0, 0, 0);
  3099   3099     }else
  3100   3100   
  3101   3101     if( c=='i' && (strncmp(azArg[0], "indices", n)==0
  3102   3102                    || strncmp(azArg[0], "indexes", n)==0) ){
  3103   3103       ShellState data;
  3104   3104       char *zErrMsg = 0;
  3105   3105       open_db(p, 0);
................................................................................
  3645   3645         sqlite3_bind_text(pStmt, 1, azArg[1], -1, SQLITE_TRANSIENT);
  3646   3646       }else{
  3647   3647         sqlite3_bind_text(pStmt, 1, "%", -1, SQLITE_STATIC);
  3648   3648       }
  3649   3649       while( sqlite3_step(pStmt)==SQLITE_ROW ){
  3650   3650         if( nRow>=nAlloc ){
  3651   3651           char **azNew;
  3652         -        int n = nAlloc*2 + 10;
  3653         -        azNew = sqlite3_realloc(azResult, sizeof(azResult[0])*n);
         3652  +        int n2 = nAlloc*2 + 10;
         3653  +        azNew = sqlite3_realloc(azResult, sizeof(azResult[0])*n2);
  3654   3654           if( azNew==0 ){
  3655   3655             fprintf(stderr, "Error: out of memory\n");
  3656   3656             break;
  3657   3657           }
  3658         -        nAlloc = n;
         3658  +        nAlloc = n2;
  3659   3659           azResult = azNew;
  3660   3660         }
  3661   3661         azResult[nRow] = sqlite3_mprintf("%s", sqlite3_column_text(pStmt, 0));
  3662   3662         if( azResult[nRow] ) nRow++;
  3663   3663       }
  3664   3664       sqlite3_finalize(pStmt);        
  3665   3665       if( nRow>0 ){
................................................................................
  3704   3704         { "iskeyword",             SQLITE_TESTCTRL_ISKEYWORD              },
  3705   3705         { "scratchmalloc",         SQLITE_TESTCTRL_SCRATCHMALLOC          },
  3706   3706         { "byteorder",             SQLITE_TESTCTRL_BYTEORDER              },
  3707   3707         { "never_corrupt",         SQLITE_TESTCTRL_NEVER_CORRUPT          },
  3708   3708         { "imposter",              SQLITE_TESTCTRL_IMPOSTER               },
  3709   3709       };
  3710   3710       int testctrl = -1;
  3711         -    int rc = 0;
  3712         -    int i, n;
         3711  +    int rc2 = 0;
         3712  +    int i, n2;
  3713   3713       open_db(p, 0);
  3714   3714   
  3715   3715       /* convert testctrl text option to value. allow any unique prefix
  3716   3716       ** of the option name, or a numerical value. */
  3717         -    n = strlen30(azArg[1]);
         3717  +    n2 = strlen30(azArg[1]);
  3718   3718       for(i=0; i<(int)(sizeof(aCtrl)/sizeof(aCtrl[0])); i++){
  3719         -      if( strncmp(azArg[1], aCtrl[i].zCtrlName, n)==0 ){
         3719  +      if( strncmp(azArg[1], aCtrl[i].zCtrlName, n2)==0 ){
  3720   3720           if( testctrl<0 ){
  3721   3721             testctrl = aCtrl[i].ctrlCode;
  3722   3722           }else{
  3723   3723             fprintf(stderr, "ambiguous option name: \"%s\"\n", azArg[1]);
  3724   3724             testctrl = -1;
  3725   3725             break;
  3726   3726           }
................................................................................
  3733   3733         switch(testctrl){
  3734   3734   
  3735   3735           /* sqlite3_test_control(int, db, int) */
  3736   3736           case SQLITE_TESTCTRL_OPTIMIZATIONS:
  3737   3737           case SQLITE_TESTCTRL_RESERVE:             
  3738   3738             if( nArg==3 ){
  3739   3739               int opt = (int)strtol(azArg[2], 0, 0);        
  3740         -            rc = sqlite3_test_control(testctrl, p->db, opt);
  3741         -            fprintf(p->out, "%d (0x%08x)\n", rc, rc);
         3740  +            rc2 = sqlite3_test_control(testctrl, p->db, opt);
         3741  +            fprintf(p->out, "%d (0x%08x)\n", rc2, rc2);
  3742   3742             } else {
  3743   3743               fprintf(stderr,"Error: testctrl %s takes a single int option\n",
  3744   3744                       azArg[1]);
  3745   3745             }
  3746   3746             break;
  3747   3747   
  3748   3748           /* sqlite3_test_control(int) */
  3749   3749           case SQLITE_TESTCTRL_PRNG_SAVE:
  3750   3750           case SQLITE_TESTCTRL_PRNG_RESTORE:
  3751   3751           case SQLITE_TESTCTRL_PRNG_RESET:
  3752   3752           case SQLITE_TESTCTRL_BYTEORDER:
  3753   3753             if( nArg==2 ){
  3754         -            rc = sqlite3_test_control(testctrl);
  3755         -            fprintf(p->out, "%d (0x%08x)\n", rc, rc);
         3754  +            rc2 = sqlite3_test_control(testctrl);
         3755  +            fprintf(p->out, "%d (0x%08x)\n", rc2, rc2);
  3756   3756             } else {
  3757   3757               fprintf(stderr,"Error: testctrl %s takes no options\n", azArg[1]);
  3758   3758             }
  3759   3759             break;
  3760   3760   
  3761   3761           /* sqlite3_test_control(int, uint) */
  3762   3762           case SQLITE_TESTCTRL_PENDING_BYTE:        
  3763   3763             if( nArg==3 ){
  3764   3764               unsigned int opt = (unsigned int)integerValue(azArg[2]);
  3765         -            rc = sqlite3_test_control(testctrl, opt);
  3766         -            fprintf(p->out, "%d (0x%08x)\n", rc, rc);
         3765  +            rc2 = sqlite3_test_control(testctrl, opt);
         3766  +            fprintf(p->out, "%d (0x%08x)\n", rc2, rc2);
  3767   3767             } else {
  3768   3768               fprintf(stderr,"Error: testctrl %s takes a single unsigned"
  3769   3769                              " int option\n", azArg[1]);
  3770   3770             }
  3771   3771             break;
  3772   3772             
  3773   3773           /* sqlite3_test_control(int, int) */
  3774   3774           case SQLITE_TESTCTRL_ASSERT:              
  3775   3775           case SQLITE_TESTCTRL_ALWAYS:      
  3776   3776           case SQLITE_TESTCTRL_NEVER_CORRUPT:        
  3777   3777             if( nArg==3 ){
  3778   3778               int opt = booleanValue(azArg[2]);        
  3779         -            rc = sqlite3_test_control(testctrl, opt);
  3780         -            fprintf(p->out, "%d (0x%08x)\n", rc, rc);
         3779  +            rc2 = sqlite3_test_control(testctrl, opt);
         3780  +            fprintf(p->out, "%d (0x%08x)\n", rc2, rc2);
  3781   3781             } else {
  3782   3782               fprintf(stderr,"Error: testctrl %s takes a single int option\n",
  3783   3783                               azArg[1]);
  3784   3784             }
  3785   3785             break;
  3786   3786   
  3787   3787           /* sqlite3_test_control(int, char *) */
  3788   3788   #ifdef SQLITE_N_KEYWORD
  3789   3789           case SQLITE_TESTCTRL_ISKEYWORD:           
  3790   3790             if( nArg==3 ){
  3791   3791               const char *opt = azArg[2];        
  3792         -            rc = sqlite3_test_control(testctrl, opt);
  3793         -            fprintf(p->out, "%d (0x%08x)\n", rc, rc);
         3792  +            rc2 = sqlite3_test_control(testctrl, opt);
         3793  +            fprintf(p->out, "%d (0x%08x)\n", rc2, rc2);
  3794   3794             } else {
  3795   3795               fprintf(stderr,"Error: testctrl %s takes a single char * option\n",
  3796   3796                               azArg[1]);
  3797   3797             }
  3798   3798             break;
  3799   3799   #endif
  3800   3800   
  3801   3801           case SQLITE_TESTCTRL_IMPOSTER:
  3802   3802             if( nArg==5 ){
  3803         -            rc = sqlite3_test_control(testctrl, p->db, 
         3803  +            rc2 = sqlite3_test_control(testctrl, p->db, 
  3804   3804                             azArg[2],
  3805   3805                             integerValue(azArg[3]),
  3806   3806                             integerValue(azArg[4]));
  3807         -            fprintf(p->out, "%d (0x%08x)\n", rc, rc);
         3807  +            fprintf(p->out, "%d (0x%08x)\n", rc2, rc2);
  3808   3808             }else{
  3809   3809               fprintf(stderr,"Usage: .testctrl imposter dbName onoff tnum\n");
  3810   3810             }
  3811   3811             break;
  3812   3812   
  3813   3813           case SQLITE_TESTCTRL_BITVEC_TEST:         
  3814   3814           case SQLITE_TESTCTRL_FAULT_INSTALL:       

Changes to src/tclsqlite.c.

  1187   1187       const char *zVar = sqlite3_bind_parameter_name(pStmt, i);
  1188   1188       if( zVar!=0 && (zVar[0]=='$' || zVar[0]==':' || zVar[0]=='@') ){
  1189   1189         Tcl_Obj *pVar = Tcl_GetVar2Ex(interp, &zVar[1], 0, 0);
  1190   1190         if( pVar ){
  1191   1191           int n;
  1192   1192           u8 *data;
  1193   1193           const char *zType = (pVar->typePtr ? pVar->typePtr->name : "");
  1194         -        char c = zType[0];
         1194  +        c = zType[0];
  1195   1195           if( zVar[0]=='@' ||
  1196   1196              (c=='b' && strcmp(zType,"bytearray")==0 && pVar->bytes==0) ){
  1197   1197             /* Load a BLOB type if the Tcl variable is a bytearray and
  1198   1198             ** it has no string representation or the host
  1199   1199             ** parameter name begins with "@". */
  1200   1200             data = Tcl_GetByteArrayFromObj(pVar, &n);
  1201   1201             sqlite3_bind_blob(pStmt, i, data, n, SQLITE_STATIC);
................................................................................
  2294   2294         dbEvalFinalize(&sEval);
  2295   2295         if( rc==TCL_BREAK ){
  2296   2296           Tcl_SetObjResult(interp, pRet);
  2297   2297           rc = TCL_OK;
  2298   2298         }
  2299   2299         Tcl_DecrRefCount(pRet);
  2300   2300       }else{
  2301         -      ClientData cd[2];
         2301  +      ClientData cd2[2];
  2302   2302         DbEvalContext *p;
  2303   2303         Tcl_Obj *pArray = 0;
  2304   2304         Tcl_Obj *pScript;
  2305   2305   
  2306   2306         if( objc==5 && *(char *)Tcl_GetString(objv[3]) ){
  2307   2307           pArray = objv[3];
  2308   2308         }
  2309   2309         pScript = objv[objc-1];
  2310   2310         Tcl_IncrRefCount(pScript);
  2311   2311         
  2312   2312         p = (DbEvalContext *)Tcl_Alloc(sizeof(DbEvalContext));
  2313   2313         dbEvalInit(p, pDb, objv[2], pArray);
  2314   2314   
  2315         -      cd[0] = (void *)p;
  2316         -      cd[1] = (void *)pScript;
  2317         -      rc = DbEvalNextCmd(cd, interp, TCL_OK);
         2315  +      cd2[0] = (void *)p;
         2316  +      cd2[1] = (void *)pScript;
         2317  +      rc = DbEvalNextCmd(cd2, interp, TCL_OK);
  2318   2318       }
  2319   2319       break;
  2320   2320     }
  2321   2321   
  2322   2322     /*
  2323   2323     **     $db function NAME [-argcount N] [-deterministic] SCRIPT
  2324   2324     **

Changes to src/test_malloc.c.

   207    207       if( rc==SQLITE_OK ){
   208    208         rc = sqlite3_config(SQLITE_CONFIG_MALLOC, &m);
   209    209       }
   210    210       sqlite3_test_control(SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS, 
   211    211           faultsimBeginBenign, faultsimEndBenign
   212    212       );
   213    213     }else{
   214         -    sqlite3_mem_methods m;
          214  +    sqlite3_mem_methods m2;
   215    215       assert(memfault.m.xMalloc);
   216    216   
   217    217       /* One should be able to reset the default memory allocator by storing
   218    218       ** a zeroed allocator then calling GETMALLOC. */
   219         -    memset(&m, 0, sizeof(m));
   220         -    sqlite3_config(SQLITE_CONFIG_MALLOC, &m);
   221         -    sqlite3_config(SQLITE_CONFIG_GETMALLOC, &m);
   222         -    assert( memcmp(&m, &memfault.m, sizeof(m))==0 );
          219  +    memset(&m2, 0, sizeof(m2));
          220  +    sqlite3_config(SQLITE_CONFIG_MALLOC, &m2);
          221  +    sqlite3_config(SQLITE_CONFIG_GETMALLOC, &m2);
          222  +    assert( memcmp(&m2, &memfault.m, sizeof(m2))==0 );
   223    223   
   224    224       rc = sqlite3_config(SQLITE_CONFIG_MALLOC, &memfault.m);
   225    225       sqlite3_test_control(SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS, 0, 0);
   226    226     }
   227    227   
   228    228     if( rc==SQLITE_OK ){
   229    229       memfault.isInstalled = 1;

Changes to src/test_multiplex.c.

   564    564       pGroup->flags = flags;
   565    565       rc = multiplexSubFilename(pGroup, 1);
   566    566       if( rc==SQLITE_OK ){
   567    567         pSubOpen = multiplexSubOpen(pGroup, 0, &rc, pOutFlags, 0);
   568    568         if( pSubOpen==0 && rc==SQLITE_OK ) rc = SQLITE_CANTOPEN;
   569    569       }
   570    570       if( rc==SQLITE_OK ){
   571         -      sqlite3_int64 sz;
          571  +      sqlite3_int64 sz64;
   572    572   
   573         -      rc = pSubOpen->pMethods->xFileSize(pSubOpen, &sz);
          573  +      rc = pSubOpen->pMethods->xFileSize(pSubOpen, &sz64);
   574    574         if( rc==SQLITE_OK && zName ){
   575    575           int bExists;
   576    576           if( flags & SQLITE_OPEN_MASTER_JOURNAL ){
   577    577             pGroup->bEnabled = 0;
   578    578           }else
   579         -        if( sz==0 ){
          579  +        if( sz64==0 ){
   580    580             if( flags & SQLITE_OPEN_MAIN_JOURNAL ){
   581    581               /* If opening a main journal file and the first chunk is zero
   582    582               ** bytes in size, delete any subsequent chunks from the 
   583    583               ** file-system. */
   584    584               int iChunk = 1;
   585    585               do {
   586    586                 rc = pOrigVfs->xAccess(pOrigVfs, 
................................................................................
   603    603             ** larger than the chunk size, that means the chunk size is too small.
   604    604             ** But we have no way of determining the intended chunk size, so 
   605    605             ** just disable the multiplexor all togethre.
   606    606             */
   607    607             rc = pOrigVfs->xAccess(pOrigVfs, pGroup->aReal[1].z,
   608    608                 SQLITE_ACCESS_EXISTS, &bExists);
   609    609             bExists = multiplexSubSize(pGroup, 1, &rc)>0;
   610         -          if( rc==SQLITE_OK && bExists  && sz==(sz&0xffff0000) && sz>0
   611         -              && sz!=pGroup->szChunk ){
   612         -            pGroup->szChunk = (int)sz;
   613         -          }else if( rc==SQLITE_OK && !bExists && sz>pGroup->szChunk ){
          610  +          if( rc==SQLITE_OK && bExists && sz64==(sz64&0xffff0000) && sz64>0
          611  +              && sz64!=pGroup->szChunk ){
          612  +            pGroup->szChunk = (int)sz64;
          613  +          }else if( rc==SQLITE_OK && !bExists && sz64>pGroup->szChunk ){
   614    614               pGroup->bEnabled = 0;
   615    615             }
   616    616           }
   617    617         }
   618    618       }
   619    619   
   620    620       if( rc==SQLITE_OK ){

Changes to src/test_onefile.c.

   591    591     fs_file *p = (fs_file *)pFile;
   592    592     fs_real_file *pReal = 0;
   593    593     int eType;
   594    594     int nName;
   595    595     int rc = SQLITE_OK;
   596    596   
   597    597     if( 0==(flags&(SQLITE_OPEN_MAIN_DB|SQLITE_OPEN_MAIN_JOURNAL)) ){
   598         -    tmp_file *p = (tmp_file *)pFile;
   599         -    memset(p, 0, sizeof(*p));
   600         -    p->base.pMethods = &tmp_io_methods;
          598  +    tmp_file *p2 = (tmp_file *)pFile;
          599  +    memset(p2, 0, sizeof(*p2));
          600  +    p2->base.pMethods = &tmp_io_methods;
   601    601       return SQLITE_OK;
   602    602     }
   603    603   
   604    604     eType = ((flags&(SQLITE_OPEN_MAIN_DB))?DATABASE_FILE:JOURNAL_FILE);
   605    605     p->base.pMethods = &fs_io_methods;
   606    606     p->eType = eType;
   607    607   

Changes to src/test_osinst.c.

  1127   1127     }
  1128   1128     if( Tcl_GetIndexFromObj(interp, objv[1], strs, "sub-command", 0, &iSub) ){
  1129   1129       return TCL_ERROR;
  1130   1130     }
  1131   1131   
  1132   1132     switch( (enum VL_enum)iSub ){
  1133   1133       case VL_ANNOTATE: {
  1134         -      int rc;
  1135   1134         char *zVfs;
  1136   1135         char *zMsg;
  1137   1136         if( objc!=4 ){
  1138   1137           Tcl_WrongNumArgs(interp, 3, objv, "VFS");
  1139   1138           return TCL_ERROR;
  1140   1139         }
  1141   1140         zVfs = Tcl_GetString(objv[2]);
................................................................................
  1144   1143         if( rc!=SQLITE_OK ){
  1145   1144           Tcl_AppendResult(interp, "failed", 0);
  1146   1145           return TCL_ERROR;
  1147   1146         }
  1148   1147         break;
  1149   1148       }
  1150   1149       case VL_FINALIZE: {
  1151         -      int rc;
  1152   1150         char *zVfs;
  1153   1151         if( objc!=3 ){
  1154   1152           Tcl_WrongNumArgs(interp, 2, objv, "VFS");
  1155   1153           return TCL_ERROR;
  1156   1154         }
  1157   1155         zVfs = Tcl_GetString(objv[2]);
  1158   1156         rc = sqlite3_vfslog_finalize(zVfs);
................................................................................
  1160   1158           Tcl_AppendResult(interp, "failed", 0);
  1161   1159           return TCL_ERROR;
  1162   1160         }
  1163   1161         break;
  1164   1162       };
  1165   1163   
  1166   1164       case VL_NEW: {
  1167         -      int rc;
  1168   1165         char *zVfs;
  1169   1166         char *zParent;
  1170   1167         char *zLog;
  1171   1168         if( objc!=5 ){
  1172   1169           Tcl_WrongNumArgs(interp, 2, objv, "VFS PARENT LOGFILE");
  1173   1170           return TCL_ERROR;
  1174   1171         }

Changes to src/test_vfs.c.

  1076   1076       return TCL_ERROR;
  1077   1077     }
  1078   1078     Tcl_ResetResult(interp);
  1079   1079   
  1080   1080     switch( aSubcmd[i].eCmd ){
  1081   1081       case CMD_SHM: {
  1082   1082         Tcl_Obj *pObj;
  1083         -      int i, rc;
         1083  +      int rc;
  1084   1084         TestvfsBuffer *pBuffer;
  1085   1085         char *zName;
  1086   1086         if( objc!=3 && objc!=4 ){
  1087   1087           Tcl_WrongNumArgs(interp, 2, objv, "FILE ?VALUE?");
  1088   1088           return TCL_ERROR;
  1089   1089         }
  1090   1090         zName = ckalloc(p->pParent->mxPathname);
................................................................................
  1156   1156           { "xFullPathname",      TESTVFS_FULLPATHNAME_MASK },
  1157   1157           { "xUnlock",            TESTVFS_UNLOCK_MASK },
  1158   1158           { "xLock",              TESTVFS_LOCK_MASK },
  1159   1159           { "xCheckReservedLock", TESTVFS_CKLOCK_MASK },
  1160   1160         };
  1161   1161         Tcl_Obj **apElem = 0;
  1162   1162         int nElem = 0;
  1163         -      int i;
  1164   1163         int mask = 0;
  1165   1164         if( objc!=3 ){
  1166   1165           Tcl_WrongNumArgs(interp, 2, objv, "LIST");
  1167   1166           return TCL_ERROR;
  1168   1167         }
  1169   1168         if( Tcl_ListObjGetElements(interp, objv[2], &nElem, &apElem) ){
  1170   1169           return TCL_ERROR;

Changes to tool/lemon.c.

  1110   1110     ** finite state machine) an action to ACCEPT if the lookahead is the
  1111   1111     ** start nonterminal.  */
  1112   1112     Action_add(&lemp->sorted[0]->ap,ACCEPT,sp,0);
  1113   1113   
  1114   1114     /* Resolve conflicts */
  1115   1115     for(i=0; i<lemp->nstate; i++){
  1116   1116       struct action *ap, *nap;
  1117         -    struct state *stp;
  1118   1117       stp = lemp->sorted[i];
  1119   1118       /* assert( stp->ap ); */
  1120   1119       stp->ap = Action_sort(stp->ap);
  1121   1120       for(ap=stp->ap; ap && ap->next; ap=ap->next){
  1122   1121         for(nap=ap->next; nap && nap->sp==ap->sp; nap=nap->next){
  1123   1122            /* The two actions "ap" and "nap" have the same lookahead.
  1124   1123            ** Figure out which one should be used */
................................................................................
  3744   3743     }
  3745   3744     lineno = 1;
  3746   3745     tplt_xfer(lemp->name,in,out,&lineno);
  3747   3746   
  3748   3747     /* Generate the include code, if any */
  3749   3748     tplt_print(out,lemp,lemp->include,&lineno);
  3750   3749     if( mhflag ){
  3751         -    char *name = file_makename(lemp, ".h");
  3752         -    fprintf(out,"#include \"%s\"\n", name); lineno++;
  3753         -    free(name);
         3750  +    char *incName = file_makename(lemp, ".h");
         3751  +    fprintf(out,"#include \"%s\"\n", incName); lineno++;
         3752  +    free(incName);
  3754   3753     }
  3755   3754     tplt_xfer(lemp->name,in,out,&lineno);
  3756   3755   
  3757   3756     /* Generate #defines for all tokens */
  3758   3757     if( mhflag ){
  3759   3758       const char *prefix;
  3760   3759       fprintf(out,"#if INTERFACE\n"); lineno++;
................................................................................
  3787   3786     }
  3788   3787     fprintf(out, "#endif\n"); lineno++;
  3789   3788     if( mhflag ){
  3790   3789       fprintf(out,"#if INTERFACE\n"); lineno++;
  3791   3790     }
  3792   3791     name = lemp->name ? lemp->name : "Parse";
  3793   3792     if( lemp->arg && lemp->arg[0] ){
  3794         -    int i;
  3795   3793       i = lemonStrlen(lemp->arg);
  3796   3794       while( i>=1 && isspace(lemp->arg[i-1]) ) i--;
  3797   3795       while( i>=1 && (isalnum(lemp->arg[i-1]) || lemp->arg[i-1]=='_') ) i--;
  3798   3796       fprintf(out,"#define %sARG_SDECL %s;\n",name,lemp->arg);  lineno++;
  3799   3797       fprintf(out,"#define %sARG_PDECL ,%s\n",name,lemp->arg);  lineno++;
  3800   3798       fprintf(out,"#define %sARG_FETCH %s = yypParser->%s\n",
  3801   3799                    name,lemp->arg,&lemp->arg[i]);  lineno++;
................................................................................
  4475   4473         /* Fail because overwrite is not allows. */
  4476   4474         return 0;
  4477   4475       }
  4478   4476       np = np->next;
  4479   4477     }
  4480   4478     if( x1a->count>=x1a->size ){
  4481   4479       /* Need to make the hash table bigger */
  4482         -    int i,size;
         4480  +    int i,arrSize;
  4483   4481       struct s_x1 array;
  4484         -    array.size = size = x1a->size*2;
         4482  +    array.size = arrSize = x1a->size*2;
  4485   4483       array.count = x1a->count;
  4486         -    array.tbl = (x1node*)calloc(size, sizeof(x1node) + sizeof(x1node*));
         4484  +    array.tbl = (x1node*)calloc(arrSize, sizeof(x1node) + sizeof(x1node*));
  4487   4485       if( array.tbl==0 ) return 0;  /* Fail due to malloc failure */
  4488         -    array.ht = (x1node**)&(array.tbl[size]);
  4489         -    for(i=0; i<size; i++) array.ht[i] = 0;
         4486  +    array.ht = (x1node**)&(array.tbl[arrSize]);
         4487  +    for(i=0; i<arrSize; i++) array.ht[i] = 0;
  4490   4488       for(i=0; i<x1a->count; i++){
  4491   4489         x1node *oldnp, *newnp;
  4492   4490         oldnp = &(x1a->tbl[i]);
  4493         -      h = strhash(oldnp->data) & (size-1);
         4491  +      h = strhash(oldnp->data) & (arrSize-1);
  4494   4492         newnp = &(array.tbl[i]);
  4495   4493         if( array.ht[h] ) array.ht[h]->from = &(newnp->next);
  4496   4494         newnp->next = array.ht[h];
  4497   4495         newnp->data = oldnp->data;
  4498   4496         newnp->from = &(array.ht[h]);
  4499   4497         array.ht[h] = newnp;
  4500   4498       }
................................................................................
  4642   4640         /* Fail because overwrite is not allows. */
  4643   4641         return 0;
  4644   4642       }
  4645   4643       np = np->next;
  4646   4644     }
  4647   4645     if( x2a->count>=x2a->size ){
  4648   4646       /* Need to make the hash table bigger */
  4649         -    int i,size;
         4647  +    int i,arrSize;
  4650   4648       struct s_x2 array;
  4651         -    array.size = size = x2a->size*2;
         4649  +    array.size = arrSize = x2a->size*2;
  4652   4650       array.count = x2a->count;
  4653         -    array.tbl = (x2node*)calloc(size, sizeof(x2node) + sizeof(x2node*));
         4651  +    array.tbl = (x2node*)calloc(arrSize, sizeof(x2node) + sizeof(x2node*));
  4654   4652       if( array.tbl==0 ) return 0;  /* Fail due to malloc failure */
  4655         -    array.ht = (x2node**)&(array.tbl[size]);
  4656         -    for(i=0; i<size; i++) array.ht[i] = 0;
         4653  +    array.ht = (x2node**)&(array.tbl[arrSize]);
         4654  +    for(i=0; i<arrSize; i++) array.ht[i] = 0;
  4657   4655       for(i=0; i<x2a->count; i++){
  4658   4656         x2node *oldnp, *newnp;
  4659   4657         oldnp = &(x2a->tbl[i]);
  4660         -      h = strhash(oldnp->key) & (size-1);
         4658  +      h = strhash(oldnp->key) & (arrSize-1);
  4661   4659         newnp = &(array.tbl[i]);
  4662   4660         if( array.ht[h] ) array.ht[h]->from = &(newnp->next);
  4663   4661         newnp->next = array.ht[h];
  4664   4662         newnp->key = oldnp->key;
  4665   4663         newnp->data = oldnp->data;
  4666   4664         newnp->from = &(array.ht[h]);
  4667   4665         array.ht[h] = newnp;
................................................................................
  4718   4716   
  4719   4717   /* Return an array of pointers to all data in the table.
  4720   4718   ** The array is obtained from malloc.  Return NULL if memory allocation
  4721   4719   ** problems, or if the array is empty. */
  4722   4720   struct symbol **Symbol_arrayof()
  4723   4721   {
  4724   4722     struct symbol **array;
  4725         -  int i,size;
         4723  +  int i,arrSize;
  4726   4724     if( x2a==0 ) return 0;
  4727         -  size = x2a->count;
  4728         -  array = (struct symbol **)calloc(size, sizeof(struct symbol *));
         4725  +  arrSize = x2a->count;
         4726  +  array = (struct symbol **)calloc(arrSize, sizeof(struct symbol *));
  4729   4727     if( array ){
  4730         -    for(i=0; i<size; i++) array[i] = x2a->tbl[i].data;
         4728  +    for(i=0; i<arrSize; i++) array[i] = x2a->tbl[i].data;
  4731   4729     }
  4732   4730     return array;
  4733   4731   }
  4734   4732   
  4735   4733   /* Compare two configurations */
  4736   4734   int Configcmp(const char *_a,const char *_b)
  4737   4735   {
................................................................................
  4839   4837         /* Fail because overwrite is not allows. */
  4840   4838         return 0;
  4841   4839       }
  4842   4840       np = np->next;
  4843   4841     }
  4844   4842     if( x3a->count>=x3a->size ){
  4845   4843       /* Need to make the hash table bigger */
  4846         -    int i,size;
         4844  +    int i,arrSize;
  4847   4845       struct s_x3 array;
  4848         -    array.size = size = x3a->size*2;
         4846  +    array.size = arrSize = x3a->size*2;
  4849   4847       array.count = x3a->count;
  4850         -    array.tbl = (x3node*)calloc(size, sizeof(x3node) + sizeof(x3node*));
         4848  +    array.tbl = (x3node*)calloc(arrSize, sizeof(x3node) + sizeof(x3node*));
  4851   4849       if( array.tbl==0 ) return 0;  /* Fail due to malloc failure */
  4852         -    array.ht = (x3node**)&(array.tbl[size]);
  4853         -    for(i=0; i<size; i++) array.ht[i] = 0;
         4850  +    array.ht = (x3node**)&(array.tbl[arrSize]);
         4851  +    for(i=0; i<arrSize; i++) array.ht[i] = 0;
  4854   4852       for(i=0; i<x3a->count; i++){
  4855   4853         x3node *oldnp, *newnp;
  4856   4854         oldnp = &(x3a->tbl[i]);
  4857         -      h = statehash(oldnp->key) & (size-1);
         4855  +      h = statehash(oldnp->key) & (arrSize-1);
  4858   4856         newnp = &(array.tbl[i]);
  4859   4857         if( array.ht[h] ) array.ht[h]->from = &(newnp->next);
  4860   4858         newnp->next = array.ht[h];
  4861   4859         newnp->key = oldnp->key;
  4862   4860         newnp->data = oldnp->data;
  4863   4861         newnp->from = &(array.ht[h]);
  4864   4862         array.ht[h] = newnp;
................................................................................
  4897   4895   
  4898   4896   /* Return an array of pointers to all data in the table.
  4899   4897   ** The array is obtained from malloc.  Return NULL if memory allocation
  4900   4898   ** problems, or if the array is empty. */
  4901   4899   struct state **State_arrayof()
  4902   4900   {
  4903   4901     struct state **array;
  4904         -  int i,size;
         4902  +  int i,arrSize;
  4905   4903     if( x3a==0 ) return 0;
  4906         -  size = x3a->count;
  4907         -  array = (struct state **)calloc(size, sizeof(struct state *));
         4904  +  arrSize = x3a->count;
         4905  +  array = (struct state **)calloc(arrSize, sizeof(struct state *));
  4908   4906     if( array ){
  4909         -    for(i=0; i<size; i++) array[i] = x3a->tbl[i].data;
         4907  +    for(i=0; i<arrSize; i++) array[i] = x3a->tbl[i].data;
  4910   4908     }
  4911   4909     return array;
  4912   4910   }
  4913   4911   
  4914   4912   /* Hash a configuration */
  4915   4913   PRIVATE unsigned confighash(struct config *a)
  4916   4914   {
................................................................................
  4979   4977         /* Fail because overwrite is not allows. */
  4980   4978         return 0;
  4981   4979       }
  4982   4980       np = np->next;
  4983   4981     }
  4984   4982     if( x4a->count>=x4a->size ){
  4985   4983       /* Need to make the hash table bigger */
  4986         -    int i,size;
         4984  +    int i,arrSize;
  4987   4985       struct s_x4 array;
  4988         -    array.size = size = x4a->size*2;
         4986  +    array.size = arrSize = x4a->size*2;
  4989   4987       array.count = x4a->count;
  4990         -    array.tbl = (x4node*)calloc(size, sizeof(x4node) + sizeof(x4node*));
         4988  +    array.tbl = (x4node*)calloc(arrSize, sizeof(x4node) + sizeof(x4node*));
  4991   4989       if( array.tbl==0 ) return 0;  /* Fail due to malloc failure */
  4992         -    array.ht = (x4node**)&(array.tbl[size]);
  4993         -    for(i=0; i<size; i++) array.ht[i] = 0;
         4990  +    array.ht = (x4node**)&(array.tbl[arrSize]);
         4991  +    for(i=0; i<arrSize; i++) array.ht[i] = 0;
  4994   4992       for(i=0; i<x4a->count; i++){
  4995   4993         x4node *oldnp, *newnp;
  4996   4994         oldnp = &(x4a->tbl[i]);
  4997         -      h = confighash(oldnp->data) & (size-1);
         4995  +      h = confighash(oldnp->data) & (arrSize-1);
  4998   4996         newnp = &(array.tbl[i]);
  4999   4997         if( array.ht[h] ) array.ht[h]->from = &(newnp->next);
  5000   4998         newnp->next = array.ht[h];
  5001   4999         newnp->data = oldnp->data;
  5002   5000         newnp->from = &(array.ht[h]);
  5003   5001         array.ht[h] = newnp;
  5004   5002       }