/ Check-in [10ace06b]
Login

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

Overview
Comment:Fix two compilation issues, one warning and one error, that occur only when SQLITE_OMIT_UTF16 is defined.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 10ace06be7fbe9a76a201c418b2af453c7a69043
User & Date: mistachkin 2013-03-07 06:42:53
Context
2013-03-07
09:39
Skip tests that require UTF-16 support when compiled with SQLITE_OMIT_UTF16. check-in: e3939142 user: mistachkin tags: trunk
06:42
Fix two compilation issues, one warning and one error, that occur only when SQLITE_OMIT_UTF16 is defined. check-in: 10ace06b user: mistachkin tags: trunk
2013-03-06
11:44
Fix a problem in incrvacuum_ioerr.test. Do not run ioerr6.test with an in-memory journal. check-in: 66576b45 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/func.c.

   977    977   }
   978    978   
   979    979   /*
   980    980   ** The char() function takes zero or more arguments, each of which is
   981    981   ** an integer.  It constructs a string where each character of the string
   982    982   ** is the unicode character for the corresponding integer argument.
   983    983   */
          984  +#ifndef SQLITE_OMIT_UTF16
   984    985   static void charFunc(
   985    986     sqlite3_context *context,
   986    987     int argc,
   987    988     sqlite3_value **argv
   988    989   ){
   989    990     unsigned char *z, *zOut;
   990    991     int i;
................................................................................
  1008   1009         *zOut++ = (u8)(0x00D8 + (((c-0x10000)>>18)&0x03));
  1009   1010         *zOut++ = (u8)(c&0x00FF);
  1010   1011         *zOut++ = (u8)(0x00DC + ((c>>8)&0x03));
  1011   1012       }
  1012   1013     }
  1013   1014     sqlite3_result_text16le(context, (char*)z, (int)(zOut-z), sqlite3_free);
  1014   1015   }
         1016  +#endif
  1015   1017   
  1016   1018   /*
  1017   1019   ** The hex() function.  Interpret the argument as a blob.  Return
  1018   1020   ** a hexadecimal rendering as text.
  1019   1021   */
  1020   1022   static void hexFunc(
  1021   1023     sqlite3_context *context,
................................................................................
  1637   1639       AGGREGATE(max,               1, 1, 1, minmaxStep,      minMaxFinalize ),
  1638   1640       FUNCTION2(typeof,            1, 0, 0, typeofFunc,  SQLITE_FUNC_TYPEOF),
  1639   1641       FUNCTION2(length,            1, 0, 0, lengthFunc,  SQLITE_FUNC_LENGTH),
  1640   1642       FUNCTION(instr,              2, 0, 0, instrFunc        ),
  1641   1643       FUNCTION(substr,             2, 0, 0, substrFunc       ),
  1642   1644       FUNCTION(substr,             3, 0, 0, substrFunc       ),
  1643   1645       FUNCTION(unicode,            1, 0, 0, unicodeFunc      ),
         1646  +#ifndef SQLITE_OMIT_UTF16
  1644   1647       FUNCTION(char,              -1, 0, 0, charFunc         ),
         1648  +#endif
  1645   1649       FUNCTION(abs,                1, 0, 0, absFunc          ),
  1646   1650   #ifndef SQLITE_OMIT_FLOATING_POINT
  1647   1651       FUNCTION(round,              1, 0, 0, roundFunc        ),
  1648   1652       FUNCTION(round,              2, 0, 0, roundFunc        ),
  1649   1653   #endif
  1650   1654       FUNCTION(upper,              1, 0, 0, upperFunc        ),
  1651   1655       FUNCTION(lower,              1, 0, 0, lowerFunc        ),

Changes to src/vdbemem.c.

    28     28   ** routine is a no-op.
    29     29   **
    30     30   ** SQLITE_OK is returned if the conversion is successful (or not required).
    31     31   ** SQLITE_NOMEM may be returned if a malloc() fails during conversion
    32     32   ** between formats.
    33     33   */
    34     34   int sqlite3VdbeChangeEncoding(Mem *pMem, int desiredEnc){
           35  +#ifndef SQLITE_OMIT_UTF16
    35     36     int rc;
           37  +#endif
    36     38     assert( (pMem->flags&MEM_RowSet)==0 );
    37     39     assert( desiredEnc==SQLITE_UTF8 || desiredEnc==SQLITE_UTF16LE
    38     40              || desiredEnc==SQLITE_UTF16BE );
    39     41     if( !(pMem->flags&MEM_Str) || pMem->enc==desiredEnc ){
    40     42       return SQLITE_OK;
    41     43     }
    42     44     assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );