67 lines
1.7 KiB
Text
67 lines
1.7 KiB
Text
$NetBSD: patch-ag,v 1.2 2005/06/19 20:44:06 minskim Exp $
|
|
|
|
--- reader.c.orig 2000-11-01 08:03:49.000000000 -0600
|
|
+++ reader.c
|
|
@@ -1,6 +1,5 @@
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
-#include <malloc.h>
|
|
|
|
#include "defs.h"
|
|
|
|
@@ -35,8 +34,8 @@ bucket **plhs;
|
|
int name_pool_size;
|
|
char *name_pool;
|
|
|
|
-char line_format[] = "#line %d \"%s\"\n";
|
|
-char jline_format[] = "#line %d \"%s\"\n";
|
|
+const char *line_format = "#line %d \"%s\"\n";
|
|
+const char *jline_format = "#line %d \"%s\"\n";
|
|
|
|
|
|
void cachec(int c)
|
|
@@ -315,11 +314,12 @@ char *t_cptr = t_line + (cptr - line - 2
|
|
if (line == 0)
|
|
unterminated_text(t_lineno, t_line, t_cptr);
|
|
}
|
|
- if (!lflag)/*rwj*/
|
|
+ if (!lflag) { /*rwj*/
|
|
if (jflag)
|
|
fprintf(f, jline_format, lineno, input_file_name);
|
|
else
|
|
fprintf(f, line_format, lineno, input_file_name);
|
|
+ }
|
|
|
|
loop:
|
|
c = *cptr++;
|
|
@@ -446,11 +446,12 @@ int c;
|
|
if (unionized) over_unionized(cptr - 6);
|
|
unionized = 1;
|
|
|
|
- if (!lflag)
|
|
+ if (!lflag) {
|
|
if (jflag)
|
|
fprintf(text_file, jline_format, lineno, input_file_name);
|
|
else
|
|
fprintf(text_file, line_format, lineno, input_file_name);
|
|
+ }
|
|
|
|
fprintf(text_file, "typedef union");
|
|
if (dflag) fprintf(union_file, "typedef union");
|
|
@@ -1190,7 +1191,7 @@ char *a_cptr = a_line + (cptr - line);
|
|
insert_empty_rule();
|
|
last_was_action = 1;
|
|
|
|
- if (!lflag)/*rwj*/
|
|
+ if (!lflag)/*rwj*/ {
|
|
if (jflag){
|
|
fprintf(f, "when %d\n", nrules - 2);
|
|
fprintf(f, jline_format, lineno, input_file_name);
|
|
@@ -1199,6 +1200,7 @@ char *a_cptr = a_line + (cptr - line);
|
|
fprintf(f, "%d:\n", nrules - 2);
|
|
fprintf(f, line_format, lineno, input_file_name);
|
|
};
|
|
+ }
|
|
|
|
if (*cptr == '=') ++cptr;
|
|
|