From 290b7e0632921ca0c204eb91c8ebfd253813f137 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 24 Jun 2014 07:44:01 +0200 Subject: remove use of register keyword in C files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit C compilers have been ignoring it for the last decade Change-Id: I42918263121dd189bab9d27077798b779b9e8da1 Reviewed-on: https://gerrit.libreoffice.org/9873 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- soltools/cpp/_getopt.c | 4 ++-- soltools/cpp/_lex.c | 6 +++--- soltools/mkdepend/cppsetup.c | 16 ++++++++-------- soltools/mkdepend/def.h | 20 ++++++++++---------- soltools/mkdepend/include.c | 26 +++++++++++++------------- soltools/mkdepend/main.c | 34 +++++++++++++++++----------------- soltools/mkdepend/parse.c | 44 ++++++++++++++++++++++---------------------- soltools/mkdepend/pr.c | 22 +++++++++++----------- 8 files changed, 86 insertions(+), 86 deletions(-) (limited to 'soltools') diff --git a/soltools/cpp/_getopt.c b/soltools/cpp/_getopt.c index 82506faee22c..bd13860ae8f6 100644 --- a/soltools/cpp/_getopt.c +++ b/soltools/cpp/_getopt.c @@ -34,8 +34,8 @@ int stgetopt(int argc, char *const argv[], const char *opts) { static int sp = 1; - register int c; - register char *cp; + int c; + char *cp; if (sp == 1) { diff --git a/soltools/cpp/_lex.c b/soltools/cpp/_lex.c index 1975d19b784f..3c35320a9bdc 100644 --- a/soltools/cpp/_lex.c +++ b/soltools/cpp/_lex.c @@ -331,9 +331,9 @@ void int gettokens(Tokenrow * trp, int reset) { - register int c, state, oldstate; - register uchar *ip; - register Token *tp, *maxp; + int c, state, oldstate; + uchar *ip; + Token *tp, *maxp; int runelen; Source *s = cursource; int nmac = 0; diff --git a/soltools/mkdepend/cppsetup.c b/soltools/mkdepend/cppsetup.c index 7d967741b14f..9f6dc63e2f66 100644 --- a/soltools/mkdepend/cppsetup.c +++ b/soltools/mkdepend/cppsetup.c @@ -61,11 +61,11 @@ struct filepointer *currentfile; struct inclist *currentinc; cppsetup(line, filep, inc) - register char *line; - register struct filepointer *filep; - register struct inclist *inc; + char *line; + struct filepointer *filep; + struct inclist *inc; { - register char *p, savec; + char *p, savec; static boolean setupdone = FALSE; boolean value; @@ -105,7 +105,7 @@ pperror(tag, x0,x1,x2,x3,x4) yyerror(s) - register char *s; + char *s; { fatalerr("Fatal error: %s\n", s); } @@ -198,9 +198,9 @@ _my_eval_variable (IfParser *ip, const char *var, int len) int cppsetup(line, filep, inc) - register char *line; - register struct filepointer *filep; - register struct inclist *inc; + char *line; + struct filepointer *filep; + struct inclist *inc; { IfParser ip; struct _parse_data pd; diff --git a/soltools/mkdepend/def.h b/soltools/mkdepend/def.h index 94bc2553cb49..0515e42efc43 100644 --- a/soltools/mkdepend/def.h +++ b/soltools/mkdepend/def.h @@ -160,8 +160,8 @@ char *base_name(char *); char *get_line(struct filepointer *); char *isdefined(char *); struct filepointer *getfile(char *); -struct inclist *newinclude(register char *newfile, - register char *incstring); +struct inclist *newinclude(char *newfile, + char *incstring); struct inclist *inc_path(char *, char *, boolean, struct IncludesCollection *); @@ -173,17 +173,17 @@ void freefile( struct filepointer * fp ); int find_includes(struct filepointer *filep, struct inclist *file, struct inclist *file_red, int recursion, boolean failOK, struct IncludesCollection* incCollection, struct symhash *symbols); -void included_by(register struct inclist *ip, - register struct inclist * newfile); -int cppsetup(register char *line, - register struct filepointer *filep, register struct inclist *inc); +void included_by(struct inclist *ip, + struct inclist * newfile); +int cppsetup(char *line, + struct filepointer *filep, struct inclist *inc); 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); -int match(register char *str, register char **list); -void recursive_pr_include(register struct inclist *head, register char *file, - register char *base); -void recursive_pr_dummy(register struct inclist *head, register char *file); +int match(char *str, char **list); +void recursive_pr_include(struct inclist *head, char *file, + char *base); +void recursive_pr_dummy(struct inclist *head, char *file); void inc_clean(void); void fatalerr(char *, ...); diff --git a/soltools/mkdepend/include.c b/soltools/mkdepend/include.c index b3448d90c65d..5b0a54af0c19 100644 --- a/soltools/mkdepend/include.c +++ b/soltools/mkdepend/include.c @@ -45,11 +45,11 @@ extern char *notdotdot[ ]; extern boolean show_where_not; extern boolean warn_multiple; -struct inclist *inc_path(register char *file, register char *include, boolean dot, struct IncludesCollection* incCollection) +struct inclist *inc_path(char *file, char *include, boolean dot, struct IncludesCollection* incCollection) { static char path[ BUFSIZ ]; - register char **pp, *p; - register struct inclist *ip; + char **pp, *p; + struct inclist *ip; struct stat st; boolean found = FALSE; (void)dot; @@ -144,8 +144,8 @@ int exists_path(incCollection, path) void remove_dotdot(path) char *path; { - register char *end, *from, *to, **cp; - char *components[ MAXFILES ], + char *end, *from, *to, **cp; + char *components[ MAXFILES ], newpath[ BUFSIZ ]; boolean component_copied; @@ -211,7 +211,7 @@ void remove_dotdot(path) } int isdot(p) - register char *p; + char *p; { if(p && p[0] == '.' && p[1] == '\0') return(TRUE); @@ -219,7 +219,7 @@ int isdot(p) } int isdotdot(p) - register char *p; + char *p; { if(p && p[0] == '.' && p[1] == '.' && p[2] == '\0') return(TRUE); @@ -227,7 +227,7 @@ int isdotdot(p) } int issymbolic(dir, component) - register char *dir, *component; + char *dir, *component; { #ifdef S_IFLNK struct stat st; @@ -252,9 +252,9 @@ int issymbolic(dir, component) * Add an include file to the list of those included by 'file'. */ struct inclist *newinclude(newfile, incstring) - register char *newfile, *incstring; + char *newfile, *incstring; { - register struct inclist *ip; + struct inclist *ip; /* * First, put this file on the global list of include files. @@ -273,9 +273,9 @@ struct inclist *newinclude(newfile, incstring) } void included_by(ip, newfile) - register struct inclist *ip, *newfile; + struct inclist *ip, *newfile; { - register int i; + int i; if (ip == NULL) return; @@ -319,7 +319,7 @@ void included_by(ip, newfile) void inc_clean (void) { - register struct inclist *ip; + struct inclist *ip; for (ip = inclist; ip < inclistp; ip++) { ip->i_marked = FALSE; diff --git a/soltools/mkdepend/main.c b/soltools/mkdepend/main.c index 9b67e3717222..aef22ab06962 100644 --- a/soltools/mkdepend/main.c +++ b/soltools/mkdepend/main.c @@ -165,10 +165,10 @@ boolean native_win_slashes = FALSE; int main(int argc, char **argv) { - register char **fp = filelist; - register char **incp = includedirs; - register char *p; - register struct inclist *ip; + char **fp = filelist; + char **incp = includedirs; + char *p; + struct inclist *ip; char *makefile = NULL; struct filepointer *filecontent; struct pair *psymp = predefs; @@ -475,7 +475,7 @@ int main(int argc, char **argv) struct filepointer *getfile(file) char *file; { - register int fd; + int fd; struct filepointer *content; struct stat st; off_t size_backup; @@ -529,18 +529,18 @@ void freefile(fp) } char *copy(str) - register char *str; + char *str; { - register char *p = (char *)malloc(strlen(str) + 1); + char *p = (char *)malloc(strlen(str) + 1); strcpy(p, str); return(p); } int match(str, list) - register char *str, **list; + char *str, **list; { - register int i; + int i; for (i=0; *list; i++, list++) if (strcmp(str, *list) == 0) @@ -553,12 +553,12 @@ int match(str, list) * is all this program is ever interested in. */ char *get_line(filep) - register struct filepointer *filep; + struct filepointer *filep; { - register char *p, /* walking pointer */ - *eof, /* end of file pointer */ - *bol; /* beginning of line pointer */ - register int lineno; /* line number */ + char *p, /* walking pointer */ + *eof, /* end of file pointer */ + *bol; /* beginning of line pointer */ + int lineno; /* line number */ p = filep->f_p; eof = filep->f_end; @@ -599,7 +599,7 @@ char *get_line(filep) else if (*p == '\n') { lineno++; if (*bol == '#') { - register char *cp; + char *cp; *p++ = '\0'; /* punt lines with just # (yacc generated) */ @@ -623,9 +623,9 @@ done: * It will have objprefix and objsuffix around it. */ char *base_name(file) - register char *file; + char *file; { - register char *p; + char *p; file = copy(file); for(p=file+strlen(file); p>file && *p != '.'; p--) ; diff --git a/soltools/mkdepend/parse.c b/soltools/mkdepend/parse.c index bcc5b7ed6cde..5b1334f2a4e6 100644 --- a/soltools/mkdepend/parse.c +++ b/soltools/mkdepend/parse.c @@ -30,21 +30,21 @@ in this Software without prior written authorization from the X Consortium. #include "def.h" char *hash_lookup( char *symbol, struct symhash *symbols ); void hash_undefine( char *symbol, struct symhash *symbols ); -int gobble( register struct filepointer *filep, struct inclist *file, +int gobble( struct filepointer *filep, struct inclist *file, struct inclist *file_red, struct symhash *symbols ); -int deftype ( register char *line, register struct filepointer *filep, - register struct inclist *file_red, register struct inclist *file, +int deftype ( char *line, struct filepointer *filep, + struct inclist *file_red, struct inclist *file, int parse_it, struct symhash *symbols); -int zero_value(register char *exp, register struct filepointer *filep, - register struct inclist *file_red, register struct symhash *symbols); +int zero_value(char *exp, struct filepointer *filep, + struct inclist *file_red, struct symhash *symbols); extern char *directives[]; extern struct symhash *maininclist; int find_includes(struct filepointer *filep, struct inclist *file, struct inclist *file_red, int recursion, boolean failOK, struct IncludesCollection* incCollection, struct symhash *symbols) { - register char *line; - register int type; + char *line; + int type; boolean recfailOK; while ((line = get_line(filep))) { @@ -163,12 +163,12 @@ int find_includes(struct filepointer *filep, struct inclist *file, struct inclis } int gobble(filep, file, file_red, symbols) - register struct filepointer *filep; + struct filepointer *filep; struct inclist *file, *file_red; struct symhash *symbols; { - register char *line; - register int type; + char *line; + int type; while ((line = get_line(filep))) { switch(type = deftype(line, filep, file_red, file, FALSE, symbols)) { @@ -217,15 +217,15 @@ int gobble(filep, file, file_red, symbols) * Decide what type of # directive this line is. */ int deftype (line, filep, file_red, file, parse_it, symbols) - register char *line; - register struct filepointer *filep; - register struct inclist *file_red, *file; + char *line; + struct filepointer *filep; + struct inclist *file_red, *file; int parse_it; struct symhash *symbols; { - register char *p; + char *p; char *directive, savechar; - register int ret; + int ret; /* * Parse the directive... @@ -369,7 +369,7 @@ int deftype (line, filep, file_red, file, parse_it, symbols) struct symhash *global_symbols = NULL; char * isdefined( symbol ) - register char *symbol; + char *symbol; { return hash_lookup( symbol, global_symbols ); } @@ -378,10 +378,10 @@ char * isdefined( symbol ) * Return type based on if the #if expression evaluates to 0 */ int zero_value(exp, filep, file_red, symbols) - register char *exp; - register struct filepointer *filep; - register struct inclist *file_red; - register struct symhash *symbols; + char *exp; + struct filepointer *filep; + struct inclist *file_red; + struct symhash *symbols; { global_symbols = symbols; /* HACK! see above */ if (cppsetup(exp, filep, file_red)) @@ -410,10 +410,10 @@ void define( def, symbols ) hash_define( def, val, symbols ); } -static int hash( register char *str ) +static int hash( char *str ) { /* Hash (Kernighan and Ritchie) */ - register unsigned int hashval = 0; + unsigned int hashval = 0; for ( ; *str; str++ ) { diff --git a/soltools/mkdepend/pr.c b/soltools/mkdepend/pr.c index d02414d6f6b5..497e72ced2f6 100644 --- a/soltools/mkdepend/pr.c +++ b/soltools/mkdepend/pr.c @@ -42,8 +42,8 @@ extern boolean show_where_not; 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) { - register struct inclist *newfile; - register struct filepointer *content; + struct inclist *newfile; + struct filepointer *content; /* * First decide what the pathname of this include file really is. @@ -79,17 +79,17 @@ void add_include(struct filepointer *filep, struct inclist *file, struct inclist } } -void pr_dummy(register struct inclist *ip) +void pr_dummy(struct inclist *ip) { fwrite(ip->i_file, strlen(ip->i_file), 1, stdout); fwrite(" :\n\n", 4, 1, stdout); } void recursive_pr_dummy(head, file) - register struct inclist *head; - register char *file; + struct inclist *head; + char *file; { - register int i; + int i; if (head->i_marked == 2) return; @@ -102,10 +102,10 @@ void recursive_pr_dummy(head, file) void recursive_pr_include(head, file, base) - register struct inclist *head; - register char *file, *base; + struct inclist *head; + char *file, *base; { - register int i; + int i; if (head->i_marked) return; @@ -117,13 +117,13 @@ void recursive_pr_include(head, file, base) } size_t pr(ip, file, base) - register struct inclist *ip; + struct inclist *ip; char *file, *base; { size_t ret; static char *lastfile; static int current_len; - register int len, i; + int len, i; char buf[ BUFSIZ ]; printed = TRUE; -- cgit