com_err: Tidy header includes
[openafs.git] / src / comerr / compile_et.c
index b96f97b..666ea6d 100644 (file)
 #undef MEMORYLEAK
 #include <afsconfig.h>
 #include <afs/param.h>
-#include <afs/afsutil.h>
-
-RCSID
-    ("$Header$");
 
-#include <stdio.h>
-#include <stdlib.h>
-
-#ifndef AFS_NT40_ENV
-#include <sys/file.h>
-#include <sys/param.h>
-#endif
+#include <roken.h>
 
-#include <errno.h>
-#include <string.h>
-#ifdef AFS_AIX32_ENV
-#include <signal.h>
-#endif
+#include <afs/afsutil.h>
 #include "mit-sipb-cr.h"
 #include "internal.h"
 #include "compiler.h"
@@ -57,7 +43,7 @@ extern int yylineno;
 char *
 xmalloc(unsigned int size)
 {
-    char *p = malloc(size);
+    char *p = (char *)malloc(size);
     if (!p) {
        perror(whoami);
        exit(1);
@@ -94,6 +80,7 @@ static const char *const language_names[] = {
 };
 
 static const char *const c_src_prolog[] = {
+    "#include <afsconfig.h>\n",
     "#include <afs/param.h>\n",
     "#include <afs/error_table.h>\n",
     "static const char * const text[] = {\n",
@@ -156,8 +143,8 @@ main(int argc, char **argv)
 
 #ifdef AFS_AIX32_ENV
     /*
-     * The following signal action for AIX is necessary so that in case of a 
-     * crash (i.e. core is generated) we can include the user's data section 
+     * The following signal action for AIX is necessary so that in case of a
+     * crash (i.e. core is generated) we can include the user's data section
      * in the core dump. Unfortunately, by default, only a partial core is
      * generated which, in many cases, isn't too useful.
      */
@@ -375,7 +362,7 @@ main(int argc, char **argv)
        fputs("static struct et_list etlink = { 0, &et};\n\n", cfile);
        fprintf(cfile, "void initialize_%s_error_table(void) {\n",
                table_name);
-       fputs("    add_to_error_table(&etlink);\n", cfile);
+       fputs("    afs_add_to_error_table(&etlink);\n", cfile);
        fputs("}\n", cfile);
        fclose(cfile);