diff options
author | Sander Vesik <svesik@openoffice.org> | 2004-04-21 12:27:16 +0000 |
---|---|---|
committer | Sander Vesik <svesik@openoffice.org> | 2004-04-21 12:27:16 +0000 |
commit | a36c73de88d769d554ab350c2c2b78eddfc3a4c2 (patch) | |
tree | 9b7d90070a21f1c91a3f5c980822ece2122c08a2 /soltools/mkdepend/parse.c | |
parent | 7049cd641a2ae8529a4d7d0e7872af090c592721 (diff) |
INTEGRATION: CWS ooo20040329 (1.1.92); FILE MERGED
2004/03/17 12:37:42 waratah 1.1.92.1: #i1858# add return types to subroutines
add forward declarations for some subroutines
add extra brackets for some while loop assignments
break up some if statement assignments
Diffstat (limited to 'soltools/mkdepend/parse.c')
-rw-r--r-- | soltools/mkdepend/parse.c | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/soltools/mkdepend/parse.c b/soltools/mkdepend/parse.c index ab1319a54ce3..6373f9b18eab 100644 --- a/soltools/mkdepend/parse.c +++ b/soltools/mkdepend/parse.c @@ -27,11 +27,14 @@ in this Software without prior written authorization from the X Consortium. */ #include "def.h" +void define( char *def, struct inclist *file ); +void define2(char * name, char * val, struct inclist * file); +void undefine( char *symbol, register struct inclist *file ); extern char *directives[]; extern struct inclist maininclist; -find_includes(filep, file, file_red, recursion, failOK) +int find_includes(filep, file, file_red, recursion, failOK) struct filepointer *filep; struct inclist *file, *file_red; int recursion; @@ -41,7 +44,7 @@ find_includes(filep, file, file_red, recursion, failOK) register int type; boolean recfailOK; - while (line = getline(filep)) { + while ((line = getline(filep))) { switch(type = deftype(line, filep, file_red, file, TRUE)) { case IF: doif: @@ -156,14 +159,14 @@ find_includes(filep, file, file_red, recursion, failOK) return(-1); } -gobble(filep, file, file_red) +int gobble(filep, file, file_red) register struct filepointer *filep; struct inclist *file, *file_red; { register char *line; register int type; - while (line = getline(filep)) { + while ((line = getline(filep))) { switch(type = deftype(line, filep, file_red, file, FALSE)) { case IF: case IFFALSE: @@ -360,12 +363,14 @@ struct symtab *isdefined(symbol, file, srcfile) { register struct symtab *val; - if (val = slookup(symbol, &maininclist)) { + val = slookup(symbol, &maininclist); + if (val) { debug(1,("%s defined on command line\n", symbol)); if (srcfile != NULL) *srcfile = &maininclist; return(val); } - if (val = fdefined(symbol, file, srcfile)) + val = fdefined(symbol, file, srcfile); + if (val) return(val); debug(1,("%s not defined in %s\n", symbol, file->i_file)); return(NULL); @@ -384,14 +389,18 @@ struct symtab *fdefined(symbol, file, srcfile) if (file->i_defchecked) return(NULL); file->i_defchecked = TRUE; - if (val = slookup(symbol, file)) + val = slookup(symbol, file); + if (val) debug(1,("%s defined in %s as %s\n", symbol, file->i_file, val->s_value)); if (val == NULL && file->i_list) { for (ip = file->i_list, i=0; i < file->i_listlen; i++, ip++) - if (val = fdefined(symbol, *ip, srcfile)) { + { + val = fdefined(symbol, *ip, srcfile); + if (val) { break; } + } } else if (val != NULL && srcfile != NULL) *srcfile = file; recurse_lvl--; @@ -403,7 +412,7 @@ struct symtab *fdefined(symbol, file, srcfile) /* * Return type based on if the #if expression evaluates to 0 */ -zero_value(exp, filep, file_red) +int zero_value(exp, filep, file_red) register char *exp; register struct filepointer *filep; register struct inclist *file_red; @@ -414,7 +423,7 @@ zero_value(exp, filep, file_red) return(IF); } -define(def, file) +void define(def, file) char *def; struct inclist *file; { @@ -434,7 +443,7 @@ define(def, file) define2(def, val, file); } -define2(name, val, file) +void define2(name, val, file) char *name, *val; struct inclist *file; { @@ -552,7 +561,7 @@ struct symtab *slookup(symbol, file) return(NULL); } -undefine(symbol, file) +void undefine(symbol, file) char *symbol; register struct inclist *file; { |