/ Check-in [be190fe7]
Login

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

Overview
Comment:Fix compiler warnings and remove unreachable code.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | warnings
Files: files | file ages | folders
SHA1: be190fe7826d157fc5acd84210095725b059e4f6
User & Date: drh 2015-08-08 22:47:47
Context
2015-08-08
23:23
Fix an assert() that was in the wrong spot. Closed-Leaf check-in: 962b6cd6 user: drh tags: warnings
22:47
Fix compiler warnings and remove unreachable code. check-in: be190fe7 user: drh tags: warnings
15:13
Update RBU to avoid repreparing a statement immediately after it is prepared. check-in: 1d75a41b user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/rbu/sqlite3rbu.c.

   593    593       return;
   594    594     }
   595    595   
   596    596     aOut = sqlite3_malloc(nOut+1);
   597    597     if( aOut==0 ){
   598    598       sqlite3_result_error_nomem(context);
   599    599     }else{
   600         -    int nOut2 = rbuDeltaApply(aOrig, nOrig, aDelta, nDelta, aOut);
          600  +    nOut2 = rbuDeltaApply(aOrig, nOrig, aDelta, nDelta, aOut);
   601    601       if( nOut2!=nOut ){
   602    602         sqlite3_result_error(context, "corrupt fossil delta", -1);
   603    603       }else{
   604    604         sqlite3_result_blob(context, aOut, nOut, sqlite3_free);
   605    605       }
   606    606     }
   607    607   }

Changes to src/build.c.

  1812   1812     Select *pSelect         /* Select from a "CREATE ... AS SELECT" */
  1813   1813   ){
  1814   1814     Table *p;                 /* The new table */
  1815   1815     sqlite3 *db = pParse->db; /* The database connection */
  1816   1816     int iDb;                  /* Database in which the table lives */
  1817   1817     Index *pIdx;              /* An implied index of the table */
  1818   1818   
  1819         -  if( (pEnd==0 && pSelect==0) || db->mallocFailed ){
         1819  +  assert( !db->mallocFailed );
         1820  +  if( pEnd==0 && pSelect==0 ){
  1820   1821       return;
  1821   1822     }
  1822   1823     p = pParse->pNewTable;
  1823   1824     if( p==0 ) return;
  1824   1825   
  1825   1826     assert( !db->init.busy || !pSelect );
  1826   1827   

Changes to tool/sqldiff.c.

   840    840       zBuf[i] = zDigits[v&0x3f];
   841    841     }
   842    842     for(j=i-1; j>=0; j--){
   843    843       *(*pz)++ = zBuf[j];
   844    844     }
   845    845   }
   846    846   
   847         -/*
   848         -** Read bytes from *pz and convert them into a positive integer.  When
   849         -** finished, leave *pz pointing to the first character past the end of
   850         -** the integer.  The *pLen parameter holds the length of the string
   851         -** in *pz and is decremented once for each character in the integer.
   852         -*/
   853         -static unsigned int getInt(const char **pz, int *pLen){
   854         -  static const signed char zValue[] = {
   855         -    -1, -1, -1, -1, -1, -1, -1, -1,   -1, -1, -1, -1, -1, -1, -1, -1,
   856         -    -1, -1, -1, -1, -1, -1, -1, -1,   -1, -1, -1, -1, -1, -1, -1, -1,
   857         -    -1, -1, -1, -1, -1, -1, -1, -1,   -1, -1, -1, -1, -1, -1, -1, -1,
   858         -     0,  1,  2,  3,  4,  5,  6,  7,    8,  9, -1, -1, -1, -1, -1, -1,
   859         -    -1, 10, 11, 12, 13, 14, 15, 16,   17, 18, 19, 20, 21, 22, 23, 24,
   860         -    25, 26, 27, 28, 29, 30, 31, 32,   33, 34, 35, -1, -1, -1, -1, 36,
   861         -    -1, 37, 38, 39, 40, 41, 42, 43,   44, 45, 46, 47, 48, 49, 50, 51,
   862         -    52, 53, 54, 55, 56, 57, 58, 59,   60, 61, 62, -1, -1, -1, 63, -1,
   863         -  };
   864         -  unsigned int v = 0;
   865         -  int c;
   866         -  unsigned char *z = (unsigned char*)*pz;
   867         -  unsigned char *zStart = z;
   868         -  while( (c = zValue[0x7f&*(z++)])>=0 ){
   869         -     v = (v<<6) + c;
   870         -  }
   871         -  z--;
   872         -  *pLen -= z - zStart;
   873         -  *pz = (char*)z;
   874         -  return v;
   875         -}
   876         -
   877    847   /*
   878    848   ** Return the number digits in the base-64 representation of a positive integer
   879    849   */
   880    850   static int digit_count(int v){
   881    851     unsigned int i, x;
   882    852     for(i=1, x=64; v>=x; i++, x <<= 6){}
   883    853     return i;