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

View File

@ -598,7 +598,7 @@ endif
$(LIBOBJ)/sqlite3/sqlite3.o: $(3RDPARTY)/sqlite3/sqlite3.c | $(OSPREBUILD)
@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