From: dan Date: Thu, 18 Sep 2014 15:57:22 +0000 (+0000) Subject: Remove some c++isms from sqlite3ota.c. X-Git-Tag: version-3.8.11~252^2~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=318e63c60bf87eceda3addac21baae4138ed79c2;p=thirdparty%2Fsqlite.git Remove some c++isms from sqlite3ota.c. FossilOrigin-Name: 0da1862b1b68f15c7c14286a982dda886d1e3b4a --- diff --git a/ext/ota/sqlite3ota.c b/ext/ota/sqlite3ota.c index 8d5a5bf761..34f5e3db6e 100644 --- a/ext/ota/sqlite3ota.c +++ b/ext/ota/sqlite3ota.c @@ -40,7 +40,6 @@ typedef struct OtaState OtaState; typedef struct OtaObjIter OtaObjIter; -typedef unsigned char u8; /* ** A structure to store values read from the ota_state table in memory. @@ -66,7 +65,7 @@ struct OtaObjIter { sqlite3_stmt *pIdxIter; /* Index iterator */ int nTblCol; /* Size of azTblCol[] array */ char **azTblCol; /* Array of quoted column names */ - u8 *abTblPk; /* Array of flags - true for PK columns */ + unsigned char *abTblPk; /* Array of flags - true for PK columns */ /* Output variables. zTbl==0 implies EOF. */ int bCleanup; /* True in "cleanup" state */ @@ -372,9 +371,10 @@ static int otaObjIterGetCols(sqlite3ota *p, OtaObjIter *pIter){ p->rc = prepareFreeAndCollectError(p->db, &pStmt, &p->zErrmsg, zSql); while( p->rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pStmt) ){ if( (nCol % 8)==0 ){ + unsigned char *abNew; int nByte = sizeof(char*) * (nCol+8); char **azNew = (char**)sqlite3_realloc(pIter->azTblCol, nByte); - u8 *abNew = (u8*)sqlite3_realloc(pIter->abTblPk, nCol+8); + abNew = (unsigned char*)sqlite3_realloc(pIter->abTblPk, nCol+8); if( azNew ) pIter->azTblCol = azNew; if( abNew ) pIter->abTblPk = abNew; @@ -834,10 +834,11 @@ static int otaStep(sqlite3ota *p){ } for(i=0; inCol; i++){ + sqlite3_value *pVal; if( eType==SQLITE_DELETE && pIter->zIdx==0 && pIter->abTblPk[i]==0 ){ continue; } - sqlite3_value *pVal = sqlite3_column_value(pIter->pSelect, i); + pVal = sqlite3_column_value(pIter->pSelect, i); sqlite3_bind_value(pWriter, i+1, pVal); } sqlite3_step(pWriter); @@ -874,7 +875,7 @@ int sqlite3ota_step(sqlite3ota *p){ /* Clean up the ota_tmp_xxx table for the previous table. It ** cannot be dropped as there are currently active SQL statements. ** But the contents can be deleted. */ - // otaMPrintfExec(p, "DELETE FROM ota.'ota_tmp_%q'", pIter->zTbl); + otaMPrintfExec(p, "DELETE FROM ota.'ota_tmp_%q'", pIter->zTbl); }else{ otaObjIterPrepareAll(p, pIter, 0); diff --git a/manifest b/manifest index ebff66aeaf..b30b820cb2 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\snew\sfile\sext/ota/README.txt,\scontaining\snotes\sregarding\sthe\simplementation\sof\sthe\sota\sextension. -D 2014-09-18T15:22:48.861 +C Remove\ssome\sc++isms\sfrom\ssqlite3ota.c. +D 2014-09-18T15:57:22.238 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in cf57f673d77606ab0f2d9627ca52a9ba1464146a F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -127,7 +127,7 @@ F ext/ota/ota1.test 7cbf37a9f6cd29320f47b041cfeb0cc1d7eaa916 F ext/ota/ota2.test 716f9c66e8bf8b0ad2fe3a5d8323e6cf460a2e27 F ext/ota/ota3.test 1c48b7476af1c5920db9a43e7b1476d421a463b5 F ext/ota/ota4.test baf23b47748a5056c713871959cc70fc623c90e9 -F ext/ota/sqlite3ota.c e5dfb63ac4564139b66acf6f712d6d1bb5007b26 +F ext/ota/sqlite3ota.c 4b7f15662e725bd79c92242293336d74ebeff854 F ext/ota/sqlite3ota.h 4f9d8c56c673f279167ddc57e8f84c0c406346f0 F ext/rtree/README 6315c0d73ebf0ec40dedb5aa0e942bc8b54e3761 F ext/rtree/rtree.c 57bec53e1a677ab74217fe1f20a58c3a47261d6b @@ -1206,7 +1206,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P e3943fa7bbbfc5e16f73a494d8fa54d19e9cfcf9 -R fb02b3fe38b193b1aa6184b0012599dc +P 3c6e1cbb4baaebc5958ab7276f27ff0ba14f4fa2 +R 144b17f95f9943a0f5b2a1840d65f3bd U dan -Z 4cd279ef72288cc868c417c33c545f0f +Z 850176a0d2bd1d95bab64ffe8e2adfdc diff --git a/manifest.uuid b/manifest.uuid index d10a6c3486..075b7ba304 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3c6e1cbb4baaebc5958ab7276f27ff0ba14f4fa2 \ No newline at end of file +0da1862b1b68f15c7c14286a982dda886d1e3b4a \ No newline at end of file