--- asearch1.c.orig	1992-01-18 08:00:38.000000000 +1100
+++ asearch1.c	2012-09-22 16:45:50.000000000 +1000
@@ -8,7 +8,7 @@ extern char CurrentFileName[];
 extern int num_of_matched;
 
 
-asearch1(old_D_pat, Text, D)
+void asearch1(old_D_pat, Text, D)
 char old_D_pat[]; int Text; register unsigned D;
 {
   register unsigned end, i, r1, r2, r3, r4, r5, CMask, D_Mask, Init0, k, endpos; 
--- bitap.c.orig	1992-01-18 08:00:15.000000000 +1100
+++ bitap.c	2012-09-22 16:48:16.000000000 +1000
@@ -22,7 +22,7 @@ extern int num_of_matched;
 
 /* bitap dispatches job */
 
-bitap(old_D_pat, Pattern, fd, M, D)
+void bitap(old_D_pat, Pattern, fd, M, D)
 char old_D_pat[], *Pattern;  int fd, M, D;  
 {
 char c;  
--- checkfile.c.orig	1992-01-18 06:14:42.000000000 +1100
+++ checkfile.c	2012-09-22 16:56:42.000000000 +1000
@@ -66,6 +66,7 @@ int ftype;
       }
 */
     }
+    return 0;
 }
 
 /***************************************************************************
--- compat.c.orig	1992-01-22 00:36:26.000000000 +1100
+++ compat.c	2012-09-22 17:04:50.000000000 +1000
@@ -53,5 +53,5 @@ int i, j, k;
 			exit(2);
 		}
 	}
-
+	return 0;
 }
--- asearch.c.orig	1992-01-24 12:49:08.000000000 +1100
+++ asearch.c	2012-09-22 17:08:18.000000000 +1000
@@ -6,7 +6,9 @@ extern int DELIMITER, FILENAMEONLY, INVE
 extern CHAR CurrentFileName[];
 extern int I, num_of_matched, TRUNCATE;
 
-asearch(old_D_pat, text, D)
+void asearch0(CHAR old_D_pat[], int text, register unsigned D);
+
+void asearch(old_D_pat, text, D)
 CHAR old_D_pat[]; int text; register unsigned D;
 {
   register unsigned i, c, r1, r2, CMask, r_NO_ERR, r_Init1; 
@@ -178,7 +180,7 @@ Nextchar1: i=i+1;
   return;
 }
 
-asearch0(old_D_pat, text, D)
+void asearch0(old_D_pat, text, D)
 CHAR old_D_pat[]; int text; register unsigned D;
 {
   register unsigned i, c, r1, r2, r3, CMask, r_NO_ERR, r_Init1,  end, endpos; 
--- main.c.orig	1992-04-15 06:41:24.000000000 +1000
+++ main.c	2012-09-22 17:43:47.000000000 +1000
@@ -33,7 +33,7 @@ int  NOFILENAME = 0,  /* Boolean flag, s
 extern int init();
 int table[WORD][WORD];
 
-initial_value()
+void initial_value()
 {
    int i; 
 
@@ -51,7 +51,7 @@ initial_value()
    for (i=0; i< MAXSYM; i++) Mask[i] = 0;
 }
 
-compute_next(M, Next, Next1)
+void compute_next(M, Next, Next1)
 int M; unsigned *Next, *Next1;
 {
   int i, j=0, n,  k, temp;
@@ -118,6 +118,8 @@ int m;
   return(ex);
 }
 
+void r_output (CHAR *buffer, int i, int end, int j);
+
 re1(Text, M, D)
 int Text, M, D;
 {
@@ -181,7 +183,7 @@ int Text, M, D;
                    if(FILENAMEONLY) {
                           num_of_matched++;
                           printf("%s\n", CurrentFileName);
-                          return;
+                          return 0;
                    } 
                    r_output(buffer, i-1, end, j);
               }
@@ -207,7 +209,7 @@ int Text, M, D;
                    if(FILENAMEONLY) {
                           num_of_matched++;
                           printf("%s\n", CurrentFileName);
-                          return;
+                          return 0;
                    } 
                    r_output(buffer, i-1, end, j);
               }
@@ -218,7 +220,7 @@ int Text, M, D;
       } /* while i < end ... */
       strncpy(buffer, buffer+num_read, Maxline);
     } /* end while read()... */
-  return;
+  return 0;
   } /*  end if (D == 0) */
   while ((num_read = read(Text, buffer + Maxline, BlockSize)) > 0)
   {
@@ -294,7 +296,7 @@ int Text, M, D;
                    if(FILENAMEONLY) {
                           num_of_matched++;
                           printf("%s\n", CurrentFileName);
-                          return;
+                          return 0;
                    } 
                    r_output(buffer, i, end, j);
               }
@@ -372,7 +374,7 @@ Nextchar: i=i+1;
                    if(FILENAMEONLY) {
                           num_of_matched++;
                           printf("%s\n", CurrentFileName);
-                          return;
+                          return 0;
                    } 
                    r_output(buffer, i, end, j);
               }
@@ -390,7 +392,7 @@ Nextchar1: i=i+1;
     } /* while */
     strncpy(buffer, buffer+num_read, Maxline);
   } /* while */
-  return;
+  return 0;
 } /* re1 */
 
 re(Text, M, D)
@@ -447,7 +449,7 @@ int Text, M, D;
                    if(FILENAMEONLY) {
                           num_of_matched++;
                           printf("%s\n", CurrentFileName);
-                          return;
+                          return 0;
                    } 
                    r_output(buffer, i-1, end, j);
               }
@@ -470,7 +472,7 @@ int Text, M, D;
                    if(FILENAMEONLY) {
                           num_of_matched++;
                           printf("%s\n", CurrentFileName);
-                          return;
+                          return 0;
                    } 
                    r_output(buffer, i-1, end, j);
               }
@@ -485,7 +487,7 @@ int Text, M, D;
       strncpy(buffer+Maxline-ResidueSize, buffer+lasti, ResidueSize);
       lasti = Maxline - ResidueSize;
     } /* while */
-  return;
+  return 0;
   } /* end if(D==0) */
   while ((num_read = read(Text, buffer + Maxline, BlockSize)) > 0)
   {
@@ -533,7 +535,7 @@ int Text, M, D;
                    if(FILENAMEONLY) {
                           num_of_matched++;    
                           printf("%s\n", CurrentFileName);
-                          return;
+                          return 0;
                    }  
                    r_output(buffer, i-1, end, j);
               }
@@ -574,7 +576,7 @@ Nextchar: 
                    if(FILENAMEONLY) {
                           num_of_matched++;
                           printf("%s\n", CurrentFileName);
-                          return;
+                          return 0;
                    } 
                    r_output(buffer, i, end, j);
               }
@@ -591,11 +593,11 @@ Nextchar1: i++;
     } /* while i < end */
     strncpy(buffer, buffer+num_read, Maxline);
   } /* while  read() */
-  return;
+  return 0;
 } /* re */
 
 
-r_output (buffer, i, end, j) 
+void r_output (buffer, i, end, j) 
 int i, end, j; 
 CHAR *buffer;
 {
@@ -612,6 +614,8 @@ int bp;
       while (bp <= i ) putchar(buffer[bp++]);
 }
 
+void checksg(CHAR *Pattern, int D);
+
 main(argc, argv)
 int argc; char *argv[];
 {
@@ -942,7 +946,7 @@ usage()
     	exit(2);
 }
 
-checksg(Pattern, D) 
+void checksg(Pattern, D) 
 CHAR *Pattern; int D;
 {                          
   char c;
@@ -1003,10 +1007,10 @@ output (buffer, i1, i2, j)  
 register CHAR *buffer; int i1, i2, j;
 {
 register CHAR *bp, *outend;
-	if(i1 > i2) return;
+	if(i1 > i2) return 0;
         num_of_matched++;
-        if(COUNT)  return;
-        if(SILENT) return;
+        if(COUNT)  return 0;
+        if(SILENT) return 0;
 	if(OUTTAIL) {
               i1 = i1 + D_length;
               i2 = i2 + D_length;
@@ -1031,6 +1035,7 @@ register CHAR *bp, *outend;
 	bp = buffer + i1;
 	outend = buffer + i2;
 	while(bp <= outend) putchar(*bp++);
+	return 0;
 }
 
 /* end of main.c */
--- preprocess.c.orig	1992-01-18 06:14:43.000000000 +1100
+++ preprocess.c	2012-09-22 17:59:15.000000000 +1000
@@ -207,9 +207,9 @@ CHAR *D_pattern, *Pattern;
         exit(2);
      }
   strcpy(old_pat, Pattern); /* do real change to the Pattern to be returned */
-  return;
+  return 0;
   } /* if regex */
 
-  return;
+  return 0;
 }
 
--- sgrep.c.orig	1992-04-11 08:12:02.000000000 +1000
+++ sgrep.c	2012-09-22 19:08:01.000000000 +1000
@@ -39,7 +39,7 @@ unsigned Hashmask;
 char MEMBER_1[MAXMEMBER_1];
 CHARTYPE TR[MAXSYM];
 
-char_tr(pat, m)
+void char_tr(pat, m)
 	unsigned char *pat;
 	int *m;
 {
@@ -64,6 +64,12 @@ unsigned char temp[MAXPATT];
 	}
 }
 
+void bm(CHARTYPE *pat, int m, CHARTYPE *text, CHARTYPE *textend);
+void agrep(register CHARTYPE *pat, int M, register CHARTYPE *text, register CHARTYPE *textend, int D);
+void a_monkey(register CHARTYPE *pat, register int m, register CHARTYPE *text, register CHARTYPE *textend, register int D);
+void monkey(register CHARTYPE *pat, register int m, register CHARTYPE *text, register CHARTYPE *textend);
+void monkey4(register unsigned char *pat, register int m, register unsigned char *text, register unsigned char *textend, register int D);
+
 sgrep(pat, m, fd, D)
 CHARTYPE *pat;  int fd, m, D;
 { 
@@ -112,7 +118,7 @@ CHARTYPE *pat;  int fd, m, D;
        }
        if(FILENAMEONLY && num_of_matched) {
             printf("%s\n", CurrentFileName);
-            return; }
+            return 0; }
        start = offset - residue ;
        if(start < MAXLINE) {
             start = MAXLINE; 
@@ -120,13 +126,13 @@ CHARTYPE *pat;  int fd, m, D;
        strncpy(text+start, text+end, residue);
        start++;
     } /* end of while(num_read = ... */
-    return;
+    return 0;
 } /* end sgrep */
 
 /* SUN: bm assumes that the content of text[n]...text[n+m-1] is 
 pat[m-1] such that the skip loop is guaranteed to terminated */
 
-bm(pat, m, text, textend)
+void bm(pat, m, text, textend)
 	CHARTYPE *text, *textend, *pat;  int m;
 {
 register int shift;
@@ -200,6 +206,7 @@ CHARTYPE *pattern; unsigned *Mask; regis
            if( c == pattern[j] )
                Mask[c] = Mask[c] & ~( Bit1 >> j ) ;
   }
+  return 0;
 }
 
 prep(Pattern, M, D)             /* preprocessing for partitioning_bm */
@@ -247,10 +254,12 @@ unsigned hash, b_size = 3;
 #endif
 		MEMBER[hash] = 1;
 	}
+	return 0;
 }
 
+void s_output(CHARTYPE *text, int *i);
 
-agrep( pat, M, text, textend, D ) 
+void agrep( pat, M, text, textend, D ) 
 int M, D ; register CHARTYPE *text, *textend, *pat;
 {
   register int i;
@@ -357,7 +366,7 @@ int M, D ; register CHARTYPE *text, *tex
   return;
 }
 
-s_output (text, i) 
+void s_output (text, i) 
 int *i; CHARTYPE *text;
 {
 int kk, bp;
@@ -404,7 +413,7 @@ unsigned char lastc;
 
 /* a_monkey() the approximate monkey move */
 
-a_monkey( pat, m, text, textend, D ) 
+void a_monkey( pat, m, text, textend, D ) 
 register int m, D ; register CHARTYPE *text, *textend, *pat;
 {
 register CHARTYPE *oldtext;
@@ -451,7 +460,7 @@ register int  m1 = m-1-D, j, pos; 
 
 CHARTYPE SHIFT_2[MAX_SHIFT_2];
 
-monkey( pat, m, text, textend  ) 
+void monkey( pat, m, text, textend  ) 
 register int m  ; register CHARTYPE *text, *textend, *pat;
 {
 register unsigned hash, i; 
@@ -589,13 +598,14 @@ unsigned hash;
 	}
 	if(shift_1 == 0) shift_1 = 1;
 	SHIFT_2[0] = 0;
+	return 0;
 }
 
 /* monkey4() the approximate monkey move */
 
 char *MEMBER_D;
 
-monkey4( pat, m, text, textend, D  ) 
+void monkey4( pat, m, text, textend, D  ) 
 register int m, D ; register unsigned char *text, *pat, *textend;
 {
 register unsigned char *oldtext;
@@ -670,6 +680,7 @@ char_map['n'] = char_map['n'] = 5;
 	       MEMBER_D[hash] = 1;
             }
         }
+    return 0;
 }
 
 blog(base, m )
--- mgrep.c.orig	1992-04-11 08:12:27.000000000 +1000
+++ mgrep.c	2012-09-22 19:17:16.000000000 +1000
@@ -36,6 +36,7 @@ unsigned char pat_spool[MAXPATFILE+2*max
 unsigned char *patt[max_num];
 unsigned char pat_len[max_num];
 
+void f_prep(int pat_index, unsigned char *Pattern);
 
 prepf(fp)
 int fp;
@@ -95,8 +96,12 @@ int fp;
 	HASH[i] = 0;
     }
     for(i=1; i<= num_pat; i++) f_prep(i, patt[i]);
+    return 0;
 }
 
+void monkey1(register unsigned char *text, int start, int end);
+void m_short(register unsigned char *text, int start, int end);
+void countline(unsigned char *text, int len);
 
 mgrep(fd)
 int fd;
@@ -119,7 +124,7 @@ int fd;
        else      monkey1(text, start, end);
        if(FILENAMEONLY && num_of_matched) {
 		printf("%s\n", CurrentFileName);
-		return;
+		return 0;
        }
        start = MAXLINE - residue;
        if(start < 0) {
@@ -133,10 +138,10 @@ int fd;
         if(SHORT) m_short(text, start, end);
         else      monkey1(text, start, end);
     }
-    return;
+    return 0;
 } /* end mgrep */
 
-countline(text, len)
+void countline(text, len)
 unsigned char *text; int len;
 {
 int i;
@@ -144,7 +149,7 @@ int i;
 }
 
 
-monkey1( text, start, end  ) 
+void monkey1( text, start, end  ) 
 int start, end; register unsigned char *text;
 {
 register unsigned char *textend;
@@ -232,7 +237,7 @@ while (text <= textend) {
   if(INVERSE && !COUNT) while(lastout <= textend) putchar(*lastout++);
 }
 
-m_short( text, start, end  ) 
+void m_short( text, start, end  ) 
 int start, end; register unsigned char *text;
 {
 register unsigned char *textend;
@@ -292,7 +297,7 @@ while (++text <= textend) {
   if(INVERSE && !COUNT) while(lastout <= textend) putchar(*lastout++);
 }
 
-f_prep(pat_index, Pattern)
+void f_prep(pat_index, Pattern)
 unsigned char *Pattern ; int pat_index;
 {
 int i, j, m;
