On 01/25/2011 04:10 AM, Black, Michael (IS) wrote:
> Is this if statement meant to be constant?  Or should it be comparing the 
> requested encoding instead of SQLITE_UTF16NATIVE?
>
> SQLITE_PRIVATE int sqlite3Utf16ByteLen(const void *zIn, int nChar){
>    int c;
>    unsigned char const *z = zIn;
>    int n = 0;
>
>    if( SQLITE_UTF16NATIVE==SQLITE_UTF16BE ){
>      while( n<nChar ){
>        READ_UTF16BE(z, 1, c);
>        n++;
>      }
>    }else{
>      while( n<nChar ){
>        READ_UTF16LE(z, 1, c);
>        n++;
>      }
>    }
>    return (int)(z-(unsigned char const *)zIn);
> }

The ( SQLITE_UTF16NATIVE==SQLITE_UTF16BE ) expression is supposed
to be constant (for a given architecture). One branch of the "if"
condition runs on bit-endian hosts, the other on little-endian.

Is that the expression that is causing the warning?

Dan.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to