changeset 2:ec2f8f6f1dc9

Cleanup pass #1: Get rid of some ancient K&R-isms.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 24 Feb 2015 20:28:57 +0200
parents cfcae2ef1c2b
children a07eb3757bf0
files dump.c label.c main.c proto.h scan.c table.c vector.c
diffstat 7 files changed, 34 insertions(+), 156 deletions(-) [+]
line wrap: on
line diff
--- a/dump.c	Tue Feb 24 18:54:50 2015 +0200
+++ b/dump.c	Tue Feb 24 20:28:57 2015 +0200
@@ -41,12 +41,7 @@
 #include "options.h"
 #include "opcodes.h"
 
-#ifndef __STDC__
-void
-Dump ()
-#else
 void Dump (void)
-#endif
 {
   ADDR_T address, addr;
   unsigned counter, size, maxwidth;
--- a/label.c	Tue Feb 24 18:54:50 2015 +0200
+++ b/label.c	Tue Feb 24 20:28:57 2015 +0200
@@ -43,14 +43,8 @@
 char defaultlabel[6];
 unsigned numLabels = 0;
 
-#ifndef __STDC__
-void
-AddLabel (address, name)
-     ADDR_T address;
-     char *name;
-#else
+
 void AddLabel (ADDR_T address, char *name)
-#endif
 {
   label *entry;
   char *buffer;
@@ -72,14 +66,8 @@
   while ((*buffer++ = *name++));
 }
 
-#ifndef __STDC__
-char *
-Label (address, admode)
-     ADDR_T address;
-     int admode;
-#else
+
 char *Label (ADDR_T address, int admode)
-#endif
 {
   label *entry;
 
@@ -103,12 +91,8 @@
   return defaultlabel;
 }
 
-#ifndef __STDC__
-void
-Collect ()
-#else
+
 void Collect (void)
-#endif
 {
   unsigned counter = 0;
   table *entry = NULL, *entry2;
--- a/main.c	Tue Feb 24 18:54:50 2015 +0200
+++ b/main.c	Tue Feb 24 20:28:57 2015 +0200
@@ -47,14 +47,8 @@
 #include "options.h"
 #include "opcodes.h"
 
-#ifndef __STDC__
-int
-main (argc, argv)
-     int argc;
-     char **argv;
-#else
+
 int main (int argc, char **argv)
-#endif
 {
   FILE *file;
   unsigned address1, address2;
--- a/proto.h	Tue Feb 24 18:54:50 2015 +0200
+++ b/proto.h	Tue Feb 24 20:28:57 2015 +0200
@@ -31,42 +31,36 @@
 
 #include "structures.h"
 
-#ifdef __STDC__
-#define PROTO(x) x
-#else
-#define PROTO(x) ()
-#endif
-
 /* scan.c */
 
-int ScanSpecified PROTO((void));   /* scan all "sure" routines */
-void ScanPotentials PROTO((void)); /* scan the "potential" routines */
-void ScanTheRest PROTO((void));    /* scan unprocessed memory places
+int ScanSpecified(void);   /* scan all "sure" routines */
+void ScanPotentials(void); /* scan the "potential" routines */
+void ScanTheRest(void);    /* scan unprocessed memory places
                                       for routines */
 
 /* table.c */
 
-table *FindNextEntryType PROTO((table *entry, unsigned char andmask,
-                                unsigned char eormask));
-table *FindNextEntryTypeParent PROTO((table *entry, ADDR_T parent,
+table *FindNextEntryType(table *entry, unsigned char andmask,
+                                unsigned char eormask);
+table *FindNextEntryTypeParent(table *entry, ADDR_T parent,
                                       unsigned char andmask,
-                                      unsigned char eormask));
-table *FindNextEntry PROTO((table *entry, ADDR_T address,
-                            unsigned char andmask, unsigned char eormask));
-void AddEntry PROTO((ADDR_T address, ADDR_T parent, unsigned char type));
-void DeleteEntry PROTO((table *entry));
+                                      unsigned char eormask);
+table *FindNextEntry(table *entry, ADDR_T address,
+                            unsigned char andmask, unsigned char eormask);
+void AddEntry(ADDR_T address, ADDR_T parent, unsigned char type);
+void DeleteEntry(table *entry);
 
 /* label.c */
 
-void AddLabel PROTO((ADDR_T address, char *name));
-char *Label PROTO((ADDR_T address, int admode));
-void Collect PROTO((void)); /* garbage collection */
+void AddLabel(ADDR_T address, char *name);
+char *Label(ADDR_T address, int admode);
+void Collect(void); /* garbage collection */
 
 /* vector.c */
 
-void SearchVectors PROTO((void));
-ADDR_T WordTableEnd PROTO((ADDR_T Start));
+void SearchVectors(void);
+ADDR_T WordTableEnd(ADDR_T Start);
 
 /* dump.c */
 
-void Dump PROTO((void)); /* dump the program */
+void Dump(void); /* dump the program */
--- a/scan.c	Tue Feb 24 18:54:50 2015 +0200
+++ b/scan.c	Tue Feb 24 20:28:57 2015 +0200
@@ -35,18 +35,8 @@
 #include "opcodes.h"
 #include "options.h"
 
-int ScanSure PROTO((ADDR_T scanstart));
-int ScanPotential PROTO((ADDR_T scanstart));
-void UnDoScan PROTO((ADDR_T scanstart));
-void DeleteSuspectedParents PROTO((ADDR_T child));
 
-#ifndef __STDC__
-int
-ScanSure (scanstart)
-     ADDR_T scanstart;
-#else
 int ScanSure (ADDR_T scanstart)
-#endif
 {
   ADDR_T address, addr;
   opcodes *instr;
@@ -297,13 +287,8 @@
   return 0;
 }
 
-#ifndef __STDC__
-int
-ScanPotential (scanstart)
-     ADDR_T scanstart;
-#else
+
 int ScanPotential (ADDR_T scanstart)
-#endif
 {
   ADDR_T address, addr;
   opcodes *instr;
@@ -574,12 +559,8 @@
   return 1;
 }
 
-#ifndef __STDC__
-int
-ScanSpecified ()
-#else
+
 int ScanSpecified (void)
-#endif
 {
   table *entry;
 
@@ -604,13 +585,8 @@
   return 0;
 }
 
-#ifndef __STDC__
-void
-UnDoScan (scanstart)
-     ADDR_T scanstart;
-#else
+
 void UnDoScan (ADDR_T scanstart)
-#endif
 {
   opcodes *instr;
   unsigned counter;
@@ -648,13 +624,8 @@
   }
 }
 
-#ifndef __STDC__
-void
-DeleteSuspectedParents (child)
-     ADDR_T child;
-#else
+
 void DeleteSuspectedParents (ADDR_T child)
-#endif
 {
   table *entry = NULL;
 
@@ -686,12 +657,8 @@
   UnDoScan (child);
 }
 
-#ifndef __STDC__
-void
-ScanPotentials ()
-#else
+
 void ScanPotentials (void)
-#endif
 {
   table *entry;
   ADDR_T address;
@@ -781,12 +748,8 @@
   }
 }
 
-#ifndef __STDC__
-void
-ScanTheRest ()
-#else
+
 void ScanTheRest (void)
-#endif
 {
   ADDR_T address;
   table *entry;
--- a/table.c	Tue Feb 24 18:54:50 2015 +0200
+++ b/table.c	Tue Feb 24 20:28:57 2015 +0200
@@ -37,16 +37,9 @@
 
 static unsigned int firstunused = 0;
 
-#ifndef __STDC__
-table *
-FindNextEntryType (entry, andmask, eormask)
-     table *entry;
-     unsigned char andmask;
-     unsigned char eormask;
-#else
+
 table *FindNextEntryType (table *entry, unsigned char andmask,
                           unsigned char eormask)
-#endif
 {
   if (!scantable) return NULL;
 
@@ -62,17 +55,9 @@
   return NULL;
 }
 
-#ifndef __STDC__
-table *
-FindNextEntryTypeParent (entry, parent, andmask, eormask)
-     table *entry;
-     ADDR_T parent;
-     unsigned char andmask;
-     unsigned char eormask;
-#else
+
 table *FindNextEntryTypeParent (table *entry, ADDR_T parent,
                             unsigned char andmask, unsigned char eormask)
-#endif
 {
   if (!scantable) return NULL;
 
@@ -90,17 +75,9 @@
   return NULL;
 }
 
-#ifndef __STDC__
-table *
-FindNextEntry (entry, address, andmask, eormask)
-     table *entry;
-     ADDR_T address;
-     unsigned char andmask;
-     unsigned char eormask;
-#else
+
 table *FindNextEntry (table *entry, ADDR_T address,
                       unsigned char andmask, unsigned char eormask)
-#endif
 {
   if (!scantable) return NULL;
 
@@ -117,15 +94,8 @@
   return NULL;
 }
 
-#ifndef __STDC__
-void
-AddEntry (address, parent, type)
-     ADDR_T address;
-     ADDR_T parent;
-     unsigned char type;
-#else
+
 void AddEntry (ADDR_T address, ADDR_T parent, unsigned char type)
-#endif
 {
   if (firstunused < entrycount) {
     scantable[firstunused].address = address;
@@ -147,13 +117,8 @@
   }
 }
 
-#ifndef __STDC__
-void
-DeleteEntry (entry)
-     table *entry;
-#else
+
 void DeleteEntry (table *entry)
-#endif
 {
   entry -> type = TBL_DELETED;
 
--- a/vector.c	Tue Feb 24 18:54:50 2015 +0200
+++ b/vector.c	Tue Feb 24 20:28:57 2015 +0200
@@ -40,16 +40,8 @@
 unsigned WordCount = 0;
 words *WordTable = NULL;
 
-void AddWordEntry PROTO((ADDR_T start, ADDR_T end));
 
-#ifndef __STDC__
-void
-AddWordEntry (start, end)
-     ADDR_T start;
-     ADDR_T end;
-#else
 void AddWordEntry (ADDR_T start, ADDR_T end)
-#endif
 {
   words *entry;
 
@@ -65,13 +57,8 @@
   entry->end = end;
 }
 
-#ifndef __STDC__
-ADDR_T
-WordTableEnd (start)
-     ADDR_T start;
-#else
+
 ADDR_T WordTableEnd (ADDR_T start)
-#endif
 {
   words *entry;
 
@@ -85,12 +72,8 @@
   return start;
 }
 
-#ifndef __STDC__
-void
-SearchVectors ()
-#else
+
 void SearchVectors (void)
-#endif
 {
   ADDR_T start, end, address;