aboutsummaryrefslogtreecommitdiff
path: root/devel/cflow/files/patch-prcc.c
blob: 32972f609f7c4206a4451f840a03c4a0f48f7ca4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
--- prcc.c.orig	1995-02-16 13:36:48.000000000 +0800
+++ prcc.c	2011-09-16 09:32:36.000000000 +0800
@@ -13,6 +13,7 @@ static char *version = "$Revision: 1.4 $
 #include <string.h>
 #include <stdlib.h>
 #include <assert.h>
+#include <unistd.h>
 
 typedef enum { FALSE=0, TRUE=1 } BOOLEAN;
 
@@ -66,7 +67,7 @@ static void usage(void)
 	exit(2);
 }
 
-void main(int argc, char **argv)
+int main(int argc, char **argv)
 {
 	extern int optind;
 	extern char *optarg;
@@ -552,7 +553,7 @@ static char *tag_stack[TAG_STACKSIZE];
 static int tag_sp = 0;
 
 /* pushes buffer onto tag stack */
-static tag_push(char *b)
+static int tag_push(char *b)
 {
 	if (tag_sp < TAG_STACKSIZE
 	&& (tag_stack[tag_sp] = (char *) malloc(strlen(b) + 1)) != NULL) {
@@ -563,7 +564,7 @@ static tag_push(char *b)
 }
 
 /* pops value off tag stack to buffer */
-static tag_pop(char *b)
+static int tag_pop(char *b)
 {
 	if (tag_sp) {
 		strcpy(b, tag_stack[--tag_sp]);
@@ -612,7 +613,7 @@ static tag_pop(char *b)
  * NAME [a-z]+          (really any valid name that isn't reserved word) */
 
 /* returns token of next item in input */
-static lex_gettoken(void)
+static int lex_gettoken(void)
 {
 	static int expanded = 0;	/* boolean: ARGSEND expanded? */
 
@@ -823,7 +824,7 @@ static int cpp_prevch;		/* an ungotten c
 static int cpp_refsok;		/* boolean: can we echo characters out to "refs"? */
 
 /* This function opens the file & resets variables */
-static cpp_open(char *name)
+static int cpp_open(char *name)
 			/* name of source file to be opened */
 {
 	/* use the lower-level file_open function to open the file */
@@ -837,7 +838,7 @@ static cpp_open(char *name)
 }
 
 /* returns next nonwhite-space character */
-static cpp_nonwhite(void)
+static int cpp_nonwhite(void)
 {
 	int ch;
 	int next;
@@ -865,7 +866,7 @@ static cpp_nonwhite(void)
 
 
 /* This function returns the next character which isn't part of a directive */
-static cpp_getc(void)
+static int cpp_getc(void)
 {
 	int ch;			/* the next input character */
 	int i = 0;
@@ -992,7 +993,7 @@ static int file_getc(void)
 }
 
 /* This function ungets a character from the current source file */
-static file_ungetc(int ch)
+static int file_ungetc(int ch)
 			/* character to be ungotten */
 {
 	return file_prevch = ch;