From: drh Date: Fri, 9 Dec 2005 20:02:05 +0000 (+0000) Subject: Clean up annoying (and pointless) compiler warnings about differing signedness. ... X-Git-Tag: version-3.6.10~3350 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2646da7e524e857ebefe0a423c8f2553f998f8d4;p=thirdparty%2Fsqlite.git Clean up annoying (and pointless) compiler warnings about differing signedness. (CVS 2810) FossilOrigin-Name: 83a59151559d9496d4f546e03e65087ea974717d --- diff --git a/manifest b/manifest index c28bd1dc8d..3eb9a4ba33 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Define\sthe\ssqliteMalloc()\smacro\sdifferently\sto\savoid\sa\scompiler\swarning.\s(CVS\s2809) -D 2005-12-09T14:39:04 +C Clean\sup\sannoying\s(and\spointless)\scompiler\swarnings\sabout\sdiffering\ssignedness.\s(CVS\s2810) +D 2005-12-09T20:02:05 F Makefile.in e3c6b3a38d734d41574c04f2fc90d18de2b87102 F Makefile.linux-gcc aee18d8a05546dcf1888bd4547e442008a49a092 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 @@ -30,46 +30,46 @@ F sqlite.pc.in 30552343140c53304c2a658c080fbe810cd09ca2 F sqlite3.1 6be1ad09113570e1fc8dcaff84c9b0b337db5ffc F sqlite3.def c413e514217736884254739a105c8c942fdf0c2f F sqlite3.pc.in 985b9bf34192a549d7d370e0f0b6b34a4f61369a -F src/alter.c 7ed4b794c2e3a8ad8c1effe50202eaef42cedc23 +F src/alter.c 26e590618fe6a316c74626dbea6529c7315172e9 F src/analyze.c ea42005eed52c382fcc7ef66969e7f1858597633 F src/attach.c ee70131f128d31a9c6dcb8824e8471c91b18601a F src/auth.c 31e2304bef67f44d635655f44234387ea7d21454 -F src/btree.c aa88194f460becf8fff6196996d6e38f1b37286e +F src/btree.c de0fc1a0f6a4631001ffb6070d1b7588cdebcbc5 F src/btree.h 1ed561263ca0e335bc3e81d761c9d5ff8c22f61e -F src/build.c 41350367dc5837b0dafa83cbd5bf08f0108031b0 +F src/build.c 306dde3134acd8f1c9f3821d81c3cb598af91280 F src/callback.c 4bc404e9912eecb28be1235581833f6269920c27 F src/complete.c 4de937dfdd4c79a501772ab2035b26082f337a79 -F src/date.c 8bc8d084a17d19c44d9cbf357b5f656db6706ce1 +F src/date.c bb079317bff6a2b78aba5c0d2ddae5f6f03acfb7 F src/delete.c 6010a081edda9871895260def092e852f0bb60a0 F src/experimental.c 50c1e3b34f752f4ac10c36f287db095c2b61766d -F src/expr.c 540ed7eb44b79e5603c3656466bf1d7381abcfc7 -F src/func.c f5171a1bd0bc3eae91d37bd42724784570b203cd +F src/expr.c abdd20121595e37cc2db3612f3c0e6f5db1a9652 +F src/func.c 25f1e5710b71cb345b492a18088f546188599f6b F src/hash.c 8747cf51d12de46512880dfcf1b68b4e24072863 F src/hash.h 1b0c445e1c89ff2aaad9b4605ba61375af001e84 F src/insert.c 5393479164f317ea0aeec954c6500cafa097ef33 F src/legacy.c 7b88d20efc8e6c208f262d97aee9c8e2cf02bc91 -F src/main.c 8da1f263376c33c5d5911a6de789e30a596381d3 +F src/main.c d8656320f9299c70ee6a41deab5350d615ffa3b7 F src/md5.c 7ae1c39044b95de2f62e066f47bb1deb880a1070 F src/os.c bdd3a2fd089777e7ad18b57c896f1141d5a0c1fd F src/os.h d5ae3f4c1c7731437b6cddec279b7c06f761c44e F src/os_common.h d74a11728ad2444b6b695b94c28c06881f049e49 F src/os_test.c 49833426101f99aee4bb5f6a44b7c4b2029fda1c F src/os_test.h 903c93554c23d88f34f667f1979e4a1cee792af3 -F src/os_unix.c 01648f7fa16cddb1f8a11ef2a582348801b185a6 +F src/os_unix.c f11eba69eea2ae2723f5ae1bdad8b1ef12e224b9 F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e F src/os_win.c d962ac2dd0e482847e42b846d46cd044f97d1c32 F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b -F src/pager.c 893cb2106261a4f77d84c1fa0d10a083e889b23b +F src/pager.c 49f63a54b57164a70df0b1539141003fd27856c6 F src/pager.h e7b41ce8e7b5f629d456708b7ad9a8c8ede37140 -F src/parse.y 87080d89439925de19f16189310d3dbc7f9ab3f6 -F src/pragma.c a6d3a7c76b4008b8197913de4bd2079e00b145db -F src/prepare.c 7e21ab5e2304e76f5f679d0df19dca3b0e3ff4f2 -F src/printf.c 3ea3a17d25d7ac498efc18007c70371a42c968f8 +F src/parse.y d0b1f9a4d508bf043cdbc7079aa26dff7d358651 +F src/pragma.c 8883b4d34796efa315bdd0ec1b03f580ef1575b9 +F src/prepare.c 8d75f7dbe7b1055789be17d6a70f1fedcaf4c31d +F src/printf.c f47a2f4b5387cd2ebb12e9117a1a5d6bd9a2b812 F src/random.c ff5e9a8cad790e2a51cd4d2e7737dc8540e09d1d -F src/select.c 0e4d3627fec4a445b45f6cb471f68aab9c97a8b3 +F src/select.c 2292b065bc6be61e01aad39a2e1b93e332fb7e57 F src/shell.c 4872acee1d2a826c73c914961e469e563204b7f9 F src/sqlite.h.in 8e648e1f386e4509f2f96c09ded7c07b0df0c9a2 -F src/sqliteInt.h f74a403b6110aa973fd6892d894c9ca5b94ab23a +F src/sqliteInt.h feb11bfe9bf79b4493319173c47739fe2bb7ffa4 F src/table.c 486dcfce532685b53b5a2b5da8bba0ded6fb2316 F src/tclsqlite.c 328060916c24d328cfab1622c9a0e7ad57c2da8c F src/test1.c 96d78c83c011df65f1c3538e2118647b09239acd @@ -78,19 +78,19 @@ F src/test3.c f4e6a16a602091696619a1171bda25c0e3df49f7 F src/test4.c a8fd681e139e1c61f22a77d07fc3a99cb28fff3f F src/test5.c 64f08b2a50ef371a1bd68ff206829e7b1b9997f5 F src/test6.c cb811391ec0b7c75f29e545d4820a9cf19f3637e -F src/tokenize.c a189d7466524076220f41a21baed05e1639a82f4 -F src/trigger.c dfc1f8ee8e71c6482fb269695778c8b51f821c98 +F src/tokenize.c 7a3a3d3cc734f684a77c4dfd09eb46fcee25394c +F src/trigger.c 2925ba96d964d9b717e74006bf7e64b8a6b70d97 F src/update.c ec8e540617b116725b5a55c8d6b4db8bc67fdd7d -F src/utf.c bda5eb85039ef16f2d17004c1e18c96e1ab0a80c +F src/utf.c a1fd34e5db0dc4da1c37405381a656230c7b922d F src/util.c 94c0b99e66243b3452c81cd321eb6e61e4c5fba0 -F src/vacuum.c 3cd457f91b05338269f2ea21c4c58dce93f2eef2 -F src/vdbe.c 4f78f1fe3b5e7675ee54a2cc18f14dea4ff5fd94 +F src/vacuum.c fbfdd3967fd34e2f260fafed88dcbf3c10856b94 +F src/vdbe.c d09c185f4badac6c79f2a919cbf661e7b5618293 F src/vdbe.h 8729a4ee16ff9aeab2af9667df3cf300ff978e13 F src/vdbeInt.h 0055c37eccbf3a189fd893a90f8eb6a5fa60c871 F src/vdbeapi.c b270b680cbc5d20b5a1abfdb08339667985df94e -F src/vdbeaux.c b0a4a4b19b42f18d86c0026a9cc548478dc6a7a7 +F src/vdbeaux.c f714ee9e91f1e47d4b6ae83798e0b263ffe224cc F src/vdbefifo.c 9efb94c8c3f4c979ebd0028219483f88e57584f5 -F src/vdbemem.c 1c70555d615c6001c4490dedb6a62cb2884b92ff +F src/vdbemem.c deba8d6e3727643924b210a8c531a496c2b8d386 F src/where.c 269569f380ddc018518f67765fe2f0d3c8760e28 F tclinstaller.tcl 046e3624671962dc50f0481d7c25b38ef803eb42 F test/all.test 7f0988442ab811dfa41793b5b550f5828ce316f3 @@ -264,7 +264,7 @@ F tool/lempar.c 424df14a48736bb961ed47acf30c26d66ed85a62 F tool/memleak.awk 4e7690a51bf3ed757e611273d43fe3f65b510133 F tool/memleak2.awk 9cc20c8e8f3c675efac71ea0721ee6874a1566e8 F tool/memleak3.tcl 7707006ee908cffff210c98158788d85bb3fcdbf -F tool/mkkeywordhash.c 5263a654e5c9fd8d6e3238fb39c2d5c3126be32f +F tool/mkkeywordhash.c 784791334097c4d6408067633a803819425b0e5e F tool/mkopts.tcl 66ac10d240cc6e86abd37dc908d50382f84ff46e x F tool/opcodeDoc.awk b3a2a3d5d3075b8bd90b7afe24283efdd586659c F tool/report1.txt 9eae07f26a8fc53889b45fc833a66a33daa22816 @@ -327,7 +327,7 @@ F www/tclsqlite.tcl ddcf912ea48695603c8ed7efb29f0812ef8d1b49 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513 -P 601c335463aaabc2e9918e4b9298cff6161be5c4 -R 6a5215138c99b7ed11b03e5b976ead6d -U danielk1977 -Z 67f8e397461027dcb38f9fe0ac81e736 +P 3d177bde71811391f79f4ab3bae054ef1bceb6a0 +R 28591b123245fca85b0cbb70cd4862f2 +U drh +Z 483e3117155553497a07bea2c3be4e78 diff --git a/manifest.uuid b/manifest.uuid index 053b700cb8..9b4e679073 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3d177bde71811391f79f4ab3bae054ef1bceb6a0 \ No newline at end of file +83a59151559d9496d4f546e03e65087ea974717d \ No newline at end of file diff --git a/src/alter.c b/src/alter.c index 3b032678f0..1e4f8a274a 100644 --- a/src/alter.c +++ b/src/alter.c @@ -12,7 +12,7 @@ ** This file contains C code routines that used to generate VDBE code ** that implements the ALTER TABLE command. ** -** $Id: alter.c,v 1.10 2005/12/06 12:52:59 danielk1977 Exp $ +** $Id: alter.c,v 1.11 2005/12/09 20:02:05 drh Exp $ */ #include "sqliteInt.h" #include @@ -47,7 +47,7 @@ static void renameTableFunc( int token; Token tname; - char const *zCsr = zSql; + unsigned char const *zCsr = zSql; int len = 0; char *zRet; @@ -96,7 +96,7 @@ static void renameTriggerFunc( int token; Token tname; int dist = 3; - char const *zCsr = zSql; + unsigned char const *zCsr = zSql; int len = 0; char *zRet; @@ -442,7 +442,7 @@ void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){ } /* Modify the CREATE TABLE statement. */ - zCol = sqliteStrNDup(pColDef->z, pColDef->n); + zCol = sqliteStrNDup((char*)pColDef->z, pColDef->n); if( zCol ){ char *zEnd = &zCol[pColDef->n-1]; while( (zEnd>zCol && *zEnd==';') || isspace(*(unsigned char *)zEnd) ){ diff --git a/src/btree.c b/src/btree.c index dafbbc2c12..ba5e6c4926 100644 --- a/src/btree.c +++ b/src/btree.c @@ -9,7 +9,7 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* -** $Id: btree.c,v 1.272 2005/11/24 14:34:36 drh Exp $ +** $Id: btree.c,v 1.273 2005/12/09 20:02:05 drh Exp $ ** ** This file implements a external (disk-based) database using BTrees. ** For a detailed discussion of BTrees, refer to @@ -1535,7 +1535,7 @@ static void unlockBtreeIfUnused(Btree *pBt){ if( pBt->inTrans==TRANS_NONE && pBt->pCursor==0 && pBt->pPage1!=0 ){ if( pBt->pPage1->aData==0 ){ MemPage *pPage = pBt->pPage1; - pPage->aData = &((char*)pPage)[-pBt->pageSize]; + pPage->aData = &((u8*)pPage)[-pBt->pageSize]; pPage->pBt = pBt; pPage->pgno = 1; } diff --git a/src/build.c b/src/build.c index 78b7c3a1f3..2a9a144c54 100644 --- a/src/build.c +++ b/src/build.c @@ -22,7 +22,7 @@ ** COMMIT ** ROLLBACK ** -** $Id: build.c,v 1.356 2005/12/06 12:52:59 danielk1977 Exp $ +** $Id: build.c,v 1.357 2005/12/09 20:02:05 drh Exp $ */ #include "sqliteInt.h" #include @@ -509,7 +509,7 @@ void sqlite3UnlinkAndDeleteTable(sqlite3 *db, int iDb, const char *zTabName){ char *sqlite3NameFromToken(Token *pName){ char *zName; if( pName ){ - zName = sqliteStrNDup(pName->z, pName->n); + zName = sqliteStrNDup((char*)pName->z, pName->n); sqlite3Dequote(zName); }else{ zName = 0; @@ -2224,8 +2224,8 @@ void sqlite3CreateIndex( ** So create a fake list to simulate this. */ if( pList==0 ){ - nullId.z = pTab->aCol[pTab->nCol-1].zName; - nullId.n = strlen(nullId.z); + nullId.z = (u8*)pTab->aCol[pTab->nCol-1].zName; + nullId.n = strlen((char*)nullId.z); pList = sqlite3ExprListAppend(0, 0, &nullId); if( pList==0 ) goto exit_create_index; } @@ -2980,7 +2980,7 @@ void sqlite3Reindex(Parse *pParse, Token *pName1, Token *pName2){ reindexDatabases(pParse, 0); return; }else if( pName2==0 || pName2->z==0 ){ - pColl = sqlite3FindCollSeq(db, db->enc, pName1->z, pName1->n, 0); + pColl = sqlite3FindCollSeq(db, db->enc, (char*)pName1->z, pName1->n, 0); if( pColl ){ reindexDatabases(pParse, pColl); return; diff --git a/src/date.c b/src/date.c index e4b8f3ab48..18c1fe47be 100644 --- a/src/date.c +++ b/src/date.c @@ -16,7 +16,7 @@ ** sqlite3RegisterDateTimeFunctions() found at the bottom of the file. ** All other code has file scope. ** -** $Id: date.c,v 1.46 2005/11/30 03:20:31 drh Exp $ +** $Id: date.c,v 1.47 2005/12/09 20:02:05 drh Exp $ ** ** NOTES: ** @@ -639,10 +639,10 @@ static int isDate(int argc, sqlite3_value **argv, DateTime *p){ int i; if( argc==0 ) return 1; if( SQLITE_NULL==sqlite3_value_type(argv[0]) || - parseDateOrTime(sqlite3_value_text(argv[0]), p) ) return 1; + parseDateOrTime((char*)sqlite3_value_text(argv[0]), p) ) return 1; for(i=1; i @@ -235,7 +235,7 @@ Expr *sqlite3RegisterExpr(Parse *pParse, Token *pToken){ if( p==0 ){ return 0; /* Malloc failed */ } - depth = atoi(&pToken->z[1]); + depth = atoi((char*)&pToken->z[1]); p->iTable = pParse->nMem++; sqlite3VdbeAddOp(v, OP_Dup, depth, 0); sqlite3VdbeAddOp(v, OP_MemStore, p->iTable, 1); @@ -327,7 +327,7 @@ void sqlite3ExprAssignVarNumber(Parse *pParse, Expr *pExpr){ /* Wildcard of the form "?nnn". Convert "nnn" to an integer and ** use it as the variable number */ int i; - pExpr->iTable = i = atoi(&pToken->z[1]); + pExpr->iTable = i = atoi((char*)&pToken->z[1]); if( i<1 || i>SQLITE_MAX_VARIABLE_NUMBER ){ sqlite3ErrorMsg(pParse, "variable number must be between ?1 and ?%d", SQLITE_MAX_VARIABLE_NUMBER); @@ -415,7 +415,7 @@ Expr *sqlite3ExprDup(Expr *p){ if( pNew==0 ) return 0; memcpy(pNew, p, sizeof(*pNew)); if( p->token.z!=0 ){ - pNew->token.z = sqliteStrNDup(p->token.z, p->token.n); + pNew->token.z = (u8*)sqliteStrNDup((char*)p->token.z, p->token.n); pNew->token.dyn = 1; }else{ assert( pNew->token.z==0 ); @@ -432,7 +432,7 @@ void sqlite3TokenCopy(Token *pTo, Token *pFrom){ if( pTo->dyn ) sqliteFree((char*)pTo->z); if( pFrom->z ){ pTo->n = pFrom->n; - pTo->z = sqliteStrNDup(pFrom->z, pFrom->n); + pTo->z = (u8*)sqliteStrNDup((char*)pFrom->z, pFrom->n); pTo->dyn = 1; }else{ pTo->z = 0; @@ -752,7 +752,7 @@ int sqlite3ExprIsConstantOrFunction(Expr *p){ int sqlite3ExprIsInteger(Expr *p, int *pValue){ switch( p->op ){ case TK_INTEGER: { - if( sqlite3GetInt32(p->token.z, pValue) ){ + if( sqlite3GetInt32((char*)p->token.z, pValue) ){ return 1; } break; @@ -1150,7 +1150,7 @@ static int nameResolverStep(void *pArg, Expr *pExpr){ FuncDef *pDef; /* Information about the function */ int enc = pParse->db->enc; /* The database encoding */ - zId = pExpr->token.z; + zId = (char*)pExpr->token.z; nId = pExpr->token.n; pDef = sqlite3FindFunction(pParse->db, zId, nId, n, enc, 0); if( pDef==0 ){ @@ -1402,7 +1402,7 @@ void sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){ ** value of this select in a memory cell and record the number ** of the memory cell in iColumn. */ - static const Token one = { "1", 0, 1 }; + static const Token one = { (u8*)"1", 0, 1 }; Select *pSel; int iMem; int sop; @@ -1503,7 +1503,7 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){ break; } case TK_INTEGER: { - codeInteger(v, pExpr->token.z, pExpr->token.n); + codeInteger(v, (char*)pExpr->token.z, pExpr->token.n); break; } case TK_FLOAT: @@ -1511,7 +1511,7 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){ assert( TK_FLOAT==OP_Real ); assert( TK_STRING==OP_String8 ); sqlite3DequoteExpr(pExpr); - sqlite3VdbeOp3(v, op, 0, 0, pExpr->token.z, pExpr->token.n); + sqlite3VdbeOp3(v, op, 0, 0, (char*)pExpr->token.z, pExpr->token.n); break; } case TK_NULL: { @@ -1524,7 +1524,7 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){ const char *z; assert( TK_BLOB==OP_HexBlob ); n = pExpr->token.n - 3; - z = pExpr->token.z + 2; + z = (char*)pExpr->token.z + 2; assert( n>=0 ); if( n==0 ){ z = ""; @@ -1536,7 +1536,7 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){ case TK_VARIABLE: { sqlite3VdbeAddOp(v, OP_Variable, pExpr->iTable, 0); if( pExpr->token.n>1 ){ - sqlite3VdbeChangeP3(v, -1, pExpr->token.z, pExpr->token.n); + sqlite3VdbeChangeP3(v, -1, (char*)pExpr->token.z, pExpr->token.n); } break; } @@ -1667,7 +1667,7 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){ int i; u8 enc = pParse->db->enc; CollSeq *pColl = 0; - zId = pExpr->token.z; + zId = (char*)pExpr->token.z; nId = pExpr->token.n; pDef = sqlite3FindFunction(pParse->db, zId, nId, nExpr, enc, 0); assert( pDef!=0 ); @@ -1803,7 +1803,7 @@ void sqlite3ExprCode(Parse *pParse, Expr *pExpr){ pExpr->iColumn == OE_Fail ); sqlite3DequoteExpr(pExpr); sqlite3VdbeOp3(v, OP_Halt, SQLITE_CONSTRAINT, pExpr->iColumn, - pExpr->token.z, pExpr->token.n); + (char*)pExpr->token.z, pExpr->token.n); } else { assert( pExpr->iColumn == OE_Ignore ); sqlite3VdbeAddOp(v, OP_ContextPop, 0, 0); @@ -2106,7 +2106,9 @@ int sqlite3ExprCompare(Expr *pA, Expr *pB){ if( pA->token.z ){ if( pB->token.z==0 ) return 0; if( pB->token.n!=pA->token.n ) return 0; - if( sqlite3StrNICmp(pA->token.z, pB->token.z, pB->token.n)!=0 ) return 0; + if( sqlite3StrNICmp((char*)pA->token.z,(char*)pB->token.z,pB->token.n)!=0 ){ + return 0; + } } return 1; } @@ -2237,7 +2239,7 @@ static int analyzeAggregate(void *pArg, Expr *pExpr){ pItem->pExpr = pExpr; pItem->iMem = pParse->nMem++; pItem->pFunc = sqlite3FindFunction(pParse->db, - pExpr->token.z, pExpr->token.n, + (char*)pExpr->token.z, pExpr->token.n, pExpr->pList ? pExpr->pList->nExpr : 0, enc, 0); if( pExpr->flags & EP_Distinct ){ pItem->iDistinct = pParse->nTab++; diff --git a/src/func.c b/src/func.c index c0038904be..a50c3a3eee 100644 --- a/src/func.c +++ b/src/func.c @@ -16,7 +16,7 @@ ** sqliteRegisterBuildinFunctions() found at the bottom of the file. ** All other code has file scope. ** -** $Id: func.c,v 1.112 2005/12/06 17:19:11 danielk1977 Exp $ +** $Id: func.c,v 1.113 2005/12/09 20:02:05 drh Exp $ */ #include "sqliteInt.h" #include @@ -101,7 +101,7 @@ static void lengthFunc( break; } case SQLITE_TEXT: { - const char *z = sqlite3_value_text(argv[0]); + const unsigned char *z = sqlite3_value_text(argv[0]); for(len=0; *z; z++){ if( (0xc0&*z)!=0x80 ) len++; } sqlite3_result_int(context, len); break; @@ -146,8 +146,8 @@ static void substrFunc( int argc, sqlite3_value **argv ){ - const char *z; - const char *z2; + const unsigned char *z; + const unsigned char *z2; int i; int p1, p2, len; @@ -178,7 +178,7 @@ static void substrFunc( } while( z[i] && (z[i]&0xc0)==0x80 ){ i++; p2++; } if( p2<0 ) p2 = 0; - sqlite3_result_text(context, &z[p1], p2, SQLITE_TRANSIENT); + sqlite3_result_text(context, (char*)&z[p1], p2, SQLITE_TRANSIENT); } /* @@ -210,11 +210,11 @@ static void upperFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ if( argc<1 || SQLITE_NULL==sqlite3_value_type(argv[0]) ) return; z = sqliteMalloc(sqlite3_value_bytes(argv[0])+1); if( z==0 ) return; - strcpy(z, sqlite3_value_text(argv[0])); + strcpy((char*)z, (char*)sqlite3_value_text(argv[0])); for(i=0; z[i]; i++){ z[i] = toupper(z[i]); } - sqlite3_result_text(context, z, -1, SQLITE_TRANSIENT); + sqlite3_result_text(context, (char*)z, -1, SQLITE_TRANSIENT); sqliteFree(z); } static void lowerFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ @@ -223,11 +223,11 @@ static void lowerFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ if( argc<1 || SQLITE_NULL==sqlite3_value_type(argv[0]) ) return; z = sqliteMalloc(sqlite3_value_bytes(argv[0])+1); if( z==0 ) return; - strcpy(z, sqlite3_value_text(argv[0])); + strcpy((char*)z, (char*)sqlite3_value_text(argv[0])); for(i=0; z[i]; i++){ z[i] = tolower(z[i]); } - sqlite3_result_text(context, z, -1, SQLITE_TRANSIENT); + sqlite3_result_text(context, (char*)z, -1, SQLITE_TRANSIENT); sqliteFree(z); } @@ -495,7 +495,7 @@ static void likeFunc( ** Otherwise, return an error. */ const unsigned char *zEsc = sqlite3_value_text(argv[2]); - if( sqlite3utf8CharLen(zEsc, -1)!=1 ){ + if( sqlite3utf8CharLen((char*)zEsc, -1)!=1 ){ sqlite3_result_error(context, "ESCAPE expression must be a single character", -1); return; @@ -592,7 +592,7 @@ static void quoteFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ } case SQLITE_TEXT: { int i,j,n; - const char *zArg = sqlite3_value_text(argv[0]); + const unsigned char *zArg = sqlite3_value_text(argv[0]); char *z; for(i=n=0; zArg[i]; i++){ if( zArg[i]=='\'' ) n++; } @@ -692,7 +692,7 @@ static void randStr(sqlite3_context *context, int argc, sqlite3_value **argv){ zBuf[i] = zSrc[zBuf[i]%(sizeof(zSrc)-1)]; } zBuf[n] = 0; - sqlite3_result_text(context, zBuf, n, SQLITE_TRANSIENT); + sqlite3_result_text(context, (char*)zBuf, n, SQLITE_TRANSIENT); } #endif /* SQLITE_TEST */ @@ -776,7 +776,7 @@ static void test_auxdata( char *zRet = sqliteMalloc(nArg*2); if( !zRet ) return; for(i=0; ipList->nExpr!=2 ){ return 0; } - pDef = sqlite3FindFunction(db, pExpr->token.z, pExpr->token.n, 2, + pDef = sqlite3FindFunction(db, (char*)pExpr->token.z, pExpr->token.n, 2, SQLITE_UTF8, 0); if( pDef==0 || (pDef->flags & SQLITE_FUNC_LIKE)==0 ){ return 0; diff --git a/src/main.c b/src/main.c index d0fa7291e7..3410770878 100644 --- a/src/main.c +++ b/src/main.c @@ -14,7 +14,7 @@ ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** -** $Id: main.c,v 1.306 2005/12/06 13:19:08 drh Exp $ +** $Id: main.c,v 1.307 2005/12/09 20:02:05 drh Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -641,7 +641,7 @@ const char *sqlite3_errmsg(sqlite3 *db){ if( sqlite3SafetyCheck(db) || db->errCode==SQLITE_MISUSE ){ return sqlite3ErrStr(SQLITE_MISUSE); } - z = sqlite3_value_text(db->pErr); + z = (char*)sqlite3_value_text(db->pErr); if( z==0 ){ z = sqlite3ErrStr(db->errCode); } diff --git a/src/os_unix.c b/src/os_unix.c index c07a80cb91..349db3d7cd 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -633,7 +633,6 @@ static int unixOpenReadWrite( static int unixOpenExclusive(const char *zFilename, OsFile **pId, int delFlag){ int rc; unixFile f; - int fd; assert( 0==*pId ); if( access(zFilename, 0)==0 ){ diff --git a/src/pager.c b/src/pager.c index 813ccf8882..d52334e722 100644 --- a/src/pager.c +++ b/src/pager.c @@ -18,7 +18,7 @@ ** file simultaneously, or one process from reading the database while ** another is writing. ** -** @(#) $Id: pager.c,v 1.223 2005/12/06 12:52:59 danielk1977 Exp $ +** @(#) $Id: pager.c,v 1.224 2005/12/09 20:02:05 drh Exp $ */ #ifndef SQLITE_OMIT_DISKIO #include "sqliteInt.h" @@ -950,7 +950,7 @@ static int pager_unwritelock(Pager *pPager){ ** only the middle sector is corrupt, we will still have a reasonable ** chance of failing the checksum and thus detecting the problem. */ -static u32 pager_cksum(Pager *pPager, Pgno pgno, const char *aData){ +static u32 pager_cksum(Pager *pPager, Pgno pgno, const u8 *aData){ u32 cksum = pPager->cksumInit; int i = pPager->pageSize-200; while( i>0 ){ diff --git a/src/parse.y b/src/parse.y index 5b2700a36f..64f3a7beb1 100644 --- a/src/parse.y +++ b/src/parse.y @@ -14,7 +14,7 @@ ** the parser. Lemon will also generate a header file containing ** numeric codes for all of the tokens. ** -** @(#) $Id: parse.y,v 1.186 2005/12/06 17:19:11 danielk1977 Exp $ +** @(#) $Id: parse.y,v 1.187 2005/12/09 20:02:05 drh Exp $ */ // All token codes are small integers with #defines that begin with "TK_" @@ -230,8 +230,8 @@ typetoken(A) ::= typename(X) LP signed COMMA signed RP(Y). { typename(A) ::= ids(X). {A = X;} typename(A) ::= typename(X) ids(Y). {A.z=X.z; A.n=Y.n+(Y.z-X.z);} %type signed {int} -signed(A) ::= plus_num(X). { A = atoi(X.z); } -signed(A) ::= minus_num(X). { A = -atoi(X.z); } +signed(A) ::= plus_num(X). { A = atoi((char*)X.z); } +signed(A) ::= minus_num(X). { A = -atoi((char*)X.z); } // "carglist" is a list of additional constraints that come after the // column name and column type in a CREATE TABLE statement. @@ -264,7 +264,7 @@ ccons ::= CHECK LP expr(X) RP. {sqlite3AddCheckConstraint(pParse,X);} ccons ::= REFERENCES nm(T) idxlist_opt(TA) refargs(R). {sqlite3CreateForeignKey(pParse,0,&T,TA,R);} ccons ::= defer_subclause(D). {sqlite3DeferForeignKey(pParse,D);} -ccons ::= COLLATE id(C). {sqlite3AddCollateType(pParse, C.z, C.n);} +ccons ::= COLLATE id(C). {sqlite3AddCollateType(pParse, (char*)C.z, C.n);} // The optional AUTOINCREMENT keyword %type autoinc {int} @@ -853,7 +853,7 @@ idxlist(A) ::= idxlist(X) COMMA idxitem(Y) collate(C) sortorder. { Expr *p = 0; if( C.n>0 ){ p = sqlite3Expr(TK_COLUMN, 0, 0, 0); - if( p ) p->pColl = sqlite3LocateCollSeq(pParse, C.z, C.n); + if( p ) p->pColl = sqlite3LocateCollSeq(pParse, (char*)C.z, C.n); } A = sqlite3ExprListAppend(X, p, &Y); } @@ -861,7 +861,7 @@ idxlist(A) ::= idxitem(Y) collate(C) sortorder. { Expr *p = 0; if( C.n>0 ){ p = sqlite3Expr(TK_COLUMN, 0, 0, 0); - if( p ) p->pColl = sqlite3LocateCollSeq(pParse, C.z, C.n); + if( p ) p->pColl = sqlite3LocateCollSeq(pParse, (char*)C.z, C.n); } A = sqlite3ExprListAppend(0, p, &Y); } diff --git a/src/pragma.c b/src/pragma.c index 5e02e37447..dd1485a885 100644 --- a/src/pragma.c +++ b/src/pragma.c @@ -11,7 +11,7 @@ ************************************************************************* ** This file contains code used to implement the PRAGMA command. ** -** $Id: pragma.c,v 1.106 2005/12/08 18:12:56 drh Exp $ +** $Id: pragma.c,v 1.107 2005/12/09 20:02:05 drh Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -36,7 +36,7 @@ ** to support legacy SQL code. The safety level used to be boolean ** and older scripts may have used numbers 0 for OFF and 1 for ON. */ -static int getSafetyLevel(const u8 *z){ +static int getSafetyLevel(const char *z){ /* 123456789 123456789 */ static const char zText[] = "onoffalseyestruefull"; static const u8 iOffset[] = {0, 1, 2, 4, 9, 12, 16}; @@ -58,7 +58,7 @@ static int getSafetyLevel(const u8 *z){ /* ** Interpret the given string as a boolean value. */ -static int getBoolean(const u8 *z){ +static int getBoolean(const char *z){ return getSafetyLevel(z)&1; } diff --git a/src/prepare.c b/src/prepare.c index 9a1d4f3382..ecd7fa6c11 100644 --- a/src/prepare.c +++ b/src/prepare.c @@ -13,7 +13,7 @@ ** interface, and routines that contribute to loading the database schema ** from disk. ** -** $Id: prepare.c,v 1.6 2005/12/09 14:25:08 danielk1977 Exp $ +** $Id: prepare.c,v 1.7 2005/12/09 20:02:05 drh Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -478,7 +478,6 @@ int sqlite3_prepare( } #endif -prepare_out: if( sqlite3SafetyOff(db) ){ rc = SQLITE_MISUSE; } diff --git a/src/printf.c b/src/printf.c index 539455a00a..8f1b2ac4bd 100644 --- a/src/printf.c +++ b/src/printf.c @@ -627,7 +627,7 @@ static int vxprintf( case etTOKEN: { Token *pToken = va_arg(ap, Token*); if( pToken && pToken->z ){ - (*func)(arg, pToken->z, pToken->n); + (*func)(arg, (char*)pToken->z, pToken->n); } length = width = 0; break; diff --git a/src/select.c b/src/select.c index b52fa2dfcb..40b1058099 100644 --- a/src/select.c +++ b/src/select.c @@ -12,7 +12,7 @@ ** This file contains C code routines that are called by the parser ** to handle SELECT statements in SQLite. ** -** $Id: select.c,v 1.281 2005/12/06 12:52:59 danielk1977 Exp $ +** $Id: select.c,v 1.282 2005/12/09 20:02:05 drh Exp $ */ #include "sqliteInt.h" @@ -109,7 +109,7 @@ int sqlite3JoinType(Parse *pParse, Token *pA, Token *pB, Token *pC){ p = apAll[i]; for(j=0; jn==keywords[j].nChar - && sqlite3StrNICmp(p->z, keywords[j].zKeyword, p->n)==0 ){ + && sqlite3StrNICmp((char*)p->z, keywords[j].zKeyword, p->n)==0 ){ jointype |= keywords[j].code; break; } @@ -154,7 +154,7 @@ static int columnIndex(Table *pTab, const char *zCol){ ** Set the value of a token to a '\000'-terminated string. */ static void setToken(Token *p, const char *z){ - p->z = z; + p->z = (u8*)z; p->n = z ? strlen(z) : 0; p->dyn = 0; } @@ -632,7 +632,7 @@ static KeyInfo *keyInfoFromExprList(Parse *pParse, ExprList *pList){ nExpr = pList->nExpr; pInfo = sqliteMalloc( sizeof(*pInfo) + nExpr*(sizeof(CollSeq*)+1) ); if( pInfo ){ - pInfo->aSortOrder = (char*)&pInfo->aColl[nExpr]; + pInfo->aSortOrder = (u8*)&pInfo->aColl[nExpr]; pInfo->nField = nExpr; pInfo->enc = db->enc; for(i=0, pItem=pList->a; iaCol[iCol].zName; } if( !shortNames && !fullNames && p->span.z && p->span.z[0] ){ - sqlite3VdbeSetColName(v, i, p->span.z, p->span.n); + sqlite3VdbeSetColName(v, i, (char*)p->span.z, p->span.n); }else if( fullNames || (!shortNames && pTabList->nSrc>1) ){ char *zName = 0; char *zTab; @@ -898,7 +898,7 @@ static void generateColumnNames( sqlite3VdbeSetColName(v, i, zCol, strlen(zCol)); } }else if( p->span.z && p->span.z[0] ){ - sqlite3VdbeSetColName(v, i, p->span.z, p->span.n); + sqlite3VdbeSetColName(v, i, (char*)p->span.z, p->span.n); /* sqlite3VdbeCompressSpace(v, addr); */ }else{ char zName[30]; @@ -2117,7 +2117,7 @@ static int flattenSubquery( for(i=0; inExpr; i++){ Expr *pExpr; if( pList->a[i].zName==0 && (pExpr = pList->a[i].pExpr)->span.z!=0 ){ - pList->a[i].zName = sqliteStrNDup(pExpr->span.z, pExpr->span.n); + pList->a[i].zName = sqliteStrNDup((char*)pExpr->span.z, pExpr->span.n); } } if( isAgg ){ @@ -2216,9 +2216,9 @@ static int simpleMinMaxQuery(Parse *pParse, Select *p, int eDest, int iParm){ pList = pExpr->pList; if( pList==0 || pList->nExpr!=1 ) return 0; if( pExpr->token.n!=3 ) return 0; - if( sqlite3StrNICmp(pExpr->token.z,"min",3)==0 ){ + if( sqlite3StrNICmp((char*)pExpr->token.z,"min",3)==0 ){ seekOp = OP_Rewind; - }else if( sqlite3StrNICmp(pExpr->token.z,"max",3)==0 ){ + }else if( sqlite3StrNICmp((char*)pExpr->token.z,"max",3)==0 ){ seekOp = OP_Last; }else{ return 0; diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 60cfbd482c..1eac934bdb 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -11,7 +11,7 @@ ************************************************************************* ** Internal interface definitions for SQLite. ** -** @(#) $Id: sqliteInt.h,v 1.432 2005/12/09 14:39:04 danielk1977 Exp $ +** @(#) $Id: sqliteInt.h,v 1.433 2005/12/09 20:02:06 drh Exp $ */ #ifndef _SQLITEINT_H_ #define _SQLITEINT_H_ @@ -1435,7 +1435,7 @@ void sqlite3SetString(char **, ...); void sqlite3ErrorMsg(Parse*, const char*, ...); void sqlite3Dequote(char*); void sqlite3DequoteExpr(Expr*); -int sqlite3KeywordCode(const char*, int); +int sqlite3KeywordCode(const unsigned char*, int); int sqlite3RunParser(Parse*, const char*, char **); void sqlite3FinishCoding(Parse*); Expr *sqlite3Expr(int, Expr*, Expr*, const Token*); diff --git a/src/tokenize.c b/src/tokenize.c index 45b12e4e78..b3294ef182 100644 --- a/src/tokenize.c +++ b/src/tokenize.c @@ -15,7 +15,7 @@ ** individual tokens and sends those tokens one-by-one over to the ** parser for analysis. ** -** $Id: tokenize.c,v 1.109 2005/12/06 12:53:00 danielk1977 Exp $ +** $Id: tokenize.c,v 1.110 2005/12/09 20:02:06 drh Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -360,7 +360,7 @@ int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzErrMsg){ pParse->zTail = pParse->zSql = zSql; while( sqlite3Tsd()->mallocFailed==0 && zSql[i]!=0 ){ assert( i>=0 ); - pParse->sLastToken.z = &zSql[i]; + pParse->sLastToken.z = (u8*)&zSql[i]; assert( pParse->sLastToken.dyn==0 ); pParse->sLastToken.n = getToken((unsigned char*)&zSql[i],&tokenType); i += pParse->sLastToken.n; diff --git a/src/trigger.c b/src/trigger.c index fc4f172ba9..afd88df553 100644 --- a/src/trigger.c +++ b/src/trigger.c @@ -237,7 +237,7 @@ void sqlite3FinishTrigger( addr = sqlite3VdbeAddOpList(v, ArraySize(insertTrig), insertTrig); sqlite3VdbeChangeP3(v, addr+2, pTrig->name, 0); sqlite3VdbeChangeP3(v, addr+3, pTrig->table, 0); - sqlite3VdbeChangeP3(v, addr+6, pAll->z, pAll->n); + sqlite3VdbeChangeP3(v, addr+6, (char*)pAll->z, pAll->n); sqlite3ChangeCookie(db, v, pTrig->iDb); sqlite3VdbeAddOp(v, OP_Close, 0, 0); sqlite3VdbeOp3(v, OP_ParseSchema, pTrig->iDb, 0, @@ -278,7 +278,7 @@ triggerfinish_cleanup: */ static void sqlitePersistTriggerStep(TriggerStep *p){ if( p->target.z ){ - p->target.z = sqliteStrNDup(p->target.z, p->target.n); + p->target.z = (u8*)sqliteStrNDup((char*)p->target.z, p->target.n); p->target.dyn = 1; } if( p->pSelect ){ @@ -623,8 +623,8 @@ static SrcList *targetSrcList( iDb = pStep->pTrig->iDb; if( iDb==0 || iDb>=2 ){ assert( iDbdb->nDb ); - sDb.z = pParse->db->aDb[iDb].zName; - sDb.n = strlen(sDb.z); + sDb.z = (u8*)pParse->db->aDb[iDb].zName; + sDb.n = strlen((char*)sDb.z); pSrc = sqlite3SrcListAppend(0, &sDb, &pStep->target); } else { pSrc = sqlite3SrcListAppend(0, &pStep->target, 0); diff --git a/src/utf.c b/src/utf.c index db6a89b6ed..f9c944f1ba 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.32 2005/01/28 01:29:08 drh Exp $ +** $Id: utf.c,v 1.33 2005/12/09 20:02:06 drh Exp $ ** ** Notes on UTF-8: ** @@ -272,7 +272,7 @@ int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){ assert( rc==SQLITE_NOMEM ); return SQLITE_NOMEM; } - zIn = pMem->z; + zIn = (u8*)pMem->z; zTerm = &zIn[pMem->n]; while( zInz; + zIn = (u8*)pMem->z; zTerm = &zIn[pMem->n]; if( len>NBFS ){ zOut = sqliteMallocRaw(len); @@ -360,12 +360,12 @@ int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){ pMem->enc = desiredEnc; if( zOut==zShort ){ memcpy(pMem->zShort, zOut, len); - zOut = pMem->zShort; + zOut = (u8*)pMem->zShort; pMem->flags |= (MEM_Term|MEM_Short); }else{ pMem->flags |= (MEM_Term|MEM_Dyn); } - pMem->z = zOut; + pMem->z = (char*)zOut; translate_out: #if defined(TRANSLATE_TRACE) && defined(SQLITE_DEBUG) diff --git a/src/vacuum.c b/src/vacuum.c index 8fe0550b3d..4f8e323188 100644 --- a/src/vacuum.c +++ b/src/vacuum.c @@ -14,7 +14,7 @@ ** Most of the code in this file may be omitted by defining the ** SQLITE_OMIT_VACUUM macro. ** -** $Id: vacuum.c,v 1.52 2005/12/09 14:25:09 danielk1977 Exp $ +** $Id: vacuum.c,v 1.53 2005/12/09 20:02:06 drh Exp $ */ #include "sqliteInt.h" #include "vdbeInt.h" @@ -59,7 +59,7 @@ static int execExecSql(sqlite3 *db, const char *zSql){ if( rc!=SQLITE_OK ) return rc; while( SQLITE_ROW==sqlite3_step(pStmt) ){ - rc = execSql(db, sqlite3_column_text(pStmt, 0)); + rc = execSql(db, (char*)sqlite3_column_text(pStmt, 0)); if( rc!=SQLITE_OK ){ sqlite3_finalize(pStmt); return rc; diff --git a/src/vdbe.c b/src/vdbe.c index b1de8d8d2f..5370531bda 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -43,7 +43,7 @@ ** in this file for details. If in doubt, do not deviate from existing ** commenting and indentation practices when changing or adding code. ** -** $Id: vdbe.c,v 1.503 2005/12/09 14:25:09 danielk1977 Exp $ +** $Id: vdbe.c,v 1.504 2005/12/09 20:02:06 drh Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -1885,7 +1885,7 @@ case OP_Column: { payloadSize = 0; }else if( pC->cacheValid ){ payloadSize = pC->payloadSize; - zRec = pC->aRow; + zRec = (char*)pC->aRow; }else if( pC->isIndex ){ i64 payloadSize64; sqlite3BtreeKeySize(pCrsr, &payloadSize64); @@ -1952,12 +1952,13 @@ case OP_Column: { ** the record. */ if( avail>=payloadSize ){ - zRec = pC->aRow = zData; + zRec = zData; + pC->aRow = (u8*)zData; }else{ pC->aRow = 0; } } - idx = sqlite3GetVarint32(zData, &szHdr); + idx = sqlite3GetVarint32((u8*)zData, &szHdr); /* The KeyFetch() or DataFetch() above are fast and will get the entire @@ -1984,7 +1985,7 @@ case OP_Column: { i = 0; while( idxenc = db->enc; }else{ if( pOp->p3type==P3_MEM ){ @@ -2198,7 +2199,7 @@ case OP_MakeRecord: { goto no_mem; } }else{ - zNewRecord = zTemp; + zNewRecord = (u8*)zTemp; } /* Write the record */ @@ -2232,7 +2233,7 @@ case OP_MakeRecord: { pTos->flags = MEM_Blob | MEM_Short; }else{ assert( zNewRecord!=(unsigned char *)zTemp ); - pTos->z = zNewRecord; + pTos->z = (char*)zNewRecord; pTos->flags = MEM_Blob | MEM_Dyn; pTos->xDel = 0; } @@ -2929,7 +2930,7 @@ case OP_IsUnique: { /* no-push */ zKey = pNos->z; nKey = pNos->n; - szRowid = sqlite3VdbeIdxRowidLen(nKey, zKey); + szRowid = sqlite3VdbeIdxRowidLen(nKey, (u8*)zKey); len = nKey-szRowid; /* Search for an entry in P1 where all but the last four bytes match K. @@ -2946,7 +2947,7 @@ case OP_IsUnique: { /* no-push */ break; } } - rc = sqlite3VdbeIdxKeyCompare(pCx, len, zKey, &res); + rc = sqlite3VdbeIdxKeyCompare(pCx, len, (u8*)zKey, &res); if( rc!=SQLITE_OK ) goto abort_due_to_error; if( res>0 ){ pc = pOp->p2 - 1; @@ -3722,7 +3723,7 @@ case OP_IdxGE: { /* no-push */ assert( pC->deferredMoveto==0 ); *pC->pIncrKey = pOp->p3!=0; assert( pOp->p3==0 || pOp->opcode!=OP_IdxGT ); - rc = sqlite3VdbeIdxKeyCompare(pC, pTos->n, pTos->z, &res); + rc = sqlite3VdbeIdxKeyCompare(pC, pTos->n, (u8*)pTos->z, &res); *pC->pIncrKey = 0; if( rc!=SQLITE_OK ){ break; @@ -3760,9 +3761,9 @@ case OP_IdxIsNull: { /* no-push */ assert( pTos->flags & MEM_Blob ); z = pTos->z; n = pTos->n; - k = sqlite3GetVarint32(z, &serial_type); + k = sqlite3GetVarint32((u8*)z, &serial_type); for(; k0; i--){ - k += sqlite3GetVarint32(&z[k], &serial_type); + k += sqlite3GetVarint32((u8*)&z[k], &serial_type); if( serial_type==0 ){ /* Serial type 0 is a NULL */ pc = pOp->p2-1; break; diff --git a/src/vdbeaux.c b/src/vdbeaux.c index 4c9cd0b93f..f435effa6b 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -1780,10 +1780,10 @@ int sqlite3VdbeIdxRowid(BtCursor *pCur, i64 *rowid){ if( rc ){ return rc; } - sqlite3GetVarint32(m.z, &szHdr); - sqlite3GetVarint32(&m.z[szHdr-1], &typeRowid); + sqlite3GetVarint32((u8*)m.z, &szHdr); + sqlite3GetVarint32((u8*)&m.z[szHdr-1], &typeRowid); lenRowid = sqlite3VdbeSerialTypeLen(typeRowid); - sqlite3VdbeSerialGet(&m.z[m.n-lenRowid], typeRowid, &v); + sqlite3VdbeSerialGet((u8*)&m.z[m.n-lenRowid], typeRowid, &v); *rowid = v.i; sqlite3VdbeMemRelease(&m); return SQLITE_OK; @@ -1819,7 +1819,7 @@ int sqlite3VdbeIdxKeyCompare( if( rc ){ return rc; } - lenRowid = sqlite3VdbeIdxRowidLen(m.n, m.z); + lenRowid = sqlite3VdbeIdxRowidLen(m.n, (u8*)m.z); *res = sqlite3VdbeRecordCompare(pC->pKeyInfo, m.n-lenRowid, m.z, nKey, pKey); sqlite3VdbeMemRelease(&m); return SQLITE_OK; diff --git a/src/vdbemem.c b/src/vdbemem.c index 31b0f3750a..7d9f8d2a84 100644 --- a/src/vdbemem.c +++ b/src/vdbemem.c @@ -83,7 +83,7 @@ int sqlite3VdbeMemDynamicify(Mem *pMem){ memcpy(z, pMem->z, n ); z[n] = 0; z[n+1] = 0; - pMem->z = z; + pMem->z = (char*)z; pMem->flags &= ~(MEM_Ephem|MEM_Static|MEM_Short); return SQLITE_OK; } @@ -103,7 +103,7 @@ int sqlite3VdbeMemMakeWriteable(Mem *pMem){ assert( (pMem->flags & MEM_Dyn)==0 ); assert( pMem->flags & (MEM_Str|MEM_Blob) ); if( (n = pMem->n)+2zShort) ){ - z = pMem->zShort; + z = (u8*)pMem->zShort; pMem->flags |= MEM_Short|MEM_Term; }else{ z = sqliteMallocRaw( n+2 ); @@ -116,7 +116,7 @@ int sqlite3VdbeMemMakeWriteable(Mem *pMem){ memcpy(z, pMem->z, n ); z[n] = 0; z[n+1] = 0; - pMem->z = z; + pMem->z = (char*)z; pMem->flags &= ~(MEM_Ephem|MEM_Static); return SQLITE_OK; } @@ -172,7 +172,7 @@ int sqlite3VdbeMemNulTerminate(Mem *pMem){ int sqlite3VdbeMemStringify(Mem *pMem, int enc){ int rc = SQLITE_OK; int fg = pMem->flags; - u8 *z = pMem->zShort; + char *z = pMem->zShort; assert( !(fg&(MEM_Str|MEM_Blob)) ); assert( fg&(MEM_Int|MEM_Real) ); @@ -799,7 +799,7 @@ int sqlite3ValueFromExpr( op = pExpr->op; if( op==TK_STRING || op==TK_FLOAT || op==TK_INTEGER ){ - zVal = sqliteStrNDup(pExpr->token.z, pExpr->token.n); + zVal = sqliteStrNDup((char*)pExpr->token.z, pExpr->token.n); pVal = sqlite3ValueNew(); if( !zVal || !pVal ) goto no_mem; sqlite3Dequote(zVal); @@ -819,7 +819,7 @@ int sqlite3ValueFromExpr( else if( op==TK_BLOB ){ int nVal; pVal = sqlite3ValueNew(); - zVal = sqliteStrNDup(pExpr->token.z+1, pExpr->token.n-1); + zVal = sqliteStrNDup((char*)pExpr->token.z+1, pExpr->token.n-1); if( !zVal || !pVal ) goto no_mem; sqlite3Dequote(zVal); nVal = strlen(zVal)/2; diff --git a/tool/mkkeywordhash.c b/tool/mkkeywordhash.c index c43a767a30..d2b11de5d0 100644 --- a/tool/mkkeywordhash.c +++ b/tool/mkkeywordhash.c @@ -495,8 +495,8 @@ int main(int argc, char **argv){ printf(" }\n"); printf(" return TK_ID;\n"); printf("}\n"); - printf("int sqlite3KeywordCode(const char *z, int n){\n"); - printf(" return keywordCode(z, n);\n"); + printf("int sqlite3KeywordCode(const unsigned char *z, int n){\n"); + printf(" return keywordCode((char*)z, n);\n"); printf("}\n"); return 0;