aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormistachkin <mistachkin@noemail.net>2013-08-28 01:54:12 +0000
committermistachkin <mistachkin@noemail.net>2013-08-28 01:54:12 +0000
commitf64188910dbc4a7152827b3dd532b3360fcb4512 (patch)
treeedb61cc6e326249124f78cd42b3e305cb45c7acd /src
parent4496a2329a0fd2f922e6f80fa7081294bd14a811 (diff)
downloadsqlite-f64188910dbc4a7152827b3dd532b3360fcb4512.tar.gz
sqlite-f64188910dbc4a7152827b3dd532b3360fcb4512.zip
Fix several harmless compiler warnings. Fix a couple compiler issues with the shell.
FossilOrigin-Name: 8917e9f9a0802cbfb6f33e2ab1c2f98e4df5babd
Diffstat (limited to 'src')
-rw-r--r--src/expr.c2
-rw-r--r--src/mem2.c14
-rw-r--r--src/mutex_w32.c2
-rw-r--r--src/shell.c8
-rw-r--r--src/test_malloc.c2
-rw-r--r--src/where.c2
6 files changed, 15 insertions, 15 deletions
diff --git a/src/expr.c b/src/expr.c
index dd4f5de15..aa6f27543 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -1278,7 +1278,7 @@ int sqlite3ExprIsInteger(Expr *p, int *pValue){
case TK_UMINUS: {
int v;
if( sqlite3ExprIsInteger(p->pLeft, &v) ){
- assert( v!=-2147483648 );
+ assert( v!=(-2147483647-1) );
*pValue = -v;
rc = 1;
}
diff --git a/src/mem2.c b/src/mem2.c
index 26448ea8a..d461dffab 100644
--- a/src/mem2.c
+++ b/src/mem2.c
@@ -179,7 +179,7 @@ static int sqlite3MemSize(void *p){
return 0;
}
pHdr = sqlite3MemsysGetHeader(p);
- return pHdr->iSize;
+ return (int)pHdr->iSize;
}
/*
@@ -221,7 +221,7 @@ static void randomFill(char *pBuf, int nByte){
x = SQLITE_PTR_TO_INT(pBuf);
y = nByte | 1;
while( nByte >= 4 ){
- x = (x>>1) ^ (-(x&1) & 0xd0000001);
+ x = (x>>1) ^ (-(int)(x&1) & 0xd0000001);
y = y*1103515245 + 12345;
r = x ^ y;
*(int*)pBuf = r;
@@ -229,7 +229,7 @@ static void randomFill(char *pBuf, int nByte){
nByte -= 4;
}
while( nByte-- > 0 ){
- x = (x>>1) ^ (-(x&1) & 0xd0000001);
+ x = (x>>1) ^ (-(int)(x&1) & 0xd0000001);
y = y*1103515245 + 12345;
r = x ^ y;
*(pBuf++) = r & 0xff;
@@ -324,9 +324,9 @@ static void sqlite3MemFree(void *pPrior){
}
z = (char*)pBt;
z -= pHdr->nTitle;
- adjustStats(pHdr->iSize, -1);
+ adjustStats((int)pHdr->iSize, -1);
randomFill(z, sizeof(void*)*pHdr->nBacktraceSlots + sizeof(*pHdr) +
- pHdr->iSize + sizeof(int) + pHdr->nTitle);
+ (int)pHdr->iSize + sizeof(int) + pHdr->nTitle);
free(z);
sqlite3_mutex_leave(mem.mutex);
}
@@ -350,7 +350,7 @@ static void *sqlite3MemRealloc(void *pPrior, int nByte){
if( pNew ){
memcpy(pNew, pPrior, nByte<pOldHdr->iSize ? nByte : pOldHdr->iSize);
if( nByte>pOldHdr->iSize ){
- randomFill(&((char*)pNew)[pOldHdr->iSize], nByte - pOldHdr->iSize);
+ randomFill(&((char*)pNew)[pOldHdr->iSize], nByte - (int)pOldHdr->iSize);
}
sqlite3MemFree(pPrior);
}
@@ -465,7 +465,7 @@ void sqlite3MemdebugSync(){
for(pHdr=mem.pFirst; pHdr; pHdr=pHdr->pNext){
void **pBt = (void**)pHdr;
pBt -= pHdr->nBacktraceSlots;
- mem.xBacktrace(pHdr->iSize, pHdr->nBacktrace-1, &pBt[1]);
+ mem.xBacktrace((int)pHdr->iSize, pHdr->nBacktrace-1, &pBt[1]);
}
}
diff --git a/src/mutex_w32.c b/src/mutex_w32.c
index 27d10af5b..f89a611b6 100644
--- a/src/mutex_w32.c
+++ b/src/mutex_w32.c
@@ -107,7 +107,7 @@ static int winMutex_isInit = 0;
** processing, the "interlocked" magic is probably not
** strictly necessary.
*/
-static long winMutex_lock = 0;
+static LONG winMutex_lock = 0;
void sqlite3_win32_sleep(DWORD milliseconds); /* os_win.c */
diff --git a/src/shell.c b/src/shell.c
index 64c17ed05..093b58bc2 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -71,12 +71,12 @@
/* Make sure isatty() has a prototype.
*/
extern int isatty(int);
-#endif
/* popen and pclose are not C89 functions and so are sometimes omitted from
** the <stdio.h> header */
-FILE *popen(const char*,const char*);
-int pclose(FILE*);
+extern FILE *popen(const char*,const char*);
+extern int pclose(FILE*);
+#endif
#if defined(_WIN32_WCE)
/* Windows CE (arm-wince-mingw32ce-gcc) does not provide isatty()
@@ -554,7 +554,7 @@ static void output_c_string(FILE *out, const char *z){
}else if( c=='\r' ){
fputc('\\', out);
fputc('r', out);
- }else if( !isprint(c) ){
+ }else if( !isprint(c&0xff) ){
fprintf(out, "\\%03o", c&0xff);
}else{
fputc(c, out);
diff --git a/src/test_malloc.c b/src/test_malloc.c
index 2e31f0833..f513e24bf 100644
--- a/src/test_malloc.c
+++ b/src/test_malloc.c
@@ -749,7 +749,7 @@ static void test_memdebug_callback(int nByte, int nFrame, void **aFrame){
int isNew;
int aKey[MALLOC_LOG_KEYINTS];
- int nKey = sizeof(int)*MALLOC_LOG_KEYINTS;
+ unsigned int nKey = sizeof(int)*MALLOC_LOG_KEYINTS;
memset(aKey, 0, nKey);
if( (sizeof(void*)*nFrame)<nKey ){
diff --git a/src/where.c b/src/where.c
index 05e6824f0..5daac14bc 100644
--- a/src/where.c
+++ b/src/where.c
@@ -3030,7 +3030,7 @@ static int codeAllEqualityTerms(
/* Evaluate the equality constraints
*/
- assert( zAff==0 || strlen(zAff)>=nEq );
+ assert( zAff==0 || (int)strlen(zAff)>=nEq );
for(j=0; j<nEq; j++){
int r1;
pTerm = pLoop->aLTerm[j];