/ Check-in [4978ee8b]
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
SHA3-256:4978ee8b5405f958723b4ebbd4288bd08bff2b453da2d1c032d1ae904c2a3821
User & Date: drh 2019-02-05 19:48:46
Context
2019-02-05
19:52
Fix a harmless compiler warning in the memtrace.c extension. check-in: 2f468da4 user: drh tags: trunk
19:48
Fix compiler warnings on Windows. check-in: 4978ee8b user: drh tags: trunk
16:53
Update the tester.tcl --malloctrace option so that it uses eu-addr2line instead of addr2line. check-in: 79c07387 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/shell.c.in.

  1082   1082   /* Allowed values for ShellState.eTraceType
  1083   1083   */
  1084   1084   #define SHELL_TRACE_PLAIN      0      /* Show input SQL text */
  1085   1085   #define SHELL_TRACE_EXPANDED   1      /* Show expanded SQL text */
  1086   1086   #define SHELL_TRACE_NORMALIZED 2      /* Show normalized SQL text */
  1087   1087   
  1088   1088   /* Bits in the ShellState.flgProgress variable */
  1089         -#define PROGRESS_QUIET   0x01         /* Omit announcing every progress callback */
  1090         -#define PROGRESS_RESET   0x02         /* Reset the count when the progres
  1091         -                                      ** callback limit is reached, and for each
  1092         -                                      ** top-level SQL statement */
  1093         -#define PROGRESS_ONCE    0x04         /* Cancel the --limit after firing once */
         1089  +#define SHELL_PROGRESS_QUIET 0x01  /* Omit announcing every progress callback */
         1090  +#define SHELL_PROGRESS_RESET 0x02  /* Reset the count when the progres
         1091  +                                   ** callback limit is reached, and for each
         1092  +                                   ** top-level SQL statement */
         1093  +#define SHELL_PROGRESS_ONCE  0x04  /* Cancel the --limit after firing once */
  1094   1094   
  1095   1095   /*
  1096   1096   ** These are the allowed shellFlgs values
  1097   1097   */
  1098   1098   #define SHFLG_Pagecache      0x00000001 /* The --pagecache option is used */
  1099   1099   #define SHFLG_Lookaside      0x00000002 /* Lookaside memory is used */
  1100   1100   #define SHFLG_Backslash      0x00000004 /* The --backslash option is used */
................................................................................
  1796   1796   ** Progress handler callback.
  1797   1797   */
  1798   1798   static int progress_handler(void *pClientData) {
  1799   1799     ShellState *p = (ShellState*)pClientData;
  1800   1800     p->nProgress++;
  1801   1801     if( p->nProgress>=p->mxProgress && p->mxProgress>0 ){
  1802   1802       raw_printf(p->out, "Progress limit reached (%u)\n", p->nProgress);
  1803         -    if( p->flgProgress & PROGRESS_RESET ) p->nProgress = 0;
  1804         -    if( p->flgProgress & PROGRESS_ONCE ) p->mxProgress = 0;
         1803  +    if( p->flgProgress & SHELL_PROGRESS_RESET ) p->nProgress = 0;
         1804  +    if( p->flgProgress & SHELL_PROGRESS_ONCE ) p->mxProgress = 0;
  1805   1805       return 1;
  1806   1806     }
  1807         -  if( (p->flgProgress & PROGRESS_QUIET)==0 ){
         1807  +  if( (p->flgProgress & SHELL_PROGRESS_QUIET)==0 ){
  1808   1808       raw_printf(p->out, "Progress %u\n", p->nProgress);
  1809   1809     }
  1810   1810     return 0;
  1811   1811   }
  1812   1812   
  1813   1813   /*
  1814   1814   ** This is the callback routine that the shell
................................................................................
  7031   7031         utf8_printf(p->out, "%s", azArg[i]);
  7032   7032       }
  7033   7033       raw_printf(p->out, "\n");
  7034   7034     }else
  7035   7035   
  7036   7036     if( c=='p' && n>=3 && strncmp(azArg[0], "progress", n)==0 ){
  7037   7037       int i;
  7038         -    int n = 0;
         7038  +    int nn = 0;
  7039   7039       p->flgProgress = 0;
  7040   7040       p->mxProgress = 0;
  7041   7041       p->nProgress = 0;
  7042   7042       for(i=1; i<nArg; i++){
  7043   7043         const char *z = azArg[i];
  7044   7044         if( z[0]=='-' ){
  7045   7045           z++;
  7046   7046           if( z[0]=='-' ) z++;
  7047   7047           if( strcmp(z,"quiet")==0 || strcmp(z,"q")==0 ){
  7048         -          p->flgProgress |= PROGRESS_QUIET;
         7048  +          p->flgProgress |= SHELL_PROGRESS_QUIET;
  7049   7049             continue;
  7050   7050           }
  7051   7051           if( strcmp(z,"reset")==0 ){
  7052         -          p->flgProgress |= PROGRESS_RESET;
         7052  +          p->flgProgress |= SHELL_PROGRESS_RESET;
  7053   7053             continue;
  7054   7054           }
  7055   7055           if( strcmp(z,"once")==0 ){
  7056         -          p->flgProgress |= PROGRESS_ONCE;
         7056  +          p->flgProgress |= SHELL_PROGRESS_ONCE;
  7057   7057             continue;
  7058   7058           }
  7059   7059           if( strcmp(z,"limit")==0 ){
  7060   7060             if( i+1>=nArg ){
  7061   7061               utf8_printf(stderr, "Error: missing argument on --limit\n");
  7062   7062               rc = 1;
  7063   7063               goto meta_command_exit;
................................................................................
  7066   7066             }
  7067   7067             continue;
  7068   7068           }
  7069   7069           utf8_printf(stderr, "Error: unknown option: \"%s\"\n", azArg[i]);
  7070   7070           rc = 1;
  7071   7071           goto meta_command_exit;
  7072   7072         }else{
  7073         -        n = (int)integerValue(z);
         7073  +        nn = (int)integerValue(z);
  7074   7074         }
  7075   7075       }
  7076   7076       open_db(p, 0);
  7077         -    sqlite3_progress_handler(p->db, n, progress_handler, p);
         7077  +    sqlite3_progress_handler(p->db, nn, progress_handler, p);
  7078   7078     }else
  7079   7079   
  7080   7080     if( c=='p' && strncmp(azArg[0], "prompt", n)==0 ){
  7081   7081       if( nArg >= 2) {
  7082   7082         strncpy(mainPrompt,azArg[1],(int)ArraySize(mainPrompt)-1);
  7083   7083       }
  7084   7084       if( nArg >= 3) {
................................................................................
  8408   8408   */
  8409   8409   static int runOneSqlLine(ShellState *p, char *zSql, FILE *in, int startline){
  8410   8410     int rc;
  8411   8411     char *zErrMsg = 0;
  8412   8412   
  8413   8413     open_db(p, 0);
  8414   8414     if( ShellHasFlag(p,SHFLG_Backslash) ) resolve_backslashes(zSql);
  8415         -  if( p->flgProgress & PROGRESS_RESET ) p->nProgress = 0;
         8415  +  if( p->flgProgress & SHELL_PROGRESS_RESET ) p->nProgress = 0;
  8416   8416     BEGIN_TIMER;
  8417   8417     rc = shell_exec(p, zSql, &zErrMsg);
  8418   8418     END_TIMER;
  8419   8419     if( rc || zErrMsg ){
  8420   8420       char zPrefix[100];
  8421   8421       if( in!=0 || !stdin_is_interactive ){
  8422   8422         sqlite3_snprintf(sizeof(zPrefix), zPrefix,