/ Check-in [3d68703e]
Login

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

Overview
Comment:Avoid arithmetic on void pointers. (CVS 1489)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3d68703e2e4e793012cb3c13a6744e915475e006
User & Date: danielk1977 2004-05-29 02:44:02
Context
2004-05-29
10:23
Fix vacuum so that it works with blobs. (CVS 1490) check-in: 4feb4b9a user: danielk1977 tags: trunk
02:44
Avoid arithmetic on void pointers. (CVS 1489) check-in: 3d68703e user: danielk1977 tags: trunk
02:37
Allow CREATE and DROP TRIGGER on attached databases. (CVS 1488) check-in: 4060a37d user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/utf.c.

     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** This file contains routines used to translate between UTF-8, 
    13     13   ** UTF-16, UTF-16BE, and UTF-16LE.
    14     14   **
    15         -** $Id: utf.c,v 1.13 2004/05/28 16:00:22 drh Exp $
           15  +** $Id: utf.c,v 1.14 2004/05/29 02:44:02 danielk1977 Exp $
    16     16   **
    17     17   ** Notes on UTF-8:
    18     18   **
    19     19   **   Byte-0    Byte-1    Byte-2    Byte-3    Value
    20     20   **  0xxxxxxx                                 00000000 00000000 0xxxxxxx
    21     21   **  110yyyyy  10xxxxxx                       00000000 00000yyy yyxxxxxx
    22     22   **  1110zzzz  10yyyyyy  10xxxxxx             00000000 zzzzyyyy yyxxxxxx
................................................................................
   372    372   ** return the number of bytes up to (but not including), the first pair
   373    373   ** of consecutive 0x00 bytes in pZ. If nChar is not less than zero,
   374    374   ** then return the number of bytes in the first nChar unicode characters
   375    375   ** in pZ (or up until the first pair of 0x00 bytes, whichever comes first).
   376    376   */
   377    377   int sqlite3utf16ByteLen(const void *pZ, int nChar){
   378    378     if( nChar<0 ){
   379         -    const unsigned char *pC1 = pZ;
   380         -    const unsigned char *pC2 = pZ+1;
          379  +    const unsigned char *pC1 = (unsigned char *)pZ;
          380  +    const unsigned char *pC2 = (unsigned char *)pZ+1;
   381    381       while( *pC1 || *pC2 ){
   382    382         pC1 += 2;
   383    383         pC2 += 2;
   384    384       }
   385    385       return pC1-(unsigned char *)pZ;
   386    386     }else{
   387    387       UtfString str;