aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2008-12-09 03:55:14 +0000
committerdrh <drh@noemail.net>2008-12-09 03:55:14 +0000
commitaa78bec9937e320faa948f9181ed53c97c6d249c (patch)
treed4c67acb3b1b377a01bf4e581214d2f606dcddd0
parent8df32841de87b078b4e83aa214a5f7a6572c9ded (diff)
downloadsqlite-aa78bec9937e320faa948f9181ed53c97c6d249c.tar.gz
sqlite-aa78bec9937e320faa948f9181ed53c97c6d249c.zip
Get rid of more silly compiler warnings. (CVS 5996)
FossilOrigin-Name: 59ae0020683766993c38e2b76a436d78d3e4bd63
-rw-r--r--manifest18
-rw-r--r--manifest.uuid2
-rw-r--r--src/table.c4
-rw-r--r--src/trigger.c19
-rw-r--r--src/utf.c66
-rw-r--r--src/util.c32
6 files changed, 72 insertions, 69 deletions
diff --git a/manifest b/manifest
index 3b6dbfef7..d70d6d29a 100644
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Suppress\smore\ssilly\scompiler\swarnings.\s(CVS\s5995)
-D 2008-12-09T02:51:24
+C Get\srid\sof\smore\ssilly\scompiler\swarnings.\s(CVS\s5996)
+D 2008-12-09T03:55:14
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in f7e4c81c347b04f7b0f1c1b081a168645d7b8af7
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -158,7 +158,7 @@ F src/sqlite3ext.h 1db7d63ab5de4b3e6b83dd03d1a4e64fef6d2a17
F src/sqliteInt.h 2f21e46629c5d1371d23e326debbc72099e07b8e
F src/sqliteLimit.h f435e728c6b620ef7312814d660a81f9356eb5c8
F src/status.c 237b193efae0cf6ac3f0817a208de6c6c6ef6d76
-F src/table.c 22744786199c9195720c15a7a42cb97b2e2728d8
+F src/table.c caf335a98a1093a5e8e79557d17053755f9aa474
F src/tclsqlite.c 96049bd454f1547abff0a57c45f0dfa57701e076
F src/test1.c 30986773b10d75904f21bae5c3e8e8b9f20fa479
F src/test2.c 897528183edf2839c2a3c991d415905db56f1240
@@ -189,10 +189,10 @@ F src/test_tclvar.c 9e42fa59d3d2f064b7ab8628e7ab2dc8a9fe93d4
F src/test_thread.c d74fc445e0dba0e00806117eb449b307c0b146bf
F src/test_wsd.c c297d7d6b8a990239e1bd25935e81d612d8ae31d
F src/tokenize.c aaa5fa6a4536a9dd7c855a3f66f32508f1612138
-F src/trigger.c b86eb6d216c0014138f858a04185113cb54518e4
+F src/trigger.c 9244c483e5256982e6f32d6f430af6ec10344980
F src/update.c 7143ac31d26dee156277126e9a7c5be953b18347
-F src/utf.c 3d087d22b7a2d68aee32919713251b30fd327fc0
-F src/util.c b9a5d1c4c1a433e17d5828f9717fac763016a2cb
+F src/utf.c 515ce4f1e039635197e7f0df46cf8a7ac659a571
+F src/util.c 6e997af379d3aa609bf084d7d10fdc1cf32cc72c
F src/vacuum.c 383d6297bddc011ab04a9eed110db6eaf523e8e9
F src/vdbe.c fce160c74aad54d14e2bdd8a30443fd78f7b26c5
F src/vdbe.h 03516f28bf5aca00a53c4dccd6c313f96adb94f6
@@ -664,7 +664,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P 680755dbf01e20569b87068b1515b144903c566e
-R 452483eb410c2cf0324867f47deb9f4a
+P 1522c2c6677b97edfa09dd64b4f9ed139aeb5bec
+R 3cf4ecb0531c6feadf1fa1dceb64dc9c
U drh
-Z bea2c8d0137baa91265ec713cd87d014
+Z 29140f0489a65f9e7ba95c829363e23e
diff --git a/manifest.uuid b/manifest.uuid
index 06163a573..1ff3bbfcd 100644
--- a/manifest.uuid
+++ b/manifest.uuid
@@ -1 +1 @@
-1522c2c6677b97edfa09dd64b4f9ed139aeb5bec \ No newline at end of file
+59ae0020683766993c38e2b76a436d78d3e4bd63 \ No newline at end of file
diff --git a/src/table.c b/src/table.c
index 1bd1bd19e..232e898d6 100644
--- a/src/table.c
+++ b/src/table.c
@@ -16,7 +16,7 @@
** These routines are in a separate files so that they will not be linked
** if they are not used.
**
-** $Id: table.c,v 1.36 2008/07/08 22:28:49 shane Exp $
+** $Id: table.c,v 1.37 2008/12/09 03:55:14 drh Exp $
*/
#include "sqliteInt.h"
#include <stdlib.h>
@@ -92,7 +92,7 @@ static int sqlite3_get_table_cb(void *pArg, int nCol, char **argv, char **colv){
if( argv[i]==0 ){
z = 0;
}else{
- int n = strlen(argv[i])+1;
+ int n = (int)strlen(argv[i])+1;
z = sqlite3_malloc( n );
if( z==0 ) goto malloc_failed;
memcpy(z, argv[i], n);
diff --git a/src/trigger.c b/src/trigger.c
index 2ac3374fd..65e17e223 100644
--- a/src/trigger.c
+++ b/src/trigger.c
@@ -10,7 +10,7 @@
*************************************************************************
**
**
-** $Id: trigger.c,v 1.130 2008/11/19 09:05:27 danielk1977 Exp $
+** $Id: trigger.c,v 1.131 2008/12/09 03:55:14 drh Exp $
*/
#include "sqliteInt.h"
@@ -64,6 +64,8 @@ void sqlite3BeginTrigger(
assert( pName1!=0 ); /* pName1->z might be NULL, but not pName1 itself */
assert( pName2!=0 );
+ assert( op==TK_INSERT || op==TK_UPDATE || op==TK_DELETE );
+ assert( op>0 && op<0xff );
if( isTemp ){
/* If TEMP was specified, then the trigger name may not be qualified. */
if( pName2->n>0 ){
@@ -116,7 +118,8 @@ void sqlite3BeginTrigger(
if( !zName || SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){
goto trigger_cleanup;
}
- if( sqlite3HashFind(&(db->aDb[iDb].pSchema->trigHash), zName,strlen(zName)) ){
+ if( sqlite3HashFind(&(db->aDb[iDb].pSchema->trigHash),
+ zName, (int)strlen(zName)) ){
if( !noErr ){
sqlite3ErrorMsg(pParse, "trigger %T already exists", pName);
}
@@ -177,7 +180,7 @@ void sqlite3BeginTrigger(
pTrigger->table = sqlite3DbStrDup(db, pTableName->a[0].zName);
pTrigger->pSchema = db->aDb[iDb].pSchema;
pTrigger->pTabSchema = pTab->pSchema;
- pTrigger->op = op;
+ pTrigger->op = (u8)op;
pTrigger->tr_tm = tr_tm==TK_BEFORE ? TRIGGER_BEFORE : TRIGGER_AFTER;
pTrigger->pWhen = sqlite3ExprDup(db, pWhen);
pTrigger->pColumns = sqlite3IdListDup(db, pColumns);
@@ -253,13 +256,13 @@ void sqlite3FinishTrigger(
Table *pTab;
Trigger *pDel;
pDel = sqlite3HashInsert(&db->aDb[iDb].pSchema->trigHash,
- pTrig->name, strlen(pTrig->name), pTrig);
+ pTrig->name, (int)strlen(pTrig->name), pTrig);
if( pDel ){
assert( pDel==pTrig );
db->mallocFailed = 1;
goto triggerfinish_cleanup;
}
- n = strlen(pTrig->table) + 1;
+ n = (int)strlen(pTrig->table) + 1;
pTab = sqlite3HashFind(&pTrig->pTabSchema->tblHash, pTrig->table, n);
assert( pTab!=0 );
pTrig->pNext = pTab->pTrigger;
@@ -486,7 +489,7 @@ drop_trigger_cleanup:
** is set on.
*/
static Table *tableOfTrigger(Trigger *pTrigger){
- int n = strlen(pTrigger->table) + 1;
+ int n = (int)strlen(pTrigger->table) + 1;
return sqlite3HashFind(&pTrigger->pTabSchema->tblHash, pTrigger->table, n);
}
@@ -551,7 +554,7 @@ void sqlite3DropTriggerPtr(Parse *pParse, Trigger *pTrigger){
*/
void sqlite3UnlinkAndDeleteTrigger(sqlite3 *db, int iDb, const char *zName){
Trigger *pTrigger;
- int nName = strlen(zName);
+ int nName = (int)strlen(zName);
pTrigger = sqlite3HashInsert(&(db->aDb[iDb].pSchema->trigHash),
zName, nName, 0);
if( pTrigger ){
@@ -642,7 +645,7 @@ static SrcList *targetSrcList(
if( iDb==0 || iDb>=2 ){
assert( iDb<pParse->db->nDb );
sDb.z = (u8*)pParse->db->aDb[iDb].zName;
- sDb.n = strlen((char*)sDb.z);
+ sDb.n = (int)strlen((char*)sDb.z);
pSrc = sqlite3SrcListAppend(pParse->db, 0, &sDb, &pStep->target);
} else {
pSrc = sqlite3SrcListAppend(pParse->db, 0, &pStep->target, 0);
diff --git a/src/utf.c b/src/utf.c
index 28c709226..d17f532cb 100644
--- a/src/utf.c
+++ b/src/utf.c
@@ -12,7 +12,7 @@
** This file contains routines used to translate between UTF-8,
** UTF-16, UTF-16BE, and UTF-16LE.
**
-** $Id: utf.c,v 1.67 2008/12/08 21:37:15 drh Exp $
+** $Id: utf.c,v 1.68 2008/12/09 03:55:14 drh Exp $
**
** Notes on UTF-8:
**
@@ -65,46 +65,46 @@ static const unsigned char sqlite3UtfTrans1[] = {
#define WRITE_UTF8(zOut, c) { \
if( c<0x00080 ){ \
- *zOut++ = (c&0xFF); \
+ *zOut++ = (u8)(c&0xFF); \
} \
else if( c<0x00800 ){ \
- *zOut++ = 0xC0 + ((c>>6)&0x1F); \
- *zOut++ = 0x80 + (c & 0x3F); \
+ *zOut++ = 0xC0 + (u8)((c>>6)&0x1F); \
+ *zOut++ = 0x80 + (u8)(c & 0x3F); \
} \
else if( c<0x10000 ){ \
- *zOut++ = 0xE0 + ((c>>12)&0x0F); \
- *zOut++ = 0x80 + ((c>>6) & 0x3F); \
- *zOut++ = 0x80 + (c & 0x3F); \
+ *zOut++ = 0xE0 + (u8)((c>>12)&0x0F); \
+ *zOut++ = 0x80 + (u8)((c>>6) & 0x3F); \
+ *zOut++ = 0x80 + (u8)(c & 0x3F); \
}else{ \
- *zOut++ = 0xF0 + ((c>>18) & 0x07); \
- *zOut++ = 0x80 + ((c>>12) & 0x3F); \
- *zOut++ = 0x80 + ((c>>6) & 0x3F); \
- *zOut++ = 0x80 + (c & 0x3F); \
+ *zOut++ = 0xF0 + (u8)((c>>18) & 0x07); \
+ *zOut++ = 0x80 + (u8)((c>>12) & 0x3F); \
+ *zOut++ = 0x80 + (u8)((c>>6) & 0x3F); \
+ *zOut++ = 0x80 + (u8)(c & 0x3F); \
} \
}
-#define WRITE_UTF16LE(zOut, c) { \
- if( c<=0xFFFF ){ \
- *zOut++ = (c&0x00FF); \
- *zOut++ = ((c>>8)&0x00FF); \
- }else{ \
- *zOut++ = (((c>>10)&0x003F) + (((c-0x10000)>>10)&0x00C0)); \
- *zOut++ = (0x00D8 + (((c-0x10000)>>18)&0x03)); \
- *zOut++ = (c&0x00FF); \
- *zOut++ = (0x00DC + ((c>>8)&0x03)); \
- } \
+#define WRITE_UTF16LE(zOut, c) { \
+ if( c<=0xFFFF ){ \
+ *zOut++ = (u8)(c&0x00FF); \
+ *zOut++ = (u8)((c>>8)&0x00FF); \
+ }else{ \
+ *zOut++ = (u8)(((c>>10)&0x003F) + (((c-0x10000)>>10)&0x00C0)); \
+ *zOut++ = (u8)(0x00D8 + (((c-0x10000)>>18)&0x03)); \
+ *zOut++ = (u8)(c&0x00FF); \
+ *zOut++ = (u8)(0x00DC + ((c>>8)&0x03)); \
+ } \
}
-#define WRITE_UTF16BE(zOut, c) { \
- if( c<=0xFFFF ){ \
- *zOut++ = ((c>>8)&0x00FF); \
- *zOut++ = (c&0x00FF); \
- }else{ \
- *zOut++ = (0x00D8 + (((c-0x10000)>>18)&0x03)); \
- *zOut++ = (((c>>10)&0x003F) + (((c-0x10000)>>10)&0x00C0)); \
- *zOut++ = (0x00DC + ((c>>8)&0x03)); \
- *zOut++ = (c&0x00FF); \
- } \
+#define WRITE_UTF16BE(zOut, c) { \
+ if( c<=0xFFFF ){ \
+ *zOut++ = (u8)((c>>8)&0x00FF); \
+ *zOut++ = (u8)(c&0x00FF); \
+ }else{ \
+ *zOut++ = (u8)(0x00D8 + (((c-0x10000)>>18)&0x03)); \
+ *zOut++ = (u8)(((c>>10)&0x003F) + (((c-0x10000)>>10)&0x00C0)); \
+ *zOut++ = (u8)(0x00DC + ((c>>8)&0x03)); \
+ *zOut++ = (u8)(c&0x00FF); \
+ } \
}
#define READ_UTF16LE(zIn, c){ \
@@ -305,7 +305,7 @@ int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
WRITE_UTF8(z, c);
}
}
- pMem->n = z - zOut;
+ pMem->n = (int)(z - zOut);
}
*z = 0;
assert( (pMem->n+(desiredEnc==SQLITE_UTF8?1:2))<=len );
@@ -475,7 +475,7 @@ int sqlite3Utf16ByteLen(const void *zIn, int nChar){
n++;
}
}
- return (z-(char const *)zIn)-((c==0)?2:0);
+ return (int)(z-(char const *)zIn)-((c==0)?2:0);
}
#if defined(SQLITE_TEST)
diff --git a/src/util.c b/src/util.c
index d8a632886..34b812c47 100644
--- a/src/util.c
+++ b/src/util.c
@@ -14,7 +14,7 @@
** This file contains functions for allocating memory, comparing
** strings, and stuff like that.
**
-** $Id: util.c,v 1.242 2008/11/17 19:18:55 danielk1977 Exp $
+** $Id: util.c,v 1.243 2008/12/09 03:55:14 drh Exp $
*/
#include "sqliteInt.h"
#include <stdarg.h>
@@ -59,7 +59,7 @@ int sqlite3Strlen(sqlite3 *db, const char *z){
int len;
int x;
while( *z2 ){ z2++; }
- x = z2 - z;
+ x = (int)(z2 - z);
len = 0x7fffffff & x;
if( len!=x || len > db->aLimit[SQLITE_LIMIT_LENGTH] ){
return db->aLimit[SQLITE_LIMIT_LENGTH];
@@ -155,7 +155,7 @@ void sqlite3ErrorClear(Parse *pParse){
** "a-b-c".
*/
void sqlite3Dequote(char *z){
- int quote;
+ char quote;
int i, j;
if( z==0 ) return;
quote = z[0];
@@ -314,8 +314,8 @@ int sqlite3AtoF(const char *z, double *pResult){
v1 *= scale;
}
}
- *pResult = sign<0 ? -v1 : v1;
- return z - zBegin;
+ *pResult = (double)(sign<0 ? -v1 : v1);
+ return (int)(z - zBegin);
#else
return sqlite3Atoi64(z, pResult);
#endif /* SQLITE_OMIT_FLOATING_POINT */
@@ -501,17 +501,17 @@ int sqlite3PutVarint(unsigned char *p, u64 v){
int i, j, n;
u8 buf[10];
if( v & (((u64)0xff000000)<<32) ){
- p[8] = v;
+ p[8] = (u8)v;
v >>= 8;
for(i=7; i>=0; i--){
- p[i] = (v & 0x7f) | 0x80;
+ p[i] = (u8)((v & 0x7f) | 0x80);
v >>= 7;
}
return 9;
}
n = 0;
do{
- buf[n++] = (v & 0x7f) | 0x80;
+ buf[n++] = (u8)((v & 0x7f) | 0x80);
v >>= 7;
}while( v!=0 );
buf[0] &= 0x7f;
@@ -538,8 +538,8 @@ int sqlite3PutVarint32(unsigned char *p, u32 v){
}
#endif
if( (v & ~0x3fff)==0 ){
- p[0] = (v>>7) | 0x80;
- p[1] = v & 0x7f;
+ p[0] = (u8)((v>>7) | 0x80);
+ p[1] = (u8)(v & 0x7f);
return 2;
}
return sqlite3PutVarint(p, v);
@@ -811,10 +811,10 @@ u32 sqlite3Get4byte(const u8 *p){
return (p[0]<<24) | (p[1]<<16) | (p[2]<<8) | p[3];
}
void sqlite3Put4byte(unsigned char *p, u32 v){
- p[0] = v>>24;
- p[1] = v>>16;
- p[2] = v>>8;
- p[3] = v;
+ p[0] = (u8)(v>>24);
+ p[1] = (u8)(v>>16);
+ p[2] = (u8)(v>>8);
+ p[3] = (u8)v;
}
@@ -825,7 +825,7 @@ void sqlite3Put4byte(unsigned char *p, u32 v){
** This routinen only works if h really is a valid hexadecimal
** character: 0..9a..fA..F
*/
-static int hexToInt(int h){
+static u8 hexToInt(int h){
assert( (h>='0' && h<='9') || (h>='a' && h<='f') || (h>='A' && h<='F') );
#ifdef SQLITE_ASCII
h += 9*(1&(h>>6));
@@ -833,7 +833,7 @@ static int hexToInt(int h){
#ifdef SQLITE_EBCDIC
h += 9*(1&~(h>>4));
#endif
- return h & 0xf;
+ return (u8)(h & 0xf);
}
#endif /* !SQLITE_OMIT_BLOB_LITERAL || SQLITE_HAS_CODEC */