$NetBSD$

- use standard headers
- don't croak on platforms where char is unsigned
- const correctness demanded by recent gcc
- declare main's return type
- should match patch-ag

--- hcc/hcc.hc.orig	2011-12-20 14:59:27.000000000 +0000
+++ hcc/hcc.hc
@@ -1,6 +1,5 @@
-#include "bool.h"
 #include "stdio.h"
-#include "std.h"
+#include "stdlib.h"
 #include "string.h"
 #include "ctype.h"
 
@@ -39,7 +38,7 @@ FILE *src;
 
 
 
-void f_open (FILE *&f, char name [], char mode [])
+void f_open (FILE *&f, const char name [], const char mode [])
   {f = fopen (name, mode);
    check_error;
 
@@ -53,7 +52,7 @@ void f_open (FILE *&f, char name [], cha
   }
 
 
-char *substring (char s [], int from)
+char *substring (const char s [], int from)
   {static bool is_init = false;
    static char *result;
 
@@ -74,7 +73,7 @@ char *substring (char s [], int from)
 
   }
 
-char *substring (char s [], int from, int to)
+char *substring (const char s [], int from, int to)
   {static bool is_init = false;
    static char *result;
 
@@ -101,8 +100,8 @@ char *substring (char s [], int from, in
 
 void changeall (char s           [], 
                 int  max_length_of_s,
-                char tmplate     [],
-                char replacement [])
+                const char tmplate     [],
+                const char replacement [])
 
   {char *pos;
 
@@ -147,7 +146,7 @@ void changeall (char s           [], 
 
   }
  
-char *complete (char name [], char tail [])
+char *complete (const char name [], const char tail [])
   {static char r [256];
 
    strcpy (r, name);
@@ -198,7 +197,7 @@ void dump_line_cor ()
      };
   }
 
-void pass_1_error (int line_no, char msg [], int l)
+void pass_1_error (int line_no, const char msg [], int l)
   {char err_msg [256];
    char ii      [128];
 
@@ -210,7 +209,7 @@ void pass_1_error (int line_no, char msg
    exit      (1);
   }
 
-void pass_1_error (int line_no, char msg [])
+void pass_1_error (int line_no, const char msg [])
   {fclose (src);
    printf ("error : %d : %s\n", line_no, msg);
    exit   (1);
@@ -226,7 +225,7 @@ bool pass_1 (char src_name [])
    char last_last_sym;
    int  last_ref_sym_line;
    int  last_ref_sym_no;
-   char sym;
+   signed char sym;
    int  nested_brackets;
    bool inside_refinement;
    bool inside_string;
@@ -883,7 +882,7 @@ void pass_3 (char src_name [])
 
   }
 
-main (int num_params, char *shell_params [])
+int main (int num_params, char *shell_params [])
   {char gcc_exec [256];
    char src_name [256];
    char options  [256];
