Fix implicit declaration and default return type build warnings
authorMarius Gavrilescu <marius@ieval.ro>
Sat, 12 Sep 2015 18:00:55 +0000 (21:00 +0300)
committerJoey Hess <joeyh@joeyh.name>
Sat, 12 Sep 2015 21:15:27 +0000 (17:15 -0400)
cockney.l
jive.l
ky00te.dir/ky00te.yacc
newspeak.l
nyc.l

index 4cc1555dc2ff75c9096bba477586bd997258fc23..180068dff8b183e79858f3eb15ef01279986a141 100644 (file)
--- a/cockney.l
+++ b/cockney.l
@@ -17,13 +17,22 @@ EW [ \t.,;!\?$]
 
 %option noyywrap
 
-%%
-
 %{
-void eos();
-void plastc();
+#include<time.h>
+void eos(void);
+void plastc(void);
+char caseify(char);
+void I(void);
+void bloody(void);
+void set_did(short);
+void clear_did(void);
+void dintI(void);
+void pooped(void);
+void expletive(void);
 %}
 
+%%
+
 <junk>.                        {       srandom(time(0L)); unput(yytext[0]); BEGIN 0; }
 {BW}[Tt]he{EW}         {       ECHO; bloody(); }
 {BW}[Ss]teal{EW}       {       printf("%c%cick",yytext[0],yytext[1]-5);
@@ -110,7 +119,7 @@ void plastc()
     unput(yytext[yyleng-1]);
 }
 
-caseify(c)
+char caseify(c)
 char c;
 {
     if (yytext[0] <= 'Z')
@@ -120,7 +129,7 @@ char c;
 }
 
 
-I()
+void I()
 {
 /*    extern long random(); */
 
@@ -133,7 +142,7 @@ I()
 static short b_count = 0;
 static short b_which = 0;
 
-bloody()
+void bloody()
 {
        if (b_count++ % 2 == 0) {
                switch (b_which++ % 4) {
@@ -147,17 +156,18 @@ bloody()
 
 static short did = 0;
 
-set_did(val)
+void set_did(val)
+short val;
 {
     did = val;
 }
 
-clear_did()
+void clear_did()
 {
     did = 0;
 }
 
-dintI()
+void dintI()
 {
 /*    extern long random(); */
 
@@ -170,7 +180,7 @@ dintI()
     clear_did();
 }
 
-pooped()
+void pooped()
 {
 /*    extern long random(); */
 
@@ -187,7 +197,7 @@ pooped()
        }
 }
 
-expletive()
+void expletive()
 {
 /*
 Blimey
diff --git a/jive.l b/jive.l
index f8a1386d11506e58ae030bd40ea34684754f406a..ff6d21f10e698cb32899fd7d19b681e69de4eedf 100644 (file)
--- a/jive.l
+++ b/jive.l
 BW [ \t\(]
 EW [ \t.,;!\?$\)]
 %option noyywrap
-%%
 
 %{
-    void plastc();
+    void plastc(void);
+    char caseify(char);
+    void expletive(void);
+    void thing(char);
 %}
 
+%%
+
 @[Bb]egin(.*)          |
 ".so ".*$                      printf("%s", yytext);
 {BW}send                       printf("%ct'row",yytext[0]);
@@ -207,7 +211,7 @@ void plastc()
     unput(yytext[yyleng-1]);
 }
 
-caseify(c)
+char caseify(c)
 char c;
 {
        if (yytext[0] <= 'Z')
@@ -216,7 +220,7 @@ char c;
                return (c);
 }
 
-thing(c)
+void thing(c)
 char c;
 {
        static short    count = 0;
@@ -234,7 +238,8 @@ char c;
                        break;
                }
 }
-expletive()
+
+void expletive()
 {
        static short    count = 0;
        static short    which = 0;
index 4254394bcfb1c9761eb56e3c649cf28925c2eb6f..50e21821abac3acafc497d324b3d9efb61747734 100644 (file)
@@ -1,9 +1,12 @@
 %{
 
 #include <stdio.h>
+#include <stdlib.h>
 typedef int INT;
 
 #define YYSTYPE INT
+extern int yylex (void);
+int yyerror(char*);
 
 %}
 
index 4b2928e658386d57833935fe0b37b04a9f0478dc..8e7844b8ce41bb18a4b8dfbe102d8567d6a78e00 100644 (file)
@@ -51,6 +51,12 @@ unsigned int fcounter = 0;
 #define WCOMP(string1,string2) compstring(Y0,(string1),(string2),1)
 
 #define        DUMP()                  printf("%s",yytext)
+
+void capstring(char, char*, int);
+void compstring(char, char*, char*, int);
+char _caseify(char, int);
+char caseify(char);
+
 %}
 
 %e 8000
@@ -643,14 +649,14 @@ robably|ventually|[Oo]bvious|[Bb]asic|{W}[Oo]nly|otally   |
 %}
 
 %%
-main()
+int main()
 {
        yylex();
        printf("\nHail Big Brother!\n");
 }
 
 
-capstring(firstchar,string,i)
+void capstring(firstchar,string,i)
     char firstchar, *string;
     int i;
 {
@@ -659,7 +665,7 @@ capstring(firstchar,string,i)
        printf("%s",string+1);
 }
 
-compstring(firstchar,string1,string2,i)
+void compstring(firstchar,string1,string2,i)
     char firstchar, *string1, *string2;
     int i;
 {
@@ -667,7 +673,7 @@ compstring(firstchar,string1,string2,i)
        capstring(0,string2,i);
 }
 
-_caseify(c,i)
+char _caseify(c,i)
     char c;
     int i;
 {
@@ -675,7 +681,7 @@ _caseify(c,i)
        else return (c);
 }
 
-caseify(c)
+char caseify(c)
     char c;
 {
        return _caseify(c,0);
diff --git a/nyc.l b/nyc.l
index 509979e5298647d6f554fa4522407cf68528345d..ddc5dbeaa5142e9434d357aaf90e72347a4ab022 100644 (file)
--- a/nyc.l
+++ b/nyc.l
@@ -12,10 +12,13 @@ BW [ \t]
 SP [ \t]
 EW [ \t.,;!\?$]
 
-%%
 %{
-    void plastc();
+    void plastc(void);
+    char caseify(char);
+    void expletive(void);
 %}
+
+%%
 ".so ".*$                      printf("%s", yytext);
 [ao]ther                       printf("%cdder", yytext[0]=='a'?'a':'u');
 [Nn]othing                     printf("%cuttin'", yytext[0]);
@@ -76,7 +79,7 @@ void plastc()
     yyunput(yytext[yyleng-1], yytext);
 }
 
-caseify(c)
+char caseify(c)
 char c;
 {
        if (yytext[0] <= 'Z')
@@ -88,7 +91,7 @@ char c;
 short  count = 0;
 short  which = 0;
 
-expletive()
+void expletive()
 {
        if (count++ % 4 == 0) {
                switch (which++ % 5) {
This page took 0.021351 seconds and 4 git commands to generate.