sgmlpre/sgmlpre.l: Fix some "type defaults to 'int'" warnings.

There are some places where plain static is used, triggering a warning
if [-Wimplicit-int]. Use static int, it is anyway what the compiler is
considering. Same for main with no return type.

warning: type defaults to 'int' in declaration of 'whatever' [-Wimplicit-int]
  static nest;
  static ifsense;
  static firstoff;

warning: return type defaults to 'int' [-Wimplicit-int]
  main(int argc, char *argv[])
Signed-off-by: default avatarAgustin Martin Domingo <agmartin@debian.org>
parent 4799a5f4
......@@ -17,7 +17,7 @@
*
* This lexer requires flex. Limitations; attribute names may only be
* 256 chars long, values may be only 16384 (YY_BUF_SIZE) characters long.
* Doesn't do checking that only </if> matches <if> and </unless> matches
* Doesn't do checking that only </if> matches <if> and </unless> matches
* <unless> (that would need a stack and introduce another limit).
*/
#include <string.h>
......@@ -27,9 +27,9 @@
static char **selections; /* selection tokens */
static int nselections; /* number of selections */
static nest; /* how deep are we nested? */
static ifsense; /* sense of last `if' or unless seen */
static firstoff; /* nesting depth of first turnoff */
static int nest; /* how deep are we nested? */
static int ifsense; /* sense of last `if' or unless seen */
static int firstoff; /* nesting depth of first turnoff */
static char attribute[256]; /* last attribute scanned */
static int value_match(char *valu, char *against)
......@@ -42,7 +42,7 @@ static int value_match(char *valu, char *against)
printf("<%s, %s>", valu, against);
#endif /* DEBUG */
for (vp = valu; *vp; vp += vn)
for (vp = valu; *vp; vp += vn)
{
vn = strcspn(vp, "|");
for (ap = against; *ap; ap += an)
......@@ -52,7 +52,7 @@ static int value_match(char *valu, char *against)
return(TRUE);
if (ap[an] == '|')
an++;
}
}
if (vp[vn] == '|')
vn++;
}
......@@ -76,7 +76,7 @@ static int restrictP(char *attr, char *valu)
if (!value_match(valu, selections[i] + eqoffset + 1))
return(TRUE);
}
return(FALSE);
}
......@@ -127,7 +127,7 @@ WS [ \t\n]*
int yywrap() {exit(0);};
main(int argc, char *argv[])
int main(int argc, char *argv[])
{
int i;
......
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