aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2014-09-18 01:21:43 +0000
committerdrh <drh@noemail.net>2014-09-18 01:21:43 +0000
commit3329a63ac5ca50861d926248b159106cd9fd96a5 (patch)
treef5554b8bf0c7821fb3055e76d6f3a54c5af2832e /src
parentca5506bdc482bbfde2fe3dd6a93f079e9801ce60 (diff)
downloadsqlite-3329a63ac5ca50861d926248b159106cd9fd96a5.tar.gz
sqlite-3329a63ac5ca50861d926248b159106cd9fd96a5.zip
Fix compiler warnings and change the nullMem structure initializer into a
format that MSVC can understand. FossilOrigin-Name: 163bfae8583b2d3002a3a43d6bf8a66fefd73acb
Diffstat (limited to 'src')
-rw-r--r--src/malloc.c8
-rw-r--r--src/table.c2
-rw-r--r--src/vdbeapi.c26
3 files changed, 18 insertions, 18 deletions
diff --git a/src/malloc.c b/src/malloc.c
index daf646bc3..a4acd2f0c 100644
--- a/src/malloc.c
+++ b/src/malloc.c
@@ -305,7 +305,7 @@ void *sqlite3Malloc(u64 n){
p = 0;
}else if( sqlite3GlobalConfig.bMemstat ){
sqlite3_mutex_enter(mem0.mutex);
- mallocWithAlarm(n, &p);
+ mallocWithAlarm((int)n, &p);
sqlite3_mutex_leave(mem0.mutex);
}else{
p = sqlite3GlobalConfig.m.xMalloc((int)n);
@@ -549,7 +549,7 @@ void *sqlite3Realloc(void *pOld, u64 nBytes){
pNew = pOld;
}else if( sqlite3GlobalConfig.bMemstat ){
sqlite3_mutex_enter(mem0.mutex);
- sqlite3StatusSet(SQLITE_STATUS_MALLOC_SIZE, nBytes);
+ sqlite3StatusSet(SQLITE_STATUS_MALLOC_SIZE, (int)nBytes);
nDiff = nNew - nOld;
if( sqlite3StatusValue(SQLITE_STATUS_MEMORY_USED) >=
mem0.alarmThreshold-nDiff ){
@@ -559,7 +559,7 @@ void *sqlite3Realloc(void *pOld, u64 nBytes){
assert( sqlite3MemdebugNoType(pOld, ~MEMTYPE_HEAP) );
pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew);
if( pNew==0 && mem0.alarmCallback ){
- sqlite3MallocAlarm(nBytes);
+ sqlite3MallocAlarm((int)nBytes);
pNew = sqlite3GlobalConfig.m.xRealloc(pOld, nNew);
}
if( pNew ){
@@ -699,7 +699,7 @@ void *sqlite3DbRealloc(sqlite3 *db, void *p, u64 n){
assert( sqlite3MemdebugHasType(p, MEMTYPE_DB) );
assert( sqlite3MemdebugHasType(p, MEMTYPE_LOOKASIDE|MEMTYPE_HEAP) );
sqlite3MemdebugSetType(p, MEMTYPE_HEAP);
- pNew = sqlite3_realloc(p, n);
+ pNew = sqlite3_realloc64(p, n);
if( !pNew ){
sqlite3MemdebugSetType(p, MEMTYPE_DB|MEMTYPE_HEAP);
db->mallocFailed = 1;
diff --git a/src/table.c b/src/table.c
index 12d0cf548..c435b2bc0 100644
--- a/src/table.c
+++ b/src/table.c
@@ -73,7 +73,7 @@ static int sqlite3_get_table_cb(void *pArg, int nCol, char **argv, char **colv){
if( z==0 ) goto malloc_failed;
p->azResult[p->nData++] = z;
}
- }else if( p->nColumn!=nCol ){
+ }else if( (int)p->nColumn!=nCol ){
sqlite3_free(p->zErrMsg);
p->zErrMsg = sqlite3_mprintf(
"sqlite3_get_table() called with two or more incompatible queries"
diff --git a/src/vdbeapi.c b/src/vdbeapi.c
index dbfabebbf..ef1167a52 100644
--- a/src/vdbeapi.c
+++ b/src/vdbeapi.c
@@ -803,18 +803,18 @@ static const Mem *columnNullValue(void){
__attribute__((aligned(8)))
#endif
= {
- .flags = MEM_Null,
- .enc = 0,
- .n = 0,
- .r = (double)0,
- .u = {0},
- .z = 0,
- .zMalloc = 0,
- .db = 0,
- .xDel = 0,
+ /* .u = */ {0},
+ /* .flags = */ MEM_Null,
+ /* .enc = */ 0,
+ /* .n = */ 0,
+ /* .r = */ (double)0,
+ /* .z = */ 0,
+ /* .zMalloc = */ 0,
+ /* .db = */ 0,
+ /* .xDel = */ 0,
#ifdef SQLITE_DEBUG
- .pScopyFrom = 0,
- .pFiller = 0,
+ /* .pScopyFrom = */ 0,
+ /* .pFiller = */ 0,
#endif
};
return &nullMem;
@@ -1193,7 +1193,7 @@ int sqlite3_bind_blob64(
if( nData>0x7fffffff ){
return invokeValueDestructor(zData, xDel, 0);
}else{
- return bindText(pStmt, i, zData, nData, xDel, 0);
+ return bindText(pStmt, i, zData, (int)nData, xDel, 0);
}
}
int sqlite3_bind_double(sqlite3_stmt *pStmt, int i, double rValue){
@@ -1250,7 +1250,7 @@ int sqlite3_bind_text64(
return invokeValueDestructor(zData, xDel, 0);
}else{
if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE;
- return bindText(pStmt, i, zData, nData, xDel, enc);
+ return bindText(pStmt, i, zData, (int)nData, xDel, enc);
}
}
#ifndef SQLITE_OMIT_UTF16