From: drh Date: Sun, 27 Apr 2008 18:40:11 +0000 (+0000) Subject: Remove all references to sqlite3_intptr_t. (CVS 5051) X-Git-Tag: version-3.6.10~1126 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7209c697a1d966bf26bd75d622ce0ce96a084665;p=thirdparty%2Fsqlite.git Remove all references to sqlite3_intptr_t. (CVS 5051) FossilOrigin-Name: 6a94d19747a05df2694d3720f76de3dab3836578 --- diff --git a/manifest b/manifest index a38444b046..58dccd98f8 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Use\s"(void)"\sfunction\sarguments\sin\sdeclarations\sinstead\sof\s"()".\s\sBoth\sare\nlegal\sbut\ssome\spedantic\scompilers\scomplain\sabout\sthe\slatter.\s\sTicket\s#3086.\s(CVS\s5050) -D 2008-04-26T13:39:47 +C Remove\sall\sreferences\sto\ssqlite3_intptr_t.\s(CVS\s5051) +D 2008-04-27T18:40:12 F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7 F Makefile.in 25b3282a4ac39388632c2fb0e044ff494d490952 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -89,17 +89,17 @@ F src/btmutex.c 483ced3c52205b04b97df69161fadbf87f4f1ea2 F src/btree.c 8b2294c64baeee6ae0519e1438c577fd601c02fb F src/btree.h 8826591bf54dd35fcf2e67473d5f1bae253861c7 F src/btreeInt.h dc04ee33d8eb84714b2acdf81336fbbf6e764530 -F src/build.c f56940d7b785cd2f9bcb7e5b6e17157f6feb9c4c +F src/build.c 8fd7fabaca0d0b307c7d2292c9501b5be13c6ff7 F src/callback.c 77b302b0d41468dcda78c70e706e5b84577f0fa0 F src/complete.c 4cf68fd75d60257524cbe74f87351b9848399131 F src/date.c e41ce4513fb0e359dc678d6bddb4ace135fe365d F src/delete.c e4bd53c46969c9fb05cfbba4abc0c93a923f8072 F src/expr.c 6a6f37005921314b1ae7c3ed4fab03c58fd5e647 F src/fault.c 83057e86815d473e526f7df0b0108dfdd022ff23 -F src/func.c c9e8c7ff4c45027edee89bde7adbf86a3a3b2afe +F src/func.c 77a910a1ca7613d291fd0b5cba3be14c02f0dce0 F src/hash.c 522a8f5a23cf18fe5845afee7263c5be76c25ca2 F src/hash.h 031cd9f915aff27e12262cb9eb570ac1b8326b53 -F src/insert.c 5208f16ddfc77d9e72bb30041a1d04a18b18a170 +F src/insert.c 9d59bf8eb43ce8399e6f818eaf1612a4c1dfeb2e F src/journal.c 807bed7a158979ac8d63953e1774e8d85bff65e2 F src/legacy.c 8267890e6a0a71f13b680794520999c642299081 F src/loadext.c 5c20a5afeb154e68d62ed6d9c634add1b21387fd @@ -134,9 +134,9 @@ F src/server.c 087b92a39d883e3fa113cae259d64e4c7438bc96 F src/shell.c be22ec05c8c4a43a95a6ad3b8068542200451e07 F src/sqlite.h.in 1064c85778f68f501ae91b46cd997084a31e0829 F src/sqlite3ext.h faacd0e6a81aabee0861c6d7883c9172e74ef5b3 -F src/sqliteInt.h 8b2cd9c4d74deb17a6c2f76970aca7e39d5628b2 +F src/sqliteInt.h 360bd20e5a16e0624db7e2d55d632fbad6f10e19 F src/sqliteLimit.h f435e728c6b620ef7312814d660a81f9356eb5c8 -F src/table.c 2c48c575dd59b3a6c5c306bc55f51a9402cf429a +F src/table.c 46ccf9b7892a86f57420ae7bac69ecd5e72d26b5 F src/tclsqlite.c 2877726bf32f7d72ff057b37ed6c93485b667ea1 F src/test1.c ab25cb2715a9e3f1d91cf99a7280ac7d8dd478e2 F src/test2.c f0808cc643528b9620e4059ca9bda8346f526121 @@ -173,11 +173,11 @@ F src/vdbe.c 2d75ac15ec69721340f0320e5b2fefbbd1aa2831 F src/vdbe.h bfd84bda447f39cb599302c7ec85067dae20453c F src/vdbeInt.h 05316345da487b0cf540482576f9ae3337d133cd F src/vdbeapi.c 0e1b5a808bb0e556f2a975eb7d11fd3153e922bf -F src/vdbeaux.c e742b6547bd2cf57db4ccdee8e3e326f6276a5de +F src/vdbeaux.c 7a0d0f021ebc54ae581a4f1ba833a2bee576228e F src/vdbeblob.c 554736781ee273a8089c776e96bdb53e66f57ce6 F src/vdbefifo.c a30c237b2a3577e1415fb6e288cbb6b8ed1e5736 -F src/vdbemem.c 237e61216381998ff71c6431e5e7bd03386f6225 -F src/vtab.c f5e78bf73df3b0c1b53861109c1b2e0800b108cc +F src/vdbemem.c e2450d6c798f35a30413a79c5fa9b1a24058629d +F src/vtab.c 13cd7f225c685a71aeba79c0ef521022913f185a F src/where.c 85719d58e0f680b5d8239dc6af82b159775d7376 F tclinstaller.tcl 4356d9d94d2b5ed5e68f9f0c80c4df3048dd7617 F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2 @@ -630,7 +630,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5 -P 7f80539225b17a62e4aa09e6d514e3e9e1b22c36 -R d59ff40ec9cfffd3c589ccc9ea8a1338 +P a4149ca317c2fd7ce87b8f23029c3f87a7f4c2e8 +R f54b4828ff50f00d8660564d13a96027 U drh -Z 250e76797f2e8fea8feb6705a1e7036b +Z 3fa96b4da5e32efdd6f210e98bf91fe8 diff --git a/manifest.uuid b/manifest.uuid index 56c981d130..717dfd73f6 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a4149ca317c2fd7ce87b8f23029c3f87a7f4c2e8 \ No newline at end of file +6a94d19747a05df2694d3720f76de3dab3836578 \ No newline at end of file diff --git a/src/build.c b/src/build.c index 65a667655e..770218f139 100644 --- a/src/build.c +++ b/src/build.c @@ -22,7 +22,7 @@ ** COMMIT ** ROLLBACK ** -** $Id: build.c,v 1.481 2008/04/17 20:59:38 drh Exp $ +** $Id: build.c,v 1.482 2008/04/27 18:40:12 drh Exp $ */ #include "sqliteInt.h" #include @@ -2293,7 +2293,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*)(sqlite3_intptr_t)regRecord, P4_INT32); + 0, regRowid, (char*)regRecord, P4_INT32); sqlite3VdbeAddOp4(v, OP_Halt, SQLITE_CONSTRAINT, OE_Abort, 0, "indexed columns are not unique", P4_STATIC); sqlite3VdbeJumpHere(v, j1); diff --git a/src/func.c b/src/func.c index 1c1bbd7e26..10c3baa31a 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.191 2008/03/20 16:30:18 drh Exp $ +** $Id: func.c,v 1.192 2008/04/27 18:40:12 drh Exp $ */ #include "sqliteInt.h" #include @@ -867,7 +867,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 */ - sqlite3_intptr_t flags; /* 1: trimleft 2: trimright 3: trim */ + int 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 */ @@ -908,7 +908,7 @@ static void trimFunc( } } if( nChar>0 ){ - flags = (sqlite3_intptr_t)sqlite3_user_data(context); + flags = (int)sqlite3_user_data(context); if( flags & 1 ){ while( nIn>0 ){ int len; @@ -1283,7 +1283,7 @@ void sqlite3RegisterBuiltinFunctions(sqlite3 *db){ for(i=0; i -#endif -#ifdef HAVE_INTTYPES_H -#include -#endif - -/* -** If possible, use the C99 intptr_t type to define an integral type of -** equivalent size to a pointer. (Technically it's >= sizeof(void *), but -** practically it's == sizeof(void *)). We fall back to an int if this type -** isn't defined. -*/ -#ifdef HAVE_INTPTR_T - typedef intptr_t sqlite3_intptr_t; -#else - typedef int sqlite3_intptr_t; -#endif - /* ** A macro used to aid in coverage testing. When doing coverage ** testing, the condition inside the argument must be evaluated diff --git a/src/table.c b/src/table.c index eac9168dd4..88a96ee6fd 100644 --- a/src/table.c +++ b/src/table.c @@ -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*)(sqlite3_intptr_t)res.nData; + res.azResult[0] = (char*)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 ){ - sqlite3_intptr_t i, n; + int i, n; azResult--; assert( azResult!=0 ); - n = (sqlite3_intptr_t)azResult[0]; + n = (int)azResult[0]; for(i=1; i @@ -536,7 +536,7 @@ void sqlite3VdbeChangeP4(Vdbe *p, int addr, const char *zP4, int n){ if( n==P4_INT32 ){ /* Note: this cast is safe, because the origin data point was an int ** that was cast to a (const char *). */ - pOp->p4.i = (int)(sqlite3_intptr_t)zP4; + pOp->p4.i = (int)zP4; pOp->p4type = n; }else if( zP4==0 ){ pOp->p4.p = 0; diff --git a/src/vdbemem.c b/src/vdbemem.c index 43ba67db07..f45f384263 100644 --- a/src/vdbemem.c +++ b/src/vdbemem.c @@ -893,7 +893,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&(sqlite3_intptr_t)pVal->z) ){ + if( (enc & SQLITE_UTF16_ALIGNED)!=0 && 1==(1&(int)pVal->z) ){ assert( (pVal->flags & (MEM_Ephem|MEM_Static))!=0 ); if( sqlite3VdbeMemMakeWriteable(pVal)!=SQLITE_OK ){ return 0; @@ -903,7 +903,7 @@ const void *sqlite3ValueText(sqlite3_value* pVal, u8 enc){ }else{ assert( (pVal->flags&MEM_Blob)==0 ); sqlite3VdbeMemStringify(pVal, enc); - assert( 0==(1&(sqlite3_intptr_t)pVal->z) ); + assert( 0==(1&(int)pVal->z) ); } assert(pVal->enc==(enc & ~SQLITE_UTF16_ALIGNED) || pVal->db==0 || pVal->db->mallocFailed ); diff --git a/src/vtab.c b/src/vtab.c index e3a9b8bb1d..281716262e 100644 --- a/src/vtab.c +++ b/src/vtab.c @@ -11,7 +11,7 @@ ************************************************************************* ** This file contains code used to help implement virtual tables. ** -** $Id: vtab.c,v 1.66 2008/04/10 18:35:22 drh Exp $ +** $Id: vtab.c,v 1.67 2008/04/27 18:40:12 drh Exp $ */ #ifndef SQLITE_OMIT_VIRTUALTABLE #include "sqliteInt.h" @@ -618,7 +618,7 @@ int sqlite3VtabCallDestroy(sqlite3 *db, int iDb, const char *zTab) ** ** The array is cleared after invoking the callbacks. */ -static void callFinaliser(sqlite3 *db, sqlite3_intptr_t offset){ +static void callFinaliser(sqlite3 *db, int offset){ int i; if( db->aVTrans ){ for(i=0; inVTrans && db->aVTrans[i]; i++){ @@ -671,7 +671,7 @@ int sqlite3VtabSync(sqlite3 *db, int rc2){ ** sqlite3.aVTrans array. Then clear the array itself. */ int sqlite3VtabRollback(sqlite3 *db){ - callFinaliser(db, (sqlite3_intptr_t)(&((sqlite3_module *)0)->xRollback)); + callFinaliser(db, offsetof(sqlite3_module,xRollback)); return SQLITE_OK; } @@ -680,7 +680,7 @@ int sqlite3VtabRollback(sqlite3 *db){ ** sqlite3.aVTrans array. Then clear the array itself. */ int sqlite3VtabCommit(sqlite3 *db){ - callFinaliser(db, (sqlite3_intptr_t)(&((sqlite3_module *)0)->xCommit)); + callFinaliser(db, offsetof(sqlite3_module,xCommit)); return SQLITE_OK; }