]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Use intptr_t definition to silence warnings about ptr-int casts (CVS 4824)
authormlcreech <mlcreech@noemail.net>
Thu, 6 Mar 2008 07:35:21 +0000 (07:35 +0000)
committermlcreech <mlcreech@noemail.net>
Thu, 6 Mar 2008 07:35:21 +0000 (07:35 +0000)
FossilOrigin-Name: 54839a84e6ce080ea8a0f6ce32acaa053d20f311

manifest
manifest.uuid
src/build.c
src/func.c
src/insert.c
src/table.c
src/vdbeaux.c
src/vdbemem.c
src/vtab.c

index c24f377582395b9a624cbb76c24647f096773531..ed2236afff36f37fc62d46003f0c223768e99f82 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Include\sinttypes.h\swhen\savailable,\sadd\ssupport\sfor\sintptr_t\s(CVS\s4823)
-D 2008-03-06T07:19:20
+C Use\sintptr_t\sdefinition\sto\ssilence\swarnings\sabout\sptr-int\scasts\s(CVS\s4824)
+D 2008-03-06T07:35:22
 F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7
 F Makefile.in 5a9dd0d69099728e0fca1a9cf2823226d276969a
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -87,7 +87,7 @@ F src/btmutex.c 483ced3c52205b04b97df69161fadbf87f4f1ea2
 F src/btree.c 439e2684892d2b70996dc3c5fba25e07949e1d84
 F src/btree.h 19dcf5ad23c17b98855da548e9a8e3eb4429d5eb
 F src/btreeInt.h d7d2f4d9d7f2e72c455326d48b2b478b842a81f6
-F src/build.c 7d93ee565b5676746d014acdc638adee87cfd27e
+F src/build.c 19990e2ce78806e854b5baaa18a77b540a476bbb
 F src/callback.c 77b302b0d41468dcda78c70e706e5b84577f0fa0
 F src/complete.c 4cf68fd75d60257524cbe74f87351b9848399131
 F src/date.c 187cad26eaaecd7bcdccd49d5a70c5aa3010bc74
@@ -95,10 +95,10 @@ F src/delete.c fa13c296262e89c32d28949f15be275e52d7f524
 F src/experimental.c 1b2d1a6cd62ecc39610e97670332ca073c50792b
 F src/expr.c e6fb42c6e55fd9526174b1cb8296b69a60a6688a
 F src/fault.c 049b88b8ba0a1db3240aeaf9695cd08b9a3ba9e1
-F src/func.c 194cd8a9549be77d7b2a93eeaeb8ede893277293
+F src/func.c 6d6d4817b4597d2bd08cbc525ba29164eae6c4bc
 F src/hash.c 53655c312280211444bfe23af6490a460aec2980
 F src/hash.h 031cd9f915aff27e12262cb9eb570ac1b8326b53
-F src/insert.c b313f5ecadf82dda15b1aa6780b0310eceb9e776
+F src/insert.c 6c64040d218506562c30925e8fb2d41fc71e646b
 F src/journal.c 807bed7a158979ac8d63953e1774e8d85bff65e2
 F src/legacy.c cb1939fdeb91ea88fb44fbd2768a10e14bc44650
 F src/limits.h 71ab25f17e35e0a9f3f6f234b8ed49cc56731d35
@@ -141,7 +141,7 @@ F src/sqlite.h.in b8158aa606f0b39426d63132ae0530d91c021abb
 F src/sqlite3ext.h 50c70a894ffe8e6ada5948c89b91db0a80a6b2a7
 F src/sqliteInt.h 65c6c06549ec8c4fb415075cff9c91d51f8e255a
 F src/sqliteLimit.h ee4430f88f69bf63527967bb35ca52af7b0ccb1e
-F src/table.c 46ccf9b7892a86f57420ae7bac69ecd5e72d26b5
+F src/table.c c688f2679d3b2221bc122afdc6771fa34813493d
 F src/tclsqlite.c d95e0e74c7167b2807f9f4f73bf45f7c58096297
 F src/test1.c c3d43a6bd299f3c115f6617af6715004819ca5cb
 F src/test2.c 355d5693ca3ee705548fa7f795592a37b2372b70
@@ -176,11 +176,11 @@ F src/vdbe.c a172f5134d19ae910134e28987bf7906523c9b6f
 F src/vdbe.h 58a7d931ffb704e034b2a725981cfa5bd406fad9
 F src/vdbeInt.h 76c81d057a39813de0fda3cad1498655d53ec69d
 F src/vdbeapi.c cf9fc963efae3cdf5de08e2a9718b487059c7fc5
-F src/vdbeaux.c 376b9926a43866f426e515cfa8f0ca77928e1830
+F src/vdbeaux.c e88a296bc64783efd4ea699fcac2f8cdbdc88a23
 F src/vdbeblob.c 63c750acc7b5012479f508c0e9627372a82cb65d
 F src/vdbefifo.c a30c237b2a3577e1415fb6e288cbb6b8ed1e5736
-F src/vdbemem.c 2d87d65430519dfb2103498b76bf15e4038b12b0
-F src/vtab.c dc8947c9c79780b19ee6d6bae4ea624a2a303353
+F src/vdbemem.c 7812a0fa480bada1c661da76783d59099a4e3bf3
+F src/vtab.c 641bafa5d8ca9448307f0e2a389844a5c7f86728
 F src/where.c c5eaca1f2d9caa20c5c7096434ccde2be03b325c
 F tclinstaller.tcl 4356d9d94d2b5ed5e68f9f0c80c4df3048dd7617
 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
@@ -621,7 +621,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
 F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P fc401ad9d1c62db136ad4a1c931381aff047e164
-R 6c7ca15f58a943c612be02c8759e844e
+P 88698fbdd5387b195e1c04c0c597f3c7458757c5
+R 319f02e97f65970946b1dcad66344da4
 U mlcreech
-Z 7deb171507d2ac8cc9e80e3fa4a75f4f
+Z 98d99414f33d762bf04af83dd32456ee
index 1412505a9f0e1125e3e2e21753fbc6f237e5d146..205ad7ec2d96bf89c2e831bb5e2bf0ed8e8b9b53 100644 (file)
@@ -1 +1 @@
-88698fbdd5387b195e1c04c0c597f3c7458757c5
\ No newline at end of file
+54839a84e6ce080ea8a0f6ce32acaa053d20f311
\ No newline at end of file
index 9c7d82cbc57ca7a98327f2a93dabdb4931d000b9..c825a283c3100f917dfceefb94f5379a768dda7c 100644 (file)
@@ -22,7 +22,7 @@
 **     COMMIT
 **     ROLLBACK
 **
-** $Id: build.c,v 1.472 2008/01/31 13:35:49 drh Exp $
+** $Id: build.c,v 1.473 2008/03/06 07:35:22 mlcreech Exp $
 */
 #include "sqliteInt.h"
 #include <ctype.h>
@@ -2283,7 +2283,7 @@ static void sqlite3RefillIndex(Parse *pParse, Index *pIndex, int memRootPage){
     regRowid = regIdxKey + pIndex->nColumn;
     j1 = sqlite3VdbeAddOp3(v, OP_IsNull, regIdxKey, 0, pIndex->nColumn);
     j2 = sqlite3VdbeAddOp4(v, OP_IsUnique, iIdx,
-                           0, regRowid, (char*)regRecord, P4_INT32);
+                           0, regRowid, (char*)(intptr_t)regRecord, P4_INT32);
     sqlite3VdbeAddOp4(v, OP_Halt, SQLITE_CONSTRAINT, OE_Abort, 0,
                     "indexed columns are not unique", P4_STATIC);
     sqlite3VdbeJumpHere(v, j1);
index 9a4591ad2e113da95617647c32166abf719fa61b..2c2a1d18945d265cadebc60f353d765c81258004 100644 (file)
@@ -16,7 +16,7 @@
 ** sqliteRegisterBuildinFunctions() found at the bottom of the file.
 ** All other code has file scope.
 **
-** $Id: func.c,v 1.184 2008/02/19 18:29:07 drh Exp $
+** $Id: func.c,v 1.185 2008/03/06 07:35:22 mlcreech Exp $
 */
 #include "sqliteInt.h"
 #include <ctype.h>
@@ -875,7 +875,7 @@ static void trimFunc(
   const unsigned char *zIn;         /* Input string */
   const unsigned char *zCharSet;    /* Set of characters to trim */
   int nIn;                          /* Number of bytes in input */
-  int flags;                        /* 1: trimleft  2: trimright  3: trim */
+  intptr_t flags;                   /* 1: trimleft  2: trimright  3: trim */
   int i;                            /* Loop counter */
   unsigned char *aLen;              /* Length of each character in zCharSet */
   unsigned char **azChar;           /* Individual characters in zCharSet */
@@ -916,7 +916,7 @@ static void trimFunc(
     }
   }
   if( nChar>0 ){
-    flags = (int)sqlite3_user_data(context);
+    flags = (intptr_t)sqlite3_user_data(context);
     if( flags & 1 ){
       while( nIn>0 ){
         int len;
@@ -1459,7 +1459,7 @@ void sqlite3RegisterBuiltinFunctions(sqlite3 *db){
     if( argType==0xff ){
       pArg = db;
     }else{
-      pArg = (void*)(int)argType;
+      pArg = (void*)(intptr_t)argType;
     }
     sqlite3CreateFunc(db, aFuncs[i].zName, aFuncs[i].nArg,
         aFuncs[i].eTextRep, pArg, aFuncs[i].xFunc, 0, 0);
@@ -1478,7 +1478,7 @@ void sqlite3RegisterBuiltinFunctions(sqlite3 *db){
   sqlite3AttachFunctions(db);
 #endif
   for(i=0; i<sizeof(aAggs)/sizeof(aAggs[0]); i++){
-    void *pArg = (void*)(int)aAggs[i].argType;
+    void *pArg = (void*)(intptr_t)aAggs[i].argType;
     sqlite3CreateFunc(db, aAggs[i].zName, aAggs[i].nArg, SQLITE_UTF8, 
         pArg, 0, aAggs[i].xStep, aAggs[i].xFinalize);
     if( aAggs[i].needCollSeq ){
index 9d1673b799a60fe6abc630e0e81d45a3e8e9ebd4..f3807c56eccffad17bd6150e027a06d5515b062c 100644 (file)
@@ -12,7 +12,7 @@
 ** This file contains C code routines that are called by the parser
 ** to handle INSERT statements in SQLite.
 **
-** $Id: insert.c,v 1.229 2008/02/13 18:25:27 danielk1977 Exp $
+** $Id: insert.c,v 1.230 2008/03/06 07:35:22 mlcreech Exp $
 */
 #include "sqliteInt.h"
 
@@ -1193,7 +1193,7 @@ void sqlite3GenerateConstraintChecks(
     regR = sqlite3GetTempReg(pParse);
     sqlite3VdbeAddOp2(v, OP_SCopy, regRowid-hasTwoRowids, regR);
     j3 = sqlite3VdbeAddOp4(v, OP_IsUnique, baseCur+iCur+1, 0,
-                           regR, (char*)aRegIdx[iCur], P4_INT32);
+                           regR, (char*)(intptr_t)aRegIdx[iCur], P4_INT32);
 
     /* Generate code that executes if the new index entry is not unique */
     assert( onError==OE_Rollback || onError==OE_Abort || onError==OE_Fail
index 88a96ee6fd31d200fd56f637426912dafe8bfb0d..42fb66f5fb4c8d6da70ce28108340be4c4fae235 100644 (file)
@@ -145,7 +145,7 @@ int sqlite3_get_table(
   res.azResult[0] = 0;
   rc = sqlite3_exec(db, zSql, sqlite3_get_table_cb, &res, pzErrMsg);
   assert( sizeof(res.azResult[0])>= sizeof(res.nData) );
-  res.azResult[0] = (char*)res.nData;
+  res.azResult[0] = (char*)(intptr_t)res.nData;
   if( (rc&0xff)==SQLITE_ABORT ){
     sqlite3_free_table(&res.azResult[1]);
     if( res.zErrMsg ){
@@ -187,10 +187,10 @@ void sqlite3_free_table(
   char **azResult            /* Result returned from from sqlite3_get_table() */
 ){
   if( azResult ){
-    int i, n;
+    intptr_t i, n;
     azResult--;
     assert( azResult!=0 );
-    n = (int)azResult[0];
+    n = (intptr_t)azResult[0];
     for(i=1; i<n; i++){ if( azResult[i] ) sqlite3_free(azResult[i]); }
     sqlite3_free(azResult);
   }
index ecfbf30f71f0f33351fee00535d8e80c588c7c5a..cd6f79367831695e98b3730e2c05bffc613089ac 100644 (file)
@@ -529,7 +529,9 @@ void sqlite3VdbeChangeP4(Vdbe *p, int addr, const char *zP4, int n){
   freeP4(pOp->p4type, pOp->p4.p);
   pOp->p4.p = 0;
   if( n==P4_INT32 ){
-    pOp->p4.i = (int)zP4;
+    /* Note: this cast is safe, because the origin data point was an int
+    ** that was cast to a (const char *). */
+    pOp->p4.i = (int)(intptr_t)zP4;
     pOp->p4type = n;
   }else if( zP4==0 ){
     pOp->p4.p = 0;
index 2d12256a82ab81801a275ff3bdea0a1ca5295189..3bbb04c2b0bda97646ae12ba5a0c0f44312debba 100644 (file)
@@ -922,7 +922,7 @@ const void *sqlite3ValueText(sqlite3_value* pVal, u8 enc){
   expandBlob(pVal);
   if( pVal->flags&MEM_Str ){
     sqlite3VdbeChangeEncoding(pVal, enc & ~SQLITE_UTF16_ALIGNED);
-    if( (enc & SQLITE_UTF16_ALIGNED)!=0 && 1==(1&(int)pVal->z) ){
+    if( (enc & SQLITE_UTF16_ALIGNED)!=0 && 1==(1&(intptr_t)pVal->z) ){
       assert( (pVal->flags & (MEM_Ephem|MEM_Static))!=0 );
       if( sqlite3VdbeMemMakeWriteable(pVal)!=SQLITE_OK ){
         return 0;
index 776f36ead8d5604db645205f9e877fa145a60ba7..c86e85a8df8ecb267b258d9eb9a17d1d337363cc 100644 (file)
@@ -11,7 +11,7 @@
 *************************************************************************
 ** This file contains code used to help implement virtual tables.
 **
-** $Id: vtab.c,v 1.63 2008/01/23 03:03:05 drh Exp $
+** $Id: vtab.c,v 1.64 2008/03/06 07:35:22 mlcreech Exp $
 */
 #ifndef SQLITE_OMIT_VIRTUALTABLE
 #include "sqliteInt.h"
@@ -611,7 +611,7 @@ int sqlite3VtabCallDestroy(sqlite3 *db, int iDb, const char *zTab)
 **
 ** The array is cleared after invoking the callbacks. 
 */
-static void callFinaliser(sqlite3 *db, int offset){
+static void callFinaliser(sqlite3 *db, intptr_t offset){
   int i;
   if( db->aVTrans ){
     for(i=0; i<db->nVTrans && db->aVTrans[i]; i++){
@@ -664,7 +664,7 @@ int sqlite3VtabSync(sqlite3 *db, int rc2){
 ** sqlite3.aVTrans array. Then clear the array itself.
 */
 int sqlite3VtabRollback(sqlite3 *db){
-  callFinaliser(db, (int)(&((sqlite3_module *)0)->xRollback));
+  callFinaliser(db, (intptr_t)(&((sqlite3_module *)0)->xRollback));
   return SQLITE_OK;
 }
 
@@ -673,7 +673,7 @@ int sqlite3VtabRollback(sqlite3 *db){
 ** sqlite3.aVTrans array. Then clear the array itself.
 */
 int sqlite3VtabCommit(sqlite3 *db){
-  callFinaliser(db, (int)(&((sqlite3_module *)0)->xCommit));
+  callFinaliser(db, (intptr_t)(&((sqlite3_module *)0)->xCommit));
   return SQLITE_OK;
 }