Kaydet (Commit) f0eb45df authored tarafından Luboš Luňák's avatar Luboš Luňák

fix some lousy formatting that triggers warnings from the compiler plugin

Change-Id: I94cafba5363f24d608add6878c72f230f45fdb87
üst 7c4d3ea6
...@@ -664,7 +664,7 @@ Tokenrow * ...@@ -664,7 +664,7 @@ Tokenrow *
// Change by np 31.10.2001, #93725 - begin // Change by np 31.10.2001, #93725 - begin
if ( tp->wslen > 0 ) if ( tp->wslen > 0 )
*sp++ = ' '; *sp++ = ' ';
// change end. // change end.
for (i = 0, cp = tp->t; (unsigned int)i < tp->len; i++) for (i = 0, cp = tp->t; (unsigned int)i < tp->len; i++)
......
...@@ -161,7 +161,7 @@ _lookup_variable (var, len) ...@@ -161,7 +161,7 @@ _lookup_variable (var, len)
char tmpbuf[MAXNAMELEN + 1]; char tmpbuf[MAXNAMELEN + 1];
if (len > MAXNAMELEN) if (len > MAXNAMELEN)
return 0; return 0;
strncpy (tmpbuf, var, len); strncpy (tmpbuf, var, len);
tmpbuf[len] = '\0'; tmpbuf[len] = '\0';
...@@ -177,9 +177,9 @@ _my_eval_defined (ip, var, len) ...@@ -177,9 +177,9 @@ _my_eval_defined (ip, var, len)
{ {
(void)ip; (void)ip;
if (_lookup_variable (var, len)) if (_lookup_variable (var, len))
return 1; return 1;
else else
return 0; return 0;
} }
#define isvarfirstletter(ccc) (isalpha(ccc) || (ccc) == '_') #define isvarfirstletter(ccc) (isalpha(ccc) || (ccc) == '_')
...@@ -196,7 +196,7 @@ _my_eval_variable (ip, var, len) ...@@ -196,7 +196,7 @@ _my_eval_variable (ip, var, len)
s = _lookup_variable (var, len); s = _lookup_variable (var, len);
if (!s) if (!s)
return 0; return 0;
do { do {
var = s; var = s;
if (!isvarfirstletter(*var)) if (!isvarfirstletter(*var))
......
...@@ -82,7 +82,7 @@ parse_variable (g, cp, varp) ...@@ -82,7 +82,7 @@ parse_variable (g, cp, varp)
SKIPSPACE (cp); SKIPSPACE (cp);
if (!isvarfirstletter (*cp)) if (!isvarfirstletter (*cp))
return CALLFUNC(g, handle_error) (g, cp, "variable name"); return CALLFUNC(g, handle_error) (g, cp, "variable name");
*varp = cp; *varp = cp;
/* EMPTY */ /* EMPTY */
...@@ -100,7 +100,7 @@ parse_number (g, cp, valp) ...@@ -100,7 +100,7 @@ parse_number (g, cp, valp)
SKIPSPACE (cp); SKIPSPACE (cp);
if (!isdigit(*cp)) if (!isdigit(*cp))
return CALLFUNC(g, handle_error) (g, cp, "number"); return CALLFUNC(g, handle_error) (g, cp, "number");
#ifdef WIN32 #ifdef WIN32
{ {
...@@ -128,7 +128,7 @@ parse_value (g, cp, valp) ...@@ -128,7 +128,7 @@ parse_value (g, cp, valp)
SKIPSPACE (cp); SKIPSPACE (cp);
if (!*cp) if (!*cp)
return cp; return cp;
switch (*cp) { switch (*cp) {
case '(': case '(':
...@@ -178,7 +178,7 @@ parse_value (g, cp, valp) ...@@ -178,7 +178,7 @@ parse_value (g, cp, valp)
len = (int)(cp - var); len = (int)(cp - var);
SKIPSPACE (cp); SKIPSPACE (cp);
if (paren && *cp != ')') if (paren && *cp != ')')
return CALLFUNC(g, handle_error) (g, cp, ")"); return CALLFUNC(g, handle_error) (g, cp, ")");
*valp = (*(g->funcs.eval_defined)) (g, var, len); *valp = (*(g->funcs.eval_defined)) (g, var, len);
return cp + paren; /* skip the right paren */ return cp + paren; /* skip the right paren */
} }
......
...@@ -195,18 +195,18 @@ int main(argc, argv) ...@@ -195,18 +195,18 @@ int main(argc, argv)
nargc = 1; nargc = 1;
if ((afd = open(argv[1]+1, O_RDONLY)) < 0) if ((afd = open(argv[1]+1, O_RDONLY)) < 0)
fatalerr("cannot open \"%s\"\n", argv[1]+1); fatalerr("cannot open \"%s\"\n", argv[1]+1);
fstat(afd, &ast); fstat(afd, &ast);
args = (char *)malloc(ast.st_size + 1); args = (char *)malloc(ast.st_size + 1);
if ((ast.st_size = read(afd, args, (size_t) ast.st_size)) < 0) if ((ast.st_size = read(afd, args, (size_t) ast.st_size)) < 0)
fatalerr("failed to read %s\n", argv[1]+1); fatalerr("failed to read %s\n", argv[1]+1);
args[ast.st_size] = '\0'; args[ast.st_size] = '\0';
close(afd); close(afd);
for (p = args; *p; p++) { for (p = args; *p; p++) {
if (quotechar) { if (quotechar) {
if (quotechar == '\\' || if (quotechar == '\\'
(*p == quotechar && p[-1] != '\\')) || (*p == quotechar && p[-1] != '\\'))
quotechar = '\0'; quotechar = '\0';
continue; continue;
} }
switch (*p) { switch (*p) {
...@@ -219,18 +219,18 @@ int main(argc, argv) ...@@ -219,18 +219,18 @@ int main(argc, argv)
case '\n': case '\n':
*p = '\0'; *p = '\0';
if (p > args && p[-1]) if (p > args && p[-1])
nargc++; nargc++;
break; break;
} }
} }
if (p[-1]) if (p[-1])
nargc++; nargc++;
nargv = (char **)malloc(nargc * sizeof(char *)); nargv = (char **)malloc(nargc * sizeof(char *));
nargv[0] = argv[0]; nargv[0] = argv[0];
argc = 1; argc = 1;
for (p = args; argc < nargc; p += strlen(p) + 1) for (p = args; argc < nargc; p += strlen(p) + 1)
if (*p) nargv[argc++] = p; if (*p) nargv[argc++] = p;
argv = nargv; argv = nargv;
} }
for(argc--, argv++; argc; argc--, argv++) { for(argc--, argv++; argc; argc--, argv++) {
/* if looking for endmarker then check before parsing */ /* if looking for endmarker then check before parsing */
...@@ -364,16 +364,16 @@ int main(argc, argv) ...@@ -364,16 +364,16 @@ int main(argc, argv)
*incp++ = PREINCDIR; *incp++ = PREINCDIR;
#endif #endif
if (incp >= includedirs + MAXDIRS) if (incp >= includedirs + MAXDIRS)
fatalerr("Too many -I flags.\n"); fatalerr("Too many -I flags.\n");
*incp++ = INCLUDEDIR; *incp++ = INCLUDEDIR;
#ifdef POSTINCDIR #ifdef POSTINCDIR
if (incp >= includedirs + MAXDIRS) if (incp >= includedirs + MAXDIRS)
fatalerr("Too many -I flags.\n"); fatalerr("Too many -I flags.\n");
*incp++ = POSTINCDIR; *incp++ = POSTINCDIR;
#endif #endif
} else if (*defincdir) { } else if (*defincdir) {
if (incp >= includedirs + MAXDIRS) if (incp >= includedirs + MAXDIRS)
fatalerr("Too many -I flags.\n"); fatalerr("Too many -I flags.\n");
*incp++ = defincdir; *incp++ = defincdir;
} }
...@@ -709,8 +709,8 @@ void redirect(line, makefile) ...@@ -709,8 +709,8 @@ void redirect(line, makefile)
} }
if (!found) { if (!found) {
if (verbose) if (verbose)
warning("Adding new delimiting line \"%s\" and dependencies...\n", warning("Adding new delimiting line \"%s\" and dependencies...\n",
line); line);
puts(line); /* same as fputs(fdout); but with newline */ puts(line); /* same as fputs(fdout); but with newline */
} else if (append) { } else if (append) {
while (fgets(buf, BUFSIZ, fdin)) { while (fgets(buf, BUFSIZ, fdin)) {
......
...@@ -70,11 +70,9 @@ int find_includes(struct filepointer *filep, struct inclist *file, struct inclis ...@@ -70,11 +70,9 @@ int find_includes(struct filepointer *filep, struct inclist *file, struct inclis
if (type == ELSE) if (type == ELSE)
find_includes(filep, file, find_includes(filep, file,
file_red, recursion+1, recfailOK, incCollection, symbols); file_red, recursion+1, recfailOK, incCollection, symbols);
else else if (type == ELIF)
if (type == ELIF)
goto doif; goto doif;
else else if ((type == ELIFFALSE) || (type == ELIFGUESSFALSE))
if ((type == ELIFFALSE) || (type == ELIFGUESSFALSE))
goto doiffalse; goto doiffalse;
break; break;
case IFDEF: case IFDEF:
...@@ -398,14 +396,14 @@ void define( def, symbols ) ...@@ -398,14 +396,14 @@ void define( def, symbols )
/* Separate symbol name and its value */ /* Separate symbol name and its value */
val = def; val = def;
while (isalnum(*val) || *val == '_') while (isalnum(*val) || *val == '_')
val++; val++;
if (*val) if (*val)
*val++ = '\0'; *val++ = '\0';
while (*val == ' ' || *val == '\t') while (*val == ' ' || *val == '\t')
val++; val++;
if (!*val) if (!*val)
val = "1"; val = "1";
hash_define( def, val, symbols ); hash_define( def, val, symbols );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment