diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-20 19:54:23 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-21 08:43:05 +0200 |
commit | 18f513145477d4621290253d936dad7a40ee4c05 (patch) | |
tree | 488acddc766727dc28c28c026c9bc2a2a5e10900 /soltools | |
parent | loplugin:unusedfields in svx part1 (diff) | |
download | core-18f513145477d4621290253d936dad7a40ee4c05.tar.gz core-18f513145477d4621290253d936dad7a40ee4c05.zip |
loplugin:unusedfields store..svl
Change-Id: I6070a683e5128271b84a10caccb548d07c950927
Reviewed-on: https://gerrit.libreoffice.org/39021
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'soltools')
-rw-r--r-- | soltools/mkdepend/cppsetup.c | 12 | ||||
-rw-r--r-- | soltools/mkdepend/def.h | 4 | ||||
-rw-r--r-- | soltools/mkdepend/ifparser.h | 1 | ||||
-rw-r--r-- | soltools/mkdepend/main.c | 1 | ||||
-rw-r--r-- | soltools/mkdepend/parse.c | 20 |
5 files changed, 11 insertions, 27 deletions
diff --git a/soltools/mkdepend/cppsetup.c b/soltools/mkdepend/cppsetup.c index acbdcc6377eb..12b7d12ef55d 100644 --- a/soltools/mkdepend/cppsetup.c +++ b/soltools/mkdepend/cppsetup.c @@ -114,11 +114,6 @@ yyerror(s) #else /* not CPP */ #include "ifparser.h" -struct parse_data { - struct filepointer *filep; - struct inclist *inc; - const char *line; -}; static const char * my_if_errors (IfParser *ip, const char *cp, const char *expecting) @@ -199,19 +194,14 @@ my_eval_variable (IfParser *ip, const char *var, size_t len) } -int cppsetup(char *line, struct filepointer *filep, struct inclist *inc) +int cppsetup(char *line) { IfParser ip; - struct parse_data pd; int val = 0; - pd.filep = filep; - pd.inc = inc; - pd.line = line; ip.funcs.handle_error = my_if_errors; ip.funcs.eval_defined = my_eval_defined; ip.funcs.eval_variable = my_eval_variable; - ip.data = (char *) &pd; (void) ParseIfExpression (&ip, line, &val); if (val) diff --git a/soltools/mkdepend/def.h b/soltools/mkdepend/def.h index fd3f34691128..4c3649cb8369 100644 --- a/soltools/mkdepend/def.h +++ b/soltools/mkdepend/def.h @@ -138,7 +138,6 @@ struct filepointer { char *f_p; char *f_base; char *f_end; - long f_len; long f_line; }; @@ -172,8 +171,7 @@ int find_includes(struct filepointer *filep, struct inclist *file, struct IncludesCollection* incCollection, struct symhash *symbols); void included_by(struct inclist *ip, struct inclist * newfile); -int cppsetup(char *line, - struct filepointer *filep, struct inclist *inc); +int cppsetup(char *line); void add_include(struct filepointer *filep, struct inclist *file, struct inclist *file_red, char *include, boolean dot, boolean failOK, struct IncludesCollection* incCollection, struct symhash *symbols); diff --git a/soltools/mkdepend/ifparser.h b/soltools/mkdepend/ifparser.h index 490ba513b0bc..5c3c0dbb6b79 100644 --- a/soltools/mkdepend/ifparser.h +++ b/soltools/mkdepend/ifparser.h @@ -68,7 +68,6 @@ typedef struct if_parser { int (*eval_variable) (struct if_parser *, const char *, size_t); int (*eval_defined) (struct if_parser *, const char *, size_t); } funcs; - char *data; } IfParser; const char *ParseIfExpression (IfParser *, const char *, int *); diff --git a/soltools/mkdepend/main.c b/soltools/mkdepend/main.c index 438db70f8e3e..80aad85f5274 100644 --- a/soltools/mkdepend/main.c +++ b/soltools/mkdepend/main.c @@ -512,7 +512,6 @@ struct filepointer *getfile(char *file) fatalerr("makedepend: Failed to read file \"%s\"\n", file); close(fd); - content->f_len = bytes_read+1; content->f_p = content->f_base; content->f_end = content->f_base + bytes_read; *content->f_end = '\0'; diff --git a/soltools/mkdepend/parse.c b/soltools/mkdepend/parse.c index 01d34dcc1c14..1da6448a253a 100644 --- a/soltools/mkdepend/parse.c +++ b/soltools/mkdepend/parse.c @@ -34,11 +34,9 @@ char *hash_lookup( char *symbol, struct symhash *symbols ); void hash_undefine( char *symbol, struct symhash *symbols ); int gobble( struct filepointer *filep, struct inclist *file, struct inclist *file_red, struct symhash *symbols ); -int deftype ( char *line, struct filepointer *filep, - struct inclist *file_red, struct inclist *file, +int deftype ( char *line, struct inclist *file, int parse_it, struct symhash *symbols); -int zero_value(char *exp, struct filepointer *filep, - struct inclist *file_red, struct symhash *symbols); +int zero_value(char *exp, struct symhash *symbols); extern struct symhash *maininclist; @@ -49,7 +47,7 @@ int find_includes(struct filepointer *filep, struct inclist *file, struct inclis boolean recfailOK; while ((line = get_line(filep))) { - switch(type = deftype(line, filep, file_red, file, TRUE, symbols)) { + switch(type = deftype(line, file, TRUE, symbols)) { case IF: doif: type = find_includes(filep, file, @@ -172,7 +170,7 @@ int gobble(struct filepointer *filep, int type; while ((line = get_line(filep))) { - switch(type = deftype(line, filep, file_red, file, FALSE, symbols)) { + switch(type = deftype(line, file, FALSE, symbols)) { case IF: case IFFALSE: case IFGUESSFALSE: @@ -217,7 +215,7 @@ int gobble(struct filepointer *filep, /* * Decide what type of # directive this line is. */ -int deftype (char *line, struct filepointer *filep, struct inclist *file_red, struct inclist *file, int parse_it, struct symhash *symbols) +int deftype (char *line, struct inclist *file, int parse_it, struct symhash *symbols) { char *p; char *directive, savechar; @@ -253,7 +251,7 @@ int deftype (char *line, struct filepointer *filep, struct inclist *file_red, st */ debug(0,("%s, line %d: #elif %s ", file->i_file, filep->f_line, p)); - ret = zero_value(p, filep, file_red, symbols); + ret = zero_value(p, symbols); if (ret != IF) { debug(0,("false...\n")); @@ -282,7 +280,7 @@ int deftype (char *line, struct filepointer *filep, struct inclist *file_red, st /* * parse an expression. */ - ret = zero_value(p, filep, file_red, symbols); + ret = zero_value(p, symbols); debug(0,("%s, line %d: %s #if %s\n", file->i_file, filep->f_line, ret?"false":"true", p)); break; @@ -372,10 +370,10 @@ char * isdefined( char *symbol ) /* * Return type based on if the #if expression evaluates to 0 */ -int zero_value(char *exp, struct filepointer *filep, struct inclist *file_red, struct symhash *symbols) +int zero_value(char *exp, struct symhash *symbols) { global_symbols = symbols; /* HACK! see above */ - if (cppsetup(exp, filep, file_red)) + if (cppsetup(exp)) return IFFALSE; else return IF; |