mkdepend: cleanup indentation and function declarations

to make it easier to read

Change-Id: Iff0fe055c12358edc1be335ec83d0855cc32f03c
Reviewed-on: https://gerrit.libreoffice.org/9877
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Noel Grandin
2014-06-24 13:07:36 +02:00
committed by Caolán McNamara
parent 290b7e0632
commit 0a0c70e05a
8 changed files with 185 additions and 237 deletions

View File

@@ -197,10 +197,7 @@ _my_eval_variable (IfParser *ip, const char *var, int len)
} }
int cppsetup(line, filep, inc) int cppsetup(char *line, struct filepointer *filep, struct inclist *inc)
char *line;
struct filepointer *filep;
struct inclist *inc;
{ {
IfParser ip; IfParser ip;
struct _parse_data pd; struct _parse_data pd;

View File

@@ -417,10 +417,7 @@ parse_lor (IfParser *g, const char *cp, int *valp)
****************************************************************************/ ****************************************************************************/
const char * const char *
ParseIfExpression (g, cp, valp) ParseIfExpression (IfParser *g, const char *cp, int *valp)
IfParser *g;
const char *cp;
int *valp;
{ {
return parse_lor (g, cp, valp); return parse_lor (g, cp, valp);
} }

View File

@@ -64,8 +64,7 @@ typedef int Bool;
typedef struct _if_parser { typedef struct _if_parser {
struct { /* functions */ struct { /* functions */
const char *(*handle_error) (struct _if_parser *, const char *, const char *(*handle_error) (struct _if_parser *, const char *, const char *);
const char *);
int (*eval_variable) (struct _if_parser *, const char *, int); int (*eval_variable) (struct _if_parser *, const char *, int);
int (*eval_defined) (struct _if_parser *, const char *, int); int (*eval_defined) (struct _if_parser *, const char *, int);
} funcs; } funcs;

View File

@@ -128,9 +128,7 @@ struct inclist *inc_path(char *file, char *include, boolean dot, struct Includes
return(ip); return(ip);
} }
int exists_path(incCollection, path) int exists_path(struct IncludesCollection *incCollection, char *path)
struct IncludesCollection* incCollection;
char* path;
{ {
convert_slashes(path); convert_slashes(path);
return call_IncludesCollection_exists(incCollection, path); return call_IncludesCollection_exists(incCollection, path);
@@ -141,8 +139,7 @@ int exists_path(incCollection, path)
* Any of the 'x/..' sequences within the name can be eliminated. * Any of the 'x/..' sequences within the name can be eliminated.
* (but only if 'x' is not a symbolic link!!) * (but only if 'x' is not a symbolic link!!)
*/ */
void remove_dotdot(path) void remove_dotdot(char *path)
char *path;
{ {
char *end, *from, *to, **cp; char *end, *from, *to, **cp;
char *components[ MAXFILES ], char *components[ MAXFILES ],
@@ -179,9 +176,9 @@ void remove_dotdot(path)
char **fp = cp + 2; char **fp = cp + 2;
char **tp = cp; char **tp = cp;
do do {
*tp++ = *fp; /* move all the pointers down */ *tp++ = *fp; /* move all the pointers down */
while (*fp++); } while (*fp++);
if (cp != components) if (cp != components)
cp--; /* go back and check for nested ".." */ cp--; /* go back and check for nested ".." */
} else { } else {
@@ -210,24 +207,21 @@ void remove_dotdot(path)
strcpy(path, newpath); strcpy(path, newpath);
} }
int isdot(p) int isdot(char *p)
char *p;
{ {
if(p && p[0] == '.' && p[1] == '\0') if(p && p[0] == '.' && p[1] == '\0')
return(TRUE); return(TRUE);
return(FALSE); return(FALSE);
} }
int isdotdot(p) int isdotdot(char *p)
char *p;
{ {
if(p && p[0] == '.' && p[1] == '.' && p[2] == '\0') if(p && p[0] == '.' && p[1] == '.' && p[2] == '\0')
return(TRUE); return(TRUE);
return(FALSE); return(FALSE);
} }
int issymbolic(dir, component) int issymbolic(char *dir, char *component)
char *dir, *component;
{ {
#ifdef S_IFLNK #ifdef S_IFLNK
struct stat st; struct stat st;
@@ -251,8 +245,7 @@ int issymbolic(dir, component)
/* /*
* Add an include file to the list of those included by 'file'. * Add an include file to the list of those included by 'file'.
*/ */
struct inclist *newinclude(newfile, incstring) struct inclist *newinclude(char *newfile, char *incstring)
char *newfile, *incstring;
{ {
struct inclist *ip; struct inclist *ip;
@@ -272,8 +265,7 @@ struct inclist *newinclude(newfile, incstring)
return(ip); return(ip);
} }
void included_by(ip, newfile) void included_by(struct inclist *ip, struct inclist *newfile)
struct inclist *ip, *newfile;
{ {
int i; int i;

View File

@@ -472,8 +472,7 @@ int main(int argc, char **argv)
exit(0); exit(0);
} }
struct filepointer *getfile(file) struct filepointer *getfile(char *file)
char *file;
{ {
int fd; int fd;
struct filepointer *content; struct filepointer *content;
@@ -521,15 +520,13 @@ struct filepointer *getfile(file)
return(content); return(content);
} }
void freefile(fp) void freefile(struct filepointer *fp)
struct filepointer *fp;
{ {
free(fp->f_base); free(fp->f_base);
free(fp); free(fp);
} }
char *copy(str) char *copy(char *str)
char *str;
{ {
char *p = (char *)malloc(strlen(str) + 1); char *p = (char *)malloc(strlen(str) + 1);
@@ -537,8 +534,7 @@ char *copy(str)
return(p); return(p);
} }
int match(str, list) int match(char *str, char **list)
char *str, **list;
{ {
int i; int i;
@@ -552,8 +548,7 @@ int match(str, list)
* Get the next line. We only return lines beginning with '#' since that * Get the next line. We only return lines beginning with '#' since that
* is all this program is ever interested in. * is all this program is ever interested in.
*/ */
char *get_line(filep) char *get_line(struct filepointer *filep)
struct filepointer *filep;
{ {
char *p, /* walking pointer */ char *p, /* walking pointer */
*eof, /* end of file pointer */ *eof, /* end of file pointer */
@@ -622,8 +617,7 @@ done:
* Strip the file name down to what we want to see in the Makefile. * Strip the file name down to what we want to see in the Makefile.
* It will have objprefix and objsuffix around it. * It will have objprefix and objsuffix around it.
*/ */
char *base_name(file) char *base_name(char *file)
char *file;
{ {
char *p; char *p;
@@ -644,8 +638,7 @@ char *base_name(file)
} }
#if defined(USG) && !defined(CRAY) && !defined(SVR4) #if defined(USG) && !defined(CRAY) && !defined(SVR4)
int rename (from, to) int rename (char *from, char *to)
char *from, *to;
{ {
(void) unlink (to); (void) unlink (to);
if (link (from, to) == 0) { if (link (from, to) == 0) {
@@ -657,9 +650,7 @@ int rename (from, to)
} }
#endif /* USGISH */ #endif /* USGISH */
void redirect(line, makefile) void redirect(char *line, char *makefile)
char *line,
*makefile;
{ {
FILE *fdout; FILE *fdout;
fdout = freopen(makefile, "wb", stdout); // binary mode please fdout = freopen(makefile, "wb", stdout); // binary mode please
@@ -771,8 +762,7 @@ void warning1(char *msg, ...)
#endif /* DEBUG_MKDEPEND */ #endif /* DEBUG_MKDEPEND */
} }
void convert_slashes(path) void convert_slashes(char *path)
char* path;
{ {
#if defined (WNT) #if defined (WNT)
/* /*
@@ -793,8 +783,7 @@ void convert_slashes(path)
#endif #endif
} }
char* append_slash(path) char* append_slash(char *path)
char* path;
{ {
char *new_string; char *new_string;
if ((path[strlen(path) - 1] == '/') || (path[strlen(path) - 1] == '\\')) { if ((path[strlen(path) - 1] == '/') || (path[strlen(path) - 1] == '\\')) {

View File

@@ -162,10 +162,10 @@ int find_includes(struct filepointer *filep, struct inclist *file, struct inclis
return(-1); return(-1);
} }
int gobble(filep, file, file_red, symbols) int gobble(struct filepointer *filep,
struct filepointer *filep; struct inclist *file,
struct inclist *file, *file_red; struct inclist *file_red,
struct symhash *symbols; struct symhash *symbols)
{ {
char *line; char *line;
int type; int type;
@@ -216,12 +216,7 @@ int gobble(filep, file, file_red, symbols)
/* /*
* Decide what type of # directive this line is. * Decide what type of # directive this line is.
*/ */
int deftype (line, filep, file_red, file, parse_it, symbols) int deftype (char *line, struct filepointer *filep, struct inclist *file_red, struct inclist *file, int parse_it, struct symhash *symbols)
char *line;
struct filepointer *filep;
struct inclist *file_red, *file;
int parse_it;
struct symhash *symbols;
{ {
char *p; char *p;
char *directive, savechar; char *directive, savechar;
@@ -368,8 +363,7 @@ int deftype (line, filep, file_red, file, parse_it, symbols)
*/ */
struct symhash *global_symbols = NULL; struct symhash *global_symbols = NULL;
char * isdefined( symbol ) char * isdefined( char *symbol )
char *symbol;
{ {
return hash_lookup( symbol, global_symbols ); return hash_lookup( symbol, global_symbols );
} }
@@ -377,11 +371,7 @@ char * isdefined( symbol )
/* /*
* Return type based on if the #if expression evaluates to 0 * Return type based on if the #if expression evaluates to 0
*/ */
int zero_value(exp, filep, file_red, symbols) int zero_value(char *exp, struct filepointer *filep, struct inclist *file_red, struct symhash *symbols)
char *exp;
struct filepointer *filep;
struct inclist *file_red;
struct symhash *symbols;
{ {
global_symbols = symbols; /* HACK! see above */ global_symbols = symbols; /* HACK! see above */
if (cppsetup(exp, filep, file_red)) if (cppsetup(exp, filep, file_red))
@@ -390,9 +380,7 @@ int zero_value(exp, filep, file_red, symbols)
return(IF); return(IF);
} }
void define( def, symbols ) void define( char *def, struct symhash **symbols )
char *def;
struct symhash **symbols;
{ {
char *val; char *val;
@@ -423,8 +411,7 @@ static int hash( char *str )
return hashval & ( SYMHASHMEMBERS - 1 ); return hashval & ( SYMHASHMEMBERS - 1 );
} }
struct symhash *hash_copy( symbols ) struct symhash *hash_copy( struct symhash *symbols )
struct symhash *symbols;
{ {
int i; int i;
struct symhash *newsym; struct symhash *newsym;
@@ -459,8 +446,7 @@ struct symhash *hash_copy( symbols )
return newsym; return newsym;
} }
void hash_free( symbols ) void hash_free( struct symhash *symbols )
struct symhash *symbols;
{ {
int i; int i;
@@ -481,9 +467,7 @@ void hash_free( symbols )
free( symbols->s_pairs ); free( symbols->s_pairs );
} }
void hash_define( name, val, symbols ) void hash_define( char *name, char *val, struct symhash **symbols )
char *name, *val;
struct symhash **symbols;
{ {
int hashval; int hashval;
struct pair *it; struct pair *it;
@@ -537,9 +521,7 @@ void hash_define( name, val, symbols )
} }
} }
char *hash_lookup( symbol, symbols ) char *hash_lookup( char *symbol, struct symhash *symbols )
char *symbol;
struct symhash *symbols;
{ {
struct pair *it; struct pair *it;
@@ -558,9 +540,7 @@ char *hash_lookup( symbol, symbols )
return NULL; return NULL;
} }
void hash_undefine( symbol, symbols ) void hash_undefine( char *symbol, struct symhash *symbols )
char *symbol;
struct symhash *symbols;
{ {
int hashval; int hashval;
struct pair *it; struct pair *it;

View File

@@ -85,9 +85,7 @@ void pr_dummy(struct inclist *ip)
fwrite(" :\n\n", 4, 1, stdout); fwrite(" :\n\n", 4, 1, stdout);
} }
void recursive_pr_dummy(head, file) void recursive_pr_dummy(struct inclist *head, char *file)
struct inclist *head;
char *file;
{ {
int i; int i;
@@ -101,9 +99,7 @@ void recursive_pr_dummy(head, file)
} }
void recursive_pr_include(head, file, base) void recursive_pr_include(struct inclist *head, char *file, char *base)
struct inclist *head;
char *file, *base;
{ {
int i; int i;
@@ -116,9 +112,7 @@ void recursive_pr_include(head, file, base)
recursive_pr_include(head->i_list[ i ], file, base); recursive_pr_include(head->i_list[ i ], file, base);
} }
size_t pr(ip, file, base) size_t pr(struct inclist *ip, char *file, char *base)
struct inclist *ip;
char *file, *base;
{ {
size_t ret; size_t ret;
static char *lastfile; static char *lastfile;