[xml/sgml-commit] [linuxdoc-tools] 11/12: sgmlpre/sgmlpre.l: Fix some "type defaults to 'int'" warnings.

Agustín Martín Domingo agmartin at moszumanska.debian.org
Thu Oct 8 17:28:12 UTC 2015


This is an automated email from the git hooks/post-receive script.

agmartin pushed a commit to branch upstream
in repository linuxdoc-tools.

commit d86b9c789b148ce299d9dab315d882c1adddd341
Author: Agustin Martin Domingo <agmartin at debian.org>
Date:   Thu Oct 8 17:12:04 2015 +0200

    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: Agustin Martin Domingo <agmartin at debian.org>
---
 sgmlpre/sgmlpre.l | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/sgmlpre/sgmlpre.l b/sgmlpre/sgmlpre.l
index 67f4768..55e94e1 100644
--- a/sgmlpre/sgmlpre.l
+++ b/sgmlpre/sgmlpre.l
@@ -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;
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-xml-sgml/linuxdoc-tools.git



More information about the debian-xml-sgml-commit mailing list