Fix warnings

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5377 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2003-01-20 06:19:18 +00:00
parent 4c7e30347d
commit 4170123278
8 changed files with 26 additions and 16 deletions

View File

@ -688,14 +688,14 @@ makeRuleDescArray2()
fprintf(outfile, "\t");
if (pVector[i]) {
Operator o;
NonTerminal t;
NonTerminal t1, t2;
fprintf(outfile, "{");
fprintf(outfile, "%5d, %5d, %5d, %5d",
pVector[i]->rule->lhs->num,
(o = pVector[i]->rule->pat->op) ? o->num : 0,
(t = pVector[i]->rule->pat->children[0]) ? t->num : 0,
(t = pVector[i]->rule->pat->children[1]) ? t->num : 0
(t1 = pVector[i]->rule->pat->children[0]) ? t1->num : 0,
(t2 = pVector[i]->rule->pat->children[1]) ? t2->num : 0
);
fprintf(outfile, "} /* ");
printRule(pVector[i], "0");

View File

@ -58,6 +58,11 @@ struct strTable {
};
typedef struct strTable *StrTable;
extern void doGrammarNts ARGS((void));
void makeRuleDescArray ARGS((void));
void makeDeltaCostArray ARGS((void));
void makeStateStringArray ARGS((void));
extern StrTable newStrTable ARGS((void));
extern StrTableElement addString ARGS((StrTable, char *, int, int *));

View File

@ -15,9 +15,9 @@ static char *outFileName;
static char version[] = "BURG, Version 1.0";
extern void main ARGS((int argc, char **argv));
extern int main ARGS((int argc, char **argv));
void
int
main(argc, argv) int argc; char **argv;
{
int i;
@ -33,7 +33,7 @@ main(argc, argv) int argc; char **argv;
fprintf(stderr, "%s\n", version);
break;
case 'p':
needStr = &prefix;
needStr = (char**)&prefix;
break;
case 'o':
needStr = &outFileName;

View File

@ -232,7 +232,7 @@ renumber()
for (i = 1; i < globalMap->count; i++) {
sortedStates[i-1] = globalMap->set[i];
}
qsort(sortedStates, globalMap->count-1, sizeof(Item_Set), stateCompare);
qsort(sortedStates, globalMap->count-1, sizeof(Item_Set), (int(*)(const void *, const void *))stateCompare);
previousOp = 0;
for (i = 0; i < globalMap->count-1; i++) {
sortedStates[i]->newNum = i;
@ -246,7 +246,7 @@ renumber()
sortedRules = (RuleAST*) zalloc(max_ruleAST * sizeof(RuleAST));
count = 0;
foreachList((ListFn) assignRules, ruleASTs);
qsort(sortedRules, max_ruleAST, sizeof(RuleAST), ruleCompare);
qsort(sortedRules, max_ruleAST, sizeof(RuleAST), (int(*)(const void *, const void *))ruleCompare);
previousLHS = 0;
base_counter = 0;
for (i = 0; i < max_ruleAST; i++) {

View File

@ -688,14 +688,14 @@ makeRuleDescArray2()
fprintf(outfile, "\t");
if (pVector[i]) {
Operator o;
NonTerminal t;
NonTerminal t1, t2;
fprintf(outfile, "{");
fprintf(outfile, "%5d, %5d, %5d, %5d",
pVector[i]->rule->lhs->num,
(o = pVector[i]->rule->pat->op) ? o->num : 0,
(t = pVector[i]->rule->pat->children[0]) ? t->num : 0,
(t = pVector[i]->rule->pat->children[1]) ? t->num : 0
(t1 = pVector[i]->rule->pat->children[0]) ? t1->num : 0,
(t2 = pVector[i]->rule->pat->children[1]) ? t2->num : 0
);
fprintf(outfile, "} /* ");
printRule(pVector[i], "0");

View File

@ -58,6 +58,11 @@ struct strTable {
};
typedef struct strTable *StrTable;
extern void doGrammarNts ARGS((void));
void makeRuleDescArray ARGS((void));
void makeDeltaCostArray ARGS((void));
void makeStateStringArray ARGS((void));
extern StrTable newStrTable ARGS((void));
extern StrTableElement addString ARGS((StrTable, char *, int, int *));

View File

@ -15,9 +15,9 @@ static char *outFileName;
static char version[] = "BURG, Version 1.0";
extern void main ARGS((int argc, char **argv));
extern int main ARGS((int argc, char **argv));
void
int
main(argc, argv) int argc; char **argv;
{
int i;
@ -33,7 +33,7 @@ main(argc, argv) int argc; char **argv;
fprintf(stderr, "%s\n", version);
break;
case 'p':
needStr = &prefix;
needStr = (char**)&prefix;
break;
case 'o':
needStr = &outFileName;

View File

@ -232,7 +232,7 @@ renumber()
for (i = 1; i < globalMap->count; i++) {
sortedStates[i-1] = globalMap->set[i];
}
qsort(sortedStates, globalMap->count-1, sizeof(Item_Set), stateCompare);
qsort(sortedStates, globalMap->count-1, sizeof(Item_Set), (int(*)(const void *, const void *))stateCompare);
previousOp = 0;
for (i = 0; i < globalMap->count-1; i++) {
sortedStates[i]->newNum = i;
@ -246,7 +246,7 @@ renumber()
sortedRules = (RuleAST*) zalloc(max_ruleAST * sizeof(RuleAST));
count = 0;
foreachList((ListFn) assignRules, ruleASTs);
qsort(sortedRules, max_ruleAST, sizeof(RuleAST), ruleCompare);
qsort(sortedRules, max_ruleAST, sizeof(RuleAST), (int(*)(const void *, const void *))ruleCompare);
previousLHS = 0;
base_counter = 0;
for (i = 0; i < max_ruleAST; i++) {