Fix harmless compiler warning in the totype extension. Include all standard whitespace characters in totypeIsspace. Minor adjustments to style and comments.
FossilOrigin-Name: 73238f655a58c810876f46cc04eab1ac2d5b8ef7
This commit is contained in:
parent
5f8cdac620
commit
0593516fcc
@ -43,12 +43,12 @@ SQLITE_EXTENSION_INIT1
|
|||||||
*/
|
*/
|
||||||
#if defined(i386) || defined(__i386__) || defined(_M_IX86)\
|
#if defined(i386) || defined(__i386__) || defined(_M_IX86)\
|
||||||
|| defined(__x86_64) || defined(__x86_64__)
|
|| defined(__x86_64) || defined(__x86_64__)
|
||||||
# define SQLITE_BIGENDIAN 0
|
# define TOTYPE_BIGENDIAN 0
|
||||||
# define SQLITE_LITTLEENDIAN 1
|
# define TOTYPE_LITTLEENDIAN 1
|
||||||
#else
|
#else
|
||||||
const int totype_one = 1;
|
const int totype_one = 1;
|
||||||
# define SQLITE_BIGENDIAN (*(char *)(&totype_one)==0)
|
# define TOTYPE_BIGENDIAN (*(char *)(&totype_one)==0)
|
||||||
# define SQLITE_LITTLEENDIAN (*(char *)(&totype_one)==1)
|
# define TOTYPE_LITTLEENDIAN (*(char *)(&totype_one)==1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -63,7 +63,7 @@ SQLITE_EXTENSION_INIT1
|
|||||||
** Return TRUE if character c is a whitespace character
|
** Return TRUE if character c is a whitespace character
|
||||||
*/
|
*/
|
||||||
static int totypeIsspace(unsigned char c){
|
static int totypeIsspace(unsigned char c){
|
||||||
return c==' ' || c=='\t' || c=='\n' || c=='\r';
|
return c==' ' || c=='\t' || c=='\n' || c=='\v' || c=='\f' || c=='\r';
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -83,7 +83,7 @@ static int totypeIsdigit(unsigned char c){
|
|||||||
** in the values of the last digit if the only difference is in the
|
** in the values of the last digit if the only difference is in the
|
||||||
** last digit. So, for example,
|
** last digit. So, for example,
|
||||||
**
|
**
|
||||||
** totypeCompare2pow63("9223372036854775800", 1)
|
** totypeCompare2pow63("9223372036854775800")
|
||||||
**
|
**
|
||||||
** will return -8.
|
** will return -8.
|
||||||
*/
|
*/
|
||||||
@ -114,6 +114,8 @@ static int totypeCompare2pow63(const char *zNum){
|
|||||||
** If zNum is too big for a 64-bit integer and is not
|
** If zNum is too big for a 64-bit integer and is not
|
||||||
** 9223372036854665808 or if zNum contains any non-numeric text,
|
** 9223372036854665808 or if zNum contains any non-numeric text,
|
||||||
** then return 1.
|
** then return 1.
|
||||||
|
**
|
||||||
|
** The string is not necessarily zero-terminated.
|
||||||
*/
|
*/
|
||||||
static int totypeAtoi64(const char *zNum, sqlite3_int64 *pNum, int length){
|
static int totypeAtoi64(const char *zNum, sqlite3_int64 *pNum, int length){
|
||||||
sqlite3_uint64 u = 0;
|
sqlite3_uint64 u = 0;
|
||||||
@ -172,12 +174,12 @@ static int totypeAtoi64(const char *zNum, sqlite3_int64 *pNum, int length){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** The string z[] is an text representation of a real number.
|
** The string z[] is an text representation of a real number.
|
||||||
** Convert this string to a double and write it into *pResult.
|
** Convert this string to a double and write it into *pResult.
|
||||||
**
|
**
|
||||||
** The string z[] is length bytes in length (bytes, not characters) and
|
** The string is not necessarily zero-terminated.
|
||||||
** uses the encoding enc. The string is not necessarily zero-terminated.
|
|
||||||
**
|
**
|
||||||
** Return TRUE if the result is a valid real number (or integer) and FALSE
|
** Return TRUE if the result is a valid real number (or integer) and FALSE
|
||||||
** if the string is empty or contains extraneous text. Valid numbers
|
** if the string is empty or contains extraneous text. Valid numbers
|
||||||
@ -374,7 +376,7 @@ static void tointegerFunc(
|
|||||||
int nBlob = sqlite3_value_bytes(argv[0]);
|
int nBlob = sqlite3_value_bytes(argv[0]);
|
||||||
if( nBlob==sizeof(sqlite3_int64) ){
|
if( nBlob==sizeof(sqlite3_int64) ){
|
||||||
sqlite3_int64 iVal;
|
sqlite3_int64 iVal;
|
||||||
if( SQLITE_BIGENDIAN ){
|
if( TOTYPE_BIGENDIAN ){
|
||||||
int i;
|
int i;
|
||||||
unsigned char zBlobRev[sizeof(sqlite3_int64)];
|
unsigned char zBlobRev[sizeof(sqlite3_int64)];
|
||||||
for(i=0; i<sizeof(sqlite3_int64); i++){
|
for(i=0; i<sizeof(sqlite3_int64); i++){
|
||||||
@ -415,6 +417,7 @@ static void tointegerFunc(
|
|||||||
** real number. Otherwise return NULL.
|
** real number. Otherwise return NULL.
|
||||||
*/
|
*/
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
|
#pragma warning(disable: 4748)
|
||||||
#pragma optimize("", off)
|
#pragma optimize("", off)
|
||||||
#endif
|
#endif
|
||||||
static void torealFunc(
|
static void torealFunc(
|
||||||
@ -443,7 +446,7 @@ static void torealFunc(
|
|||||||
int nBlob = sqlite3_value_bytes(argv[0]);
|
int nBlob = sqlite3_value_bytes(argv[0]);
|
||||||
if( nBlob==sizeof(double) ){
|
if( nBlob==sizeof(double) ){
|
||||||
double rVal;
|
double rVal;
|
||||||
if( SQLITE_LITTLEENDIAN ){
|
if( TOTYPE_LITTLEENDIAN ){
|
||||||
int i;
|
int i;
|
||||||
unsigned char zBlobRev[sizeof(double)];
|
unsigned char zBlobRev[sizeof(double)];
|
||||||
for(i=0; i<sizeof(double); i++){
|
for(i=0; i<sizeof(double); i++){
|
||||||
@ -480,6 +483,7 @@ static void torealFunc(
|
|||||||
}
|
}
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
#pragma optimize("", on)
|
#pragma optimize("", on)
|
||||||
|
#pragma warning(default: 4748)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
14
manifest
14
manifest
@ -1,5 +1,5 @@
|
|||||||
C Move\sthe\stointeger()\sand\storeal()\sfunctions\sout\sof\score\sand\smake\sthem\sinto\na\srun-time\sloadable\sextension.
|
C Fix\sharmless\scompiler\swarning\sin\sthe\stotype\sextension.\s\sInclude\sall\sstandard\swhitespace\scharacters\sin\stotypeIsspace.\s\sMinor\sadjustments\sto\sstyle\sand\scomments.
|
||||||
D 2013-10-14T21:14:42.543
|
D 2013-10-14T22:35:40.075
|
||||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||||
F Makefile.in 0522b53cdc1fcfc18f3a98e0246add129136c654
|
F Makefile.in 0522b53cdc1fcfc18f3a98e0246add129136c654
|
||||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||||
@ -115,7 +115,7 @@ F ext/misc/percentile.c bcbee3c061b884eccb80e21651daaae8e1e43c63
|
|||||||
F ext/misc/regexp.c af92cdaa5058fcec1451e49becc7ba44dba023dc
|
F ext/misc/regexp.c af92cdaa5058fcec1451e49becc7ba44dba023dc
|
||||||
F ext/misc/rot13.c 1ac6f95f99b575907b9b09c81a349114cf9be45a
|
F ext/misc/rot13.c 1ac6f95f99b575907b9b09c81a349114cf9be45a
|
||||||
F ext/misc/spellfix.c 5e1d547e9a2aed13897fa91bac924333f62fd2d9
|
F ext/misc/spellfix.c 5e1d547e9a2aed13897fa91bac924333f62fd2d9
|
||||||
F ext/misc/totype.c 368c089adfeabfe3de5fd4b8c581df53743cf6c0
|
F ext/misc/totype.c 86eeb8efb5c0e1a09d713e4183ff1eda95c8f342
|
||||||
F ext/misc/vfslog.c 1abb192d8d4bd323adbddec0c024580496b51b7a
|
F ext/misc/vfslog.c 1abb192d8d4bd323adbddec0c024580496b51b7a
|
||||||
F ext/misc/vtshim.c babb0dc2bf116029e3e7c9a618b8a1377045303e
|
F ext/misc/vtshim.c babb0dc2bf116029e3e7c9a618b8a1377045303e
|
||||||
F ext/misc/wholenumber.c 784b12543d60702ebdd47da936e278aa03076212
|
F ext/misc/wholenumber.c 784b12543d60702ebdd47da936e278aa03076212
|
||||||
@ -1125,7 +1125,7 @@ F tool/vdbe-compress.tcl f12c884766bd14277f4fcedcae07078011717381
|
|||||||
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
||||||
F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01
|
F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01
|
||||||
F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff
|
F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff
|
||||||
P 0bf438fc30582a08fddfc3cec49366ee17ae2abe
|
P 9f66dd7e3790c04f0ab724419f5381bd21f9ebad
|
||||||
R ade7979aa97b3511bc21cfd9a8979ec2
|
R f21c7b96aefc2201770b50ac2899ad7e
|
||||||
U drh
|
U mistachkin
|
||||||
Z 602799c8fb404ec8c5a4601c8b4e8f8d
|
Z 42e92dc11d48272f024e4ddd08e08231
|
||||||
|
@ -1 +1 @@
|
|||||||
9f66dd7e3790c04f0ab724419f5381bd21f9ebad
|
73238f655a58c810876f46cc04eab1ac2d5b8ef7
|
Loading…
x
Reference in New Issue
Block a user