/ Check-in [55a62483]
Login

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

Overview
Comment:Fix compiler warnings by removing surplus local variables in the schema pretty-printer logic of the command-line shell.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 55a62483b9121a8b373d038a26fdebc4308661f6
User & Date: drh 2016-04-13 21:00:36
Context
2016-04-14
13:06
Additional ".selecttrace" debugging output when the query is transformed from a DISTINCT into a GROUP BY. check-in: 5a469145 user: drh tags: trunk
2016-04-13
21:00
Fix compiler warnings by removing surplus local variables in the schema pretty-printer logic of the command-line shell. check-in: 55a62483 user: drh tags: trunk
15:52
Fixes for harmless compiler warnings. check-in: 68142dc5 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/shell.c.

  1058   1058       }
  1059   1059       case MODE_Semi: {   /* .schema and .fullschema output */
  1060   1060         utf8_printf(p->out, "%s;\n", azArg[0]);
  1061   1061         break;
  1062   1062       }
  1063   1063       case MODE_Pretty: {  /* .schema and .fullschema with --indent */
  1064   1064         char *z;
  1065         -      int i,j;
         1065  +      int j;
  1066   1066         int nParen = 0;
  1067   1067         char cEnd = 0;
  1068   1068         char c;
  1069   1069         int nLine = 0;
  1070   1070         assert( nArg==1 );
  1071   1071         if( azArg[0]==0 ) break;
  1072   1072         if( sqlite3_strlike("CREATE VIEW%", azArg[0], 0)==0
................................................................................
  1085   1085             j--;
  1086   1086           }
  1087   1087           z[j++] = c;
  1088   1088         }
  1089   1089         while( j>0 && IsSpace(z[j-1]) ){ j--; }
  1090   1090         z[j] = 0;
  1091   1091         if( strlen30(z)>=79 ){
  1092         -        for(i=j=0; z[i]; i++){
  1093         -          char c = z[i];
         1092  +        for(i=j=0; (c = z[i])!=0; i++){
  1094   1093             if( c==cEnd ){
  1095   1094               cEnd = 0;
  1096   1095             }else if( c=='"' || c=='\'' || c=='`' ){
  1097   1096               cEnd = c;
  1098   1097             }else if( c=='[' ){
  1099   1098               cEnd = ']';
  1100   1099             }else if( c=='(' ){