Make sqllite3 compile use CCOMFLAGS as well (nw)

This commit is contained in:
Miodrag Milanovic 2015-02-19 15:52:12 +01:00
parent aed606ca14
commit ea92b89a38
2 changed files with 45 additions and 45 deletions

View File

@ -10856,25 +10856,25 @@ struct FuncDestructor {
*/ */
#define FUNCTION(zName, nArg, iArg, bNC, xFunc) \ #define FUNCTION(zName, nArg, iArg, bNC, xFunc) \
{nArg, SQLITE_FUNC_CONSTANT|SQLITE_UTF8|(bNC*SQLITE_FUNC_NEEDCOLL), \ {nArg, SQLITE_FUNC_CONSTANT|SQLITE_UTF8|(bNC*SQLITE_FUNC_NEEDCOLL), \
SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, #zName, 0, 0} SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, (char*)#zName, 0, 0}
#define VFUNCTION(zName, nArg, iArg, bNC, xFunc) \ #define VFUNCTION(zName, nArg, iArg, bNC, xFunc) \
{nArg, SQLITE_UTF8|(bNC*SQLITE_FUNC_NEEDCOLL), \ {nArg, SQLITE_UTF8|(bNC*SQLITE_FUNC_NEEDCOLL), \
SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, #zName, 0, 0} SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, (char*)#zName, 0, 0}
#define FUNCTION2(zName, nArg, iArg, bNC, xFunc, extraFlags) \ #define FUNCTION2(zName, nArg, iArg, bNC, xFunc, extraFlags) \
{nArg,SQLITE_FUNC_CONSTANT|SQLITE_UTF8|(bNC*SQLITE_FUNC_NEEDCOLL)|extraFlags,\ {nArg,SQLITE_FUNC_CONSTANT|SQLITE_UTF8|(bNC*SQLITE_FUNC_NEEDCOLL)|extraFlags,\
SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, #zName, 0, 0} SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, (char*)#zName, 0, 0}
#define STR_FUNCTION(zName, nArg, pArg, bNC, xFunc) \ #define STR_FUNCTION(zName, nArg, pArg, bNC, xFunc) \
{nArg, SQLITE_FUNC_CONSTANT|SQLITE_UTF8|(bNC*SQLITE_FUNC_NEEDCOLL), \ {nArg, SQLITE_FUNC_CONSTANT|SQLITE_UTF8|(bNC*SQLITE_FUNC_NEEDCOLL), \
pArg, 0, xFunc, 0, 0, #zName, 0, 0} pArg, 0, xFunc, 0, 0, (char*)#zName, 0, 0}
#define LIKEFUNC(zName, nArg, arg, flags) \ #define LIKEFUNC(zName, nArg, arg, flags) \
{nArg, SQLITE_FUNC_CONSTANT|SQLITE_UTF8|flags, \ {nArg, SQLITE_FUNC_CONSTANT|SQLITE_UTF8|flags, \
(void *)arg, 0, likeFunc, 0, 0, #zName, 0, 0} (void *)arg, 0, likeFunc, 0, 0, (char*)#zName, 0, 0}
#define AGGREGATE(zName, nArg, arg, nc, xStep, xFinal) \ #define AGGREGATE(zName, nArg, arg, nc, xStep, xFinal) \
{nArg, SQLITE_UTF8|(nc*SQLITE_FUNC_NEEDCOLL), \ {nArg, SQLITE_UTF8|(nc*SQLITE_FUNC_NEEDCOLL), \
SQLITE_INT_TO_PTR(arg), 0, 0, xStep,xFinal,#zName,0,0} SQLITE_INT_TO_PTR(arg), 0, 0, xStep,xFinal,(char*)#zName,0,0}
#define AGGREGATE2(zName, nArg, arg, nc, xStep, xFinal, extraFlags) \ #define AGGREGATE2(zName, nArg, arg, nc, xStep, xFinal, extraFlags) \
{nArg, SQLITE_UTF8|(nc*SQLITE_FUNC_NEEDCOLL)|extraFlags, \ {nArg, SQLITE_UTF8|(nc*SQLITE_FUNC_NEEDCOLL)|extraFlags, \
SQLITE_INT_TO_PTR(arg), 0, 0, xStep,xFinal,#zName,0,0} SQLITE_INT_TO_PTR(arg), 0, 0, xStep,xFinal,(char*)#zName,0,0}
/* /*
** All current savepoints are stored in a linked list starting at ** All current savepoints are stored in a linked list starting at
@ -21202,7 +21202,7 @@ SQLITE_PRIVATE void sqlite3VXPrintf(
/* Normalize realvalue to within 10.0 > realvalue >= 1.0 */ /* Normalize realvalue to within 10.0 > realvalue >= 1.0 */
exp = 0; exp = 0;
if( sqlite3IsNaN((double)realvalue) ){ if( sqlite3IsNaN((double)realvalue) ){
bufpt = "NaN"; bufpt = (char *)"NaN";
length = 3; length = 3;
break; break;
} }
@ -21217,11 +21217,11 @@ SQLITE_PRIVATE void sqlite3VXPrintf(
while( realvalue<1.0 ){ realvalue *= 10.0; exp--; } while( realvalue<1.0 ){ realvalue *= 10.0; exp--; }
if( exp>350 ){ if( exp>350 ){
if( prefix=='-' ){ if( prefix=='-' ){
bufpt = "-Inf"; bufpt = (char *)"-Inf";
}else if( prefix=='+' ){ }else if( prefix=='+' ){
bufpt = "+Inf"; bufpt =(char *) "+Inf";
}else{ }else{
bufpt = "Inf"; bufpt = (char *)"Inf";
} }
length = sqlite3Strlen30(bufpt); length = sqlite3Strlen30(bufpt);
break; break;
@ -21375,7 +21375,7 @@ SQLITE_PRIVATE void sqlite3VXPrintf(
bufpt = va_arg(ap,char*); bufpt = va_arg(ap,char*);
} }
if( bufpt==0 ){ if( bufpt==0 ){
bufpt = ""; bufpt = (char *)"";
}else if( xtype==etDYNSTRING && !bArgList ){ }else if( xtype==etDYNSTRING && !bArgList ){
zExtra = bufpt; zExtra = bufpt;
} }
@ -21400,7 +21400,7 @@ SQLITE_PRIVATE void sqlite3VXPrintf(
escarg = va_arg(ap,char*); escarg = va_arg(ap,char*);
} }
isnull = escarg==0; isnull = escarg==0;
if( isnull ) escarg = (xtype==etSQLESCAPE2 ? "NULL" : "(NULL)"); if( isnull ) escarg = (char *)(xtype==etSQLESCAPE2 ? "NULL" : "(NULL)");
k = precision; k = precision;
for(i=n=0; k!=0 && (ch=escarg[i])!=0; i++, k--){ for(i=n=0; k!=0 && (ch=escarg[i])!=0; i++, k--){
if( ch==q ) n++; if( ch==q ) n++;
@ -64312,7 +64312,7 @@ static char *displayP4(Op *pOp, char *zTemp, int nTemp){
sqlite3_snprintf(nTemp, zTemp, "NULL"); sqlite3_snprintf(nTemp, zTemp, "NULL");
}else{ }else{
assert( pMem->flags & MEM_Blob ); assert( pMem->flags & MEM_Blob );
zP4 = "(blob)"; zP4 = (char *)"(blob)";
} }
break; break;
} }
@ -86311,7 +86311,7 @@ static const FuncDef statInitFuncdef = {
statInit, /* xFunc */ statInit, /* xFunc */
0, /* xStep */ 0, /* xStep */
0, /* xFinalize */ 0, /* xFinalize */
"stat_init", /* zName */ (char*)"stat_init", /* zName */
0, /* pHash */ 0, /* pHash */
0 /* pDestructor */ 0 /* pDestructor */
}; };
@ -86612,7 +86612,7 @@ static const FuncDef statPushFuncdef = {
statPush, /* xFunc */ statPush, /* xFunc */
0, /* xStep */ 0, /* xStep */
0, /* xFinalize */ 0, /* xFinalize */
"stat_push", /* zName */ (char*)"stat_push", /* zName */
0, /* pHash */ 0, /* pHash */
0 /* pDestructor */ 0 /* pDestructor */
}; };
@ -86759,7 +86759,7 @@ static const FuncDef statGetFuncdef = {
statGet, /* xFunc */ statGet, /* xFunc */
0, /* xStep */ 0, /* xStep */
0, /* xFinalize */ 0, /* xFinalize */
"stat_get", /* zName */ (char*)"stat_get", /* zName */
0, /* pHash */ 0, /* pHash */
0 /* pDestructor */ 0 /* pDestructor */
}; };
@ -88105,7 +88105,7 @@ SQLITE_PRIVATE void sqlite3Detach(Parse *pParse, Expr *pDbname){
detachFunc, /* xFunc */ detachFunc, /* xFunc */
0, /* xStep */ 0, /* xStep */
0, /* xFinalize */ 0, /* xFinalize */
"sqlite_detach", /* zName */ (char*)"sqlite_detach", /* zName */
0, /* pHash */ 0, /* pHash */
0 /* pDestructor */ 0 /* pDestructor */
}; };
@ -88126,7 +88126,7 @@ SQLITE_PRIVATE void sqlite3Attach(Parse *pParse, Expr *p, Expr *pDbname, Expr *p
attachFunc, /* xFunc */ attachFunc, /* xFunc */
0, /* xStep */ 0, /* xStep */
0, /* xFinalize */ 0, /* xFinalize */
"sqlite_attach", /* zName */ (char*)"sqlite_attach", /* zName */
0, /* pHash */ 0, /* pHash */
0 /* pDestructor */ 0 /* pDestructor */
}; };
@ -90082,7 +90082,7 @@ static void identPut(char *z, int *pIdx, char *zSignedIdent){
static char *createTableStmt(sqlite3 *db, Table *p){ static char *createTableStmt(sqlite3 *db, Table *p){
int i, k, n; int i, k, n;
char *zStmt; char *zStmt;
char *zSep, *zSep2, *zEnd; const char *zSep, *zSep2, *zEnd;
Column *pCol; Column *pCol;
n = 0; n = 0;
for(pCol = p->aCol, i=0; i<p->nCol; i++, pCol++){ for(pCol = p->aCol, i=0; i<p->nCol; i++, pCol++){
@ -90317,7 +90317,7 @@ static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){
if( !hasColumn(pPk->aiColumn, j, i) ){ if( !hasColumn(pPk->aiColumn, j, i) ){
assert( j<pPk->nColumn ); assert( j<pPk->nColumn );
pPk->aiColumn[j] = i; pPk->aiColumn[j] = i;
pPk->azColl[j] = "BINARY"; pPk->azColl[j] = (char *)"BINARY";
j++; j++;
} }
} }
@ -90418,8 +90418,8 @@ SQLITE_PRIVATE void sqlite3EndTable(
if( !db->init.busy ){ if( !db->init.busy ){
int n; int n;
Vdbe *v; Vdbe *v;
char *zType; /* "view" or "table" */ const char *zType; /* "view" or "table" */
char *zType2; /* "VIEW" or "TABLE" */ const char *zType2; /* "VIEW" or "TABLE" */
char *zStmt; /* Text of the CREATE TABLE or CREATE VIEW statement */ char *zStmt; /* Text of the CREATE TABLE or CREATE VIEW statement */
v = sqlite3GetVdbe(pParse); v = sqlite3GetVdbe(pParse);
@ -91642,7 +91642,7 @@ SQLITE_PRIVATE Index *sqlite3CreateIndex(
nExtra -= nColl; nExtra -= nColl;
}else{ }else{
zColl = pTab->aCol[j].zColl; zColl = pTab->aCol[j].zColl;
if( !zColl ) zColl = "BINARY"; if( !zColl ) zColl = (char *)"BINARY";
} }
if( !db->init.busy && !sqlite3LocateCollSeq(pParse, zColl) ){ if( !db->init.busy && !sqlite3LocateCollSeq(pParse, zColl) ){
goto exit_create_index; goto exit_create_index;
@ -91667,7 +91667,7 @@ SQLITE_PRIVATE Index *sqlite3CreateIndex(
assert( i==pIndex->nColumn ); assert( i==pIndex->nColumn );
}else{ }else{
pIndex->aiColumn[i] = -1; pIndex->aiColumn[i] = -1;
pIndex->azColl[i] = "BINARY"; pIndex->azColl[i] = (char *)"BINARY";
} }
sqlite3DefaultRowEst(pIndex); sqlite3DefaultRowEst(pIndex);
if( pParse->pNewTable==0 ) estimateIndexWidth(pIndex); if( pParse->pNewTable==0 ) estimateIndexWidth(pIndex);
@ -96219,7 +96219,7 @@ SQLITE_PRIVATE int sqlite3FkLocateIndex(
** unusable. Bail out early in this case. */ ** unusable. Bail out early in this case. */
zDfltColl = pParent->aCol[iCol].zColl; zDfltColl = pParent->aCol[iCol].zColl;
if( !zDfltColl ){ if( !zDfltColl ){
zDfltColl = "BINARY"; zDfltColl = (char *)"BINARY";
} }
if( sqlite3StrICmp(pIdx->azColl[i], zDfltColl) ) break; if( sqlite3StrICmp(pIdx->azColl[i], zDfltColl) ) break;
@ -101462,7 +101462,7 @@ static const char *actionName(u8 action){
** journal-mode name. ** journal-mode name.
*/ */
SQLITE_PRIVATE const char *sqlite3JournalModename(int eMode){ SQLITE_PRIVATE const char *sqlite3JournalModename(int eMode){
static char * const azModeName[] = { static const char * azModeName[] = {
"delete", "persist", "off", "truncate", "memory" "delete", "persist", "off", "truncate", "memory"
#ifndef SQLITE_OMIT_WAL #ifndef SQLITE_OMIT_WAL
, "wal" , "wal"
@ -102832,7 +102832,7 @@ SQLITE_PRIVATE void sqlite3Pragma(
*/ */
case PragTyp_ENCODING: { case PragTyp_ENCODING: {
static const struct EncName { static const struct EncName {
char *zName; const char *zName;
u8 enc; u8 enc;
} encnames[] = { } encnames[] = {
{ "UTF8", SQLITE_UTF8 }, { "UTF8", SQLITE_UTF8 },
@ -105140,7 +105140,7 @@ static KeyInfo *keyInfoFromExprList(
** Name of the connection operator, used for error messages. ** Name of the connection operator, used for error messages.
*/ */
static const char *selectOpName(int id){ static const char *selectOpName(int id){
char *z; const char *z;
switch( id ){ switch( id ){
case TK_ALL: z = "UNION ALL"; break; case TK_ALL: z = "UNION ALL"; break;
case TK_INTERSECT: z = "INTERSECT"; break; case TK_INTERSECT: z = "INTERSECT"; break;
@ -105607,7 +105607,7 @@ static void generateColumnNames(
if( iCol<0 ) iCol = pTab->iPKey; if( iCol<0 ) iCol = pTab->iPKey;
assert( iCol==-1 || (iCol>=0 && iCol<pTab->nCol) ); assert( iCol==-1 || (iCol>=0 && iCol<pTab->nCol) );
if( iCol<0 ){ if( iCol<0 ){
zCol = "rowid"; zCol = (char*)"rowid";
}else{ }else{
zCol = pTab->aCol[iCol].zName; zCol = pTab->aCol[iCol].zName;
} }
@ -111848,9 +111848,9 @@ SQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db){
*/ */
nDb = db->nDb; nDb = db->nDb;
if( sqlite3TempInMemory(db) ){ if( sqlite3TempInMemory(db) ){
zSql = "ATTACH ':memory:' AS vacuum_db;"; zSql = (char*)"ATTACH ':memory:' AS vacuum_db;";
}else{ }else{
zSql = "ATTACH '' AS vacuum_db;"; zSql = (char*)"ATTACH '' AS vacuum_db;";
} }
rc = execSql(db, pzErrMsg, zSql); rc = execSql(db, pzErrMsg, zSql);
if( db->nDb>nDb ){ if( db->nDb>nDb ){
@ -115270,7 +115270,7 @@ static void constructAutomaticIndex(
pIdx = sqlite3AllocateIndexObject(pParse->db, nKeyCol+1, 0, &zNotUsed); pIdx = sqlite3AllocateIndexObject(pParse->db, nKeyCol+1, 0, &zNotUsed);
if( pIdx==0 ) return; if( pIdx==0 ) return;
pLoop->u.btree.pIndex = pIdx; pLoop->u.btree.pIndex = pIdx;
pIdx->zName = "auto-index"; pIdx->zName = (char*)"auto-index";
pIdx->pTable = pTable; pIdx->pTable = pTable;
n = 0; n = 0;
idxCols = 0; idxCols = 0;
@ -115285,7 +115285,7 @@ static void constructAutomaticIndex(
idxCols |= cMask; idxCols |= cMask;
pIdx->aiColumn[n] = pTerm->u.leftColumn; pIdx->aiColumn[n] = pTerm->u.leftColumn;
pColl = sqlite3BinaryCompareCollSeq(pParse, pX->pLeft, pX->pRight); pColl = sqlite3BinaryCompareCollSeq(pParse, pX->pLeft, pX->pRight);
pIdx->azColl[n] = ALWAYS(pColl) ? pColl->zName : "BINARY"; pIdx->azColl[n] = ALWAYS(pColl) ? pColl->zName : (char*)"BINARY";
n++; n++;
} }
} }
@ -115297,20 +115297,20 @@ static void constructAutomaticIndex(
for(i=0; i<mxBitCol; i++){ for(i=0; i<mxBitCol; i++){
if( extraCols & MASKBIT(i) ){ if( extraCols & MASKBIT(i) ){
pIdx->aiColumn[n] = i; pIdx->aiColumn[n] = i;
pIdx->azColl[n] = "BINARY"; pIdx->azColl[n] = (char*)"BINARY";
n++; n++;
} }
} }
if( pSrc->colUsed & MASKBIT(BMS-1) ){ if( pSrc->colUsed & MASKBIT(BMS-1) ){
for(i=BMS-1; i<pTable->nCol; i++){ for(i=BMS-1; i<pTable->nCol; i++){
pIdx->aiColumn[n] = i; pIdx->aiColumn[n] = i;
pIdx->azColl[n] = "BINARY"; pIdx->azColl[n] = (char*)"BINARY";
n++; n++;
} }
} }
assert( n==nKeyCol ); assert( n==nKeyCol );
pIdx->aiColumn[n] = -1; pIdx->aiColumn[n] = -1;
pIdx->azColl[n] = "BINARY"; pIdx->azColl[n] = (char*)"BINARY";
/* Create the automatic index */ /* Create the automatic index */
assert( pLevel->iIdxCur>=0 ); assert( pLevel->iIdxCur>=0 );
@ -116377,7 +116377,7 @@ static void explainIndexRange(StrAccum *pStr, WhereLoop *pLoop, Table *pTab){
if( nEq==0 && (pLoop->wsFlags&(WHERE_BTM_LIMIT|WHERE_TOP_LIMIT))==0 ) return; if( nEq==0 && (pLoop->wsFlags&(WHERE_BTM_LIMIT|WHERE_TOP_LIMIT))==0 ) return;
sqlite3StrAccumAppend(pStr, " (", 2); sqlite3StrAccumAppend(pStr, " (", 2);
for(i=0; i<nEq; i++){ for(i=0; i<nEq; i++){
char *z = aiColumn[i] < 0 ? "rowid" : aCol[aiColumn[i]].zName; char *z = aiColumn[i] < 0 ? (char*)"rowid" : aCol[aiColumn[i]].zName;
if( i>=nSkip ){ if( i>=nSkip ){
explainAppendTerm(pStr, i, z, "="); explainAppendTerm(pStr, i, z, "=");
}else{ }else{
@ -116388,11 +116388,11 @@ static void explainIndexRange(StrAccum *pStr, WhereLoop *pLoop, Table *pTab){
j = i; j = i;
if( pLoop->wsFlags&WHERE_BTM_LIMIT ){ if( pLoop->wsFlags&WHERE_BTM_LIMIT ){
char *z = aiColumn[j] < 0 ? "rowid" : aCol[aiColumn[j]].zName; char *z = aiColumn[j] < 0 ? (char*)"rowid" : aCol[aiColumn[j]].zName;
explainAppendTerm(pStr, i++, z, ">"); explainAppendTerm(pStr, i++, z, ">");
} }
if( pLoop->wsFlags&WHERE_TOP_LIMIT ){ if( pLoop->wsFlags&WHERE_TOP_LIMIT ){
char *z = aiColumn[j] < 0 ? "rowid" : aCol[aiColumn[j]].zName; char *z = aiColumn[j] < 0 ? (char*)"rowid" : aCol[aiColumn[j]].zName;
explainAppendTerm(pStr, i, z, "<"); explainAppendTerm(pStr, i, z, "<");
} }
sqlite3StrAccumAppend(pStr, ")", 1); sqlite3StrAccumAppend(pStr, ")", 1);
@ -127315,7 +127315,7 @@ SQLITE_PRIVATE int sqlite3ParseUri(
mask = SQLITE_OPEN_SHAREDCACHE|SQLITE_OPEN_PRIVATECACHE; mask = SQLITE_OPEN_SHAREDCACHE|SQLITE_OPEN_PRIVATECACHE;
aMode = aCacheMode; aMode = aCacheMode;
limit = mask; limit = mask;
zModeType = "cache"; zModeType = (char*)"cache";
} }
if( nOpt==4 && memcmp("mode", zOpt, 4)==0 ){ if( nOpt==4 && memcmp("mode", zOpt, 4)==0 ){
static struct OpenMode aOpenMode[] = { static struct OpenMode aOpenMode[] = {
@ -127330,7 +127330,7 @@ SQLITE_PRIVATE int sqlite3ParseUri(
| SQLITE_OPEN_CREATE | SQLITE_OPEN_MEMORY; | SQLITE_OPEN_CREATE | SQLITE_OPEN_MEMORY;
aMode = aOpenMode; aMode = aOpenMode;
limit = mask & flags; limit = mask & flags;
zModeType = "access"; zModeType = (char*)"access";
} }
if( aMode ){ if( aMode ){
@ -127559,9 +127559,9 @@ static int openDatabase(
/* The default safety_level for the main database is 'full'; for the temp /* The default safety_level for the main database is 'full'; for the temp
** database it is 'NONE'. This matches the pager layer defaults. ** database it is 'NONE'. This matches the pager layer defaults.
*/ */
db->aDb[0].zName = "main"; db->aDb[0].zName = (char*)"main";
db->aDb[0].safety_level = 3; db->aDb[0].safety_level = 3;
db->aDb[1].zName = "temp"; db->aDb[1].zName = (char*)"temp";
db->aDb[1].safety_level = 1; db->aDb[1].safety_level = 1;
db->magic = SQLITE_MAGIC_OPEN; db->magic = SQLITE_MAGIC_OPEN;

View File

@ -598,7 +598,7 @@ endif
$(LIBOBJ)/sqlite3/sqlite3.o: $(3RDPARTY)/sqlite3/sqlite3.c | $(OSPREBUILD) $(LIBOBJ)/sqlite3/sqlite3.o: $(3RDPARTY)/sqlite3/sqlite3.c | $(OSPREBUILD)
@echo Compiling $<... @echo Compiling $<...
$(CC) $(CDEFS) $(CONLYFLAGS) -Wno-bad-function-cast -I$(3RDPARTY)/sqlite3 $(SQLITE3_FLAGS) -c $< -o $@ $(CC) $(CDEFS) $(CCOMFLAGS) $(CONLYFLAGS) -Wno-bad-function-cast -Wno-undef -Wno-unused-but-set-variable -I$(3RDPARTY)/sqlite3 $(SQLITE3_FLAGS) -c $< -o $@
#------------------------------------------------- #-------------------------------------------------
# BGFX library objects # BGFX library objects