/ Check-in [8b22f777]
Login

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

Overview
Comment:Fix compiler warnings on windows.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8b22f777a11438ab0baadc7d9e471f415b734d1f
User & Date: drh 2016-07-09 16:38:25
Context
2016-07-09
17:15
Fix a compiler warning in test code - in the int64array_addr TCL command. check-in: 29fb988f user: drh tags: trunk
16:38
Fix compiler warnings on windows. check-in: 8b22f777 user: drh tags: trunk
16:14
Fix various internal #defines to conform to new C-language naming restrictions, specifically that private-use macros names must not begin with "_". check-in: 5471aca0 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/misc/carray.c.

   299    299     }
   300    300     if( ptrIdx>=0 && cntIdx>=0 ){
   301    301       pIdxInfo->aConstraintUsage[ptrIdx].argvIndex = 1;
   302    302       pIdxInfo->aConstraintUsage[ptrIdx].omit = 1;
   303    303       pIdxInfo->aConstraintUsage[cntIdx].argvIndex = 2;
   304    304       pIdxInfo->aConstraintUsage[cntIdx].omit = 1;
   305    305       pIdxInfo->estimatedCost = (double)1;
   306         -    pIdxInfo->estimatedRows = (double)100;
          306  +    pIdxInfo->estimatedRows = 100;
   307    307       pIdxInfo->idxNum = 2;
   308    308       if( ctypeIdx>=0 ){
   309    309         pIdxInfo->aConstraintUsage[ctypeIdx].argvIndex = 3;
   310    310         pIdxInfo->aConstraintUsage[ctypeIdx].omit = 1;
   311    311         pIdxInfo->idxNum = 3;
   312    312       }
   313    313     }else{
   314    314       pIdxInfo->estimatedCost = (double)2147483647;
   315         -    pIdxInfo->estimatedRows = (double)2147483647;
          315  +    pIdxInfo->estimatedRows = 2147483647;
   316    316       pIdxInfo->idxNum = 0;
   317    317     }
   318    318     return SQLITE_OK;
   319    319   }
   320    320   
   321    321   /*
   322    322   ** This following structure defines all the methods for the 

Changes to ext/misc/csv.c.

   371    371   static int csv_string_parameter(
   372    372     CsvReader *p,            /* Leave the error message here, if there is one */
   373    373     const char *zParam,      /* Parameter we are checking for */
   374    374     const char *zArg,        /* Raw text of the virtual table argment */
   375    375     char **pzVal             /* Write the dequoted string value here */
   376    376   ){
   377    377     const char *zValue;
   378         -  zValue = csv_parameter(zParam,strlen(zParam),zArg);
          378  +  zValue = csv_parameter(zParam,(int)strlen(zParam),zArg);
   379    379     if( zValue==0 ) return 0;
   380    380     p->zErr[0] = 0;
   381    381     if( *pzVal ){
   382    382       csv_errmsg(p, "more than one '%s' parameter", zParam);
   383    383       return 1;
   384    384     }
   385    385     *pzVal = sqlite3_mprintf("%s", zValue);
................................................................................
   612    612   ** Constructor for a new CsvTable cursor object.
   613    613   */
   614    614   static int csvtabOpen(sqlite3_vtab *p, sqlite3_vtab_cursor **ppCursor){
   615    615     CsvTable *pTab = (CsvTable*)p;
   616    616     CsvCursor *pCur;
   617    617     size_t nByte;
   618    618     nByte = sizeof(*pCur) + (sizeof(char*)+sizeof(int))*pTab->nCol;
   619         -  pCur = sqlite3_malloc( nByte );
          619  +  pCur = sqlite3_malloc64( nByte );
   620    620     if( pCur==0 ) return SQLITE_NOMEM;
   621    621     memset(pCur, 0, nByte);
   622    622     pCur->azVal = (char**)&pCur[1];
   623    623     pCur->aLen = (int*)&pCur->azVal[pTab->nCol];
   624    624     *ppCursor = &pCur->base;
   625    625     if( csv_reader_open(&pCur->rdr, pTab->zFilename, pTab->zData) ){
   626    626       csv_xfer_error(pTab, &pCur->rdr);
................................................................................
   643    643       z = csv_read_one_field(&pCur->rdr);
   644    644       if( z==0 ){
   645    645         csv_xfer_error(pTab, &pCur->rdr);
   646    646         break;
   647    647       }
   648    648       if( i<pTab->nCol ){
   649    649         if( pCur->aLen[i] < pCur->rdr.n+1 ){
   650         -        char *zNew = sqlite3_realloc(pCur->azVal[i], pCur->rdr.n+1);
          650  +        char *zNew = sqlite3_realloc64(pCur->azVal[i], pCur->rdr.n+1);
   651    651           if( zNew==0 ){
   652    652             csv_errmsg(&pCur->rdr, "out of memory");
   653    653             csv_xfer_error(pTab, &pCur->rdr);
   654    654             break;
   655    655           }
   656    656           pCur->azVal[i] = zNew;
   657    657           pCur->aLen[i] = pCur->rdr.n+1;

Changes to src/test_bestindex.c.

   175    175     int rc = SQLITE_OK;
   176    176   
   177    177     if( argc!=4 ){
   178    178       *pzErr = sqlite3_mprintf("wrong number of arguments");
   179    179       return SQLITE_ERROR;
   180    180     }
   181    181   
   182         -  zCmd = sqlite3_malloc(strlen(argv[3])+1);
   183         -  pTab = (tcl_vtab*)sqlite3_malloc(sizeof(tcl_vtab));
          182  +  zCmd = sqlite3_malloc64(strlen(argv[3])+1);
          183  +  pTab = (tcl_vtab*)sqlite3_malloc64(sizeof(tcl_vtab));
   184    184     if( zCmd && pTab ){
   185    185       memcpy(zCmd, argv[3], strlen(argv[3])+1);
   186    186       tclDequote(zCmd);
   187    187       memset(pTab, 0, sizeof(tcl_vtab));
   188    188   
   189    189       pTab->pCmd = Tcl_NewStringObj(zCmd, -1);
   190    190       pTab->interp = interp;