mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
The amalgamation now compiles cleanly on GCC with options
-pedantic-errors -Wno-long-long. (CVS 5991) FossilOrigin-Name: 73c7302c5f76a2f61ecd75f8bda69bb500d3119c
This commit is contained in:
@ -15,7 +15,7 @@ static const char zHdr[] =
|
||||
"**\n"
|
||||
"** The code in this file has been automatically generated by\n"
|
||||
"**\n"
|
||||
"** $Header: /home/drh/sqlite/trans/cvs/sqlite/sqlite/tool/mkkeywordhash.c,v 1.32 2008/10/06 05:32:19 danielk1977 Exp $\n"
|
||||
"** $Header: /home/drh/sqlite/trans/cvs/sqlite/sqlite/tool/mkkeywordhash.c,v 1.33 2008/12/08 18:19:18 drh Exp $\n"
|
||||
"**\n"
|
||||
"** The code in this file implements a function that determines whether\n"
|
||||
"** or not a given identifier is really an SQL keyword. The same thing\n"
|
||||
@ -335,6 +335,7 @@ int main(int argc, char **argv){
|
||||
int nChar;
|
||||
int totalLen = 0;
|
||||
int aHash[1000]; /* 1000 is much bigger than nKeyword */
|
||||
char zText[2000];
|
||||
|
||||
/* Remove entries from the list of keywords that have mask==0 */
|
||||
for(i=j=0; i<nKeyword; i++){
|
||||
@ -463,20 +464,43 @@ int main(int argc, char **argv){
|
||||
printf("static int keywordCode(const char *z, int n){\n");
|
||||
printf(" /* zText[] encodes %d bytes of keywords in %d bytes */\n",
|
||||
totalLen + nKeyword, nChar+1 );
|
||||
|
||||
printf(" static const char zText[%d] =\n", nChar+1);
|
||||
for(i=j=0; i<nKeyword; i++){
|
||||
for(i=j=k=0; i<nKeyword; i++){
|
||||
Keyword *p = &aKeywordTable[i];
|
||||
if( p->substrId ) continue;
|
||||
if( j==0 ) printf(" \"");
|
||||
memcpy(&zText[k], p->zName, p->len);
|
||||
k += p->len;
|
||||
if( j+p->len>70 ){
|
||||
printf("%*s */\n", 74-j, "");
|
||||
j = 0;
|
||||
}
|
||||
if( j==0 ){
|
||||
printf(" /* ");
|
||||
j = 8;
|
||||
}
|
||||
printf("%s", p->zName);
|
||||
j += p->len;
|
||||
if( j>60 ){
|
||||
printf("\"\n");
|
||||
}
|
||||
if( j>0 ){
|
||||
printf("%*s */\n", 74-j, "");
|
||||
}
|
||||
printf(" static const char zText[%d] = {\n", nChar+1);
|
||||
for(i=j=0; i<=k; i++){
|
||||
if( j==0 ){
|
||||
printf(" ");
|
||||
}
|
||||
if( zText[i]==0 ){
|
||||
printf("0");
|
||||
}else{
|
||||
printf("'%c',", zText[i]);
|
||||
}
|
||||
j += 4;
|
||||
if( j>68 ){
|
||||
printf("\n");
|
||||
j = 0;
|
||||
}
|
||||
}
|
||||
printf("%s;\n", j>0 ? "\"" : " ");
|
||||
if( j>0 ) printf("\n");
|
||||
printf(" };\n");
|
||||
|
||||
printf(" static const unsigned char aHash[%d] = {\n", bestSize);
|
||||
for(i=j=0; i<bestSize; i++){
|
||||
|
Reference in New Issue
Block a user