summaryrefslogtreecommitdiff
path: root/Build/source/texk/detex/detex-PATCHES/patch-03-warnings
blob: d3a9f93eab5d708f2366395191c6e1ce9fa14cec (plain)
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
diff -ur detex-2.8.orig/detex.l detex-2.8/detex.l
--- detex-2.8.orig/detex.l	2010-06-11 23:12:06.000000000 +0200
+++ detex-2.8/detex.l	2010-06-11 23:26:08.554783186 +0200
@@ -73,18 +73,18 @@
 #define	CITE(x)		if (fLatex && !fCite) KILLARGS(x)
 
 void AddInclude(char *sbFile);
-void ErrorExit(char *sb1);
+void ErrorExit(const char *sb1);
 void IncludeFile(char *sbFile);
 void InputFile(char *sbFile);
-void SetEnvIgnore(char *sbEnvList);
+void SetEnvIgnore(const char *sbEnvList);
 void SetInputPaths(void);
-void Warning(char *sb1, char *sb2); 
-int BeginEnv(char *sbEnv);
-int EndEnv(char *sbEnv);
+void Warning(const char *sb1, const char *sb2); 
+int BeginEnv(const char *sbEnv);
+int EndEnv(const char *sbEnv);
 int InList(char *sbFile);
 int SeparateList(char *sbList, char *rgsbList[] ,char chSep, int csbMax);
 FILE *TexOpen(char *sbFile);
-char *SafeMalloc(int cch, char *sbMessage);
+char *SafeMalloc(int cch, const char *sbMessage);
 char *getenv();
 #ifndef NO_MALLOC_DECL
 char	*malloc();
@@ -385,7 +385,8 @@
 int
 main(int cArgs, char *rgsbArgs[])
 {
-	char	*pch, *sbEnvList = DEFAULTENV, sbBadOpt[2];
+	char	*pch, sbBadOpt[2];
+	const char *sbEnvList = DEFAULTENV;
 	int	fSawFile = 0, iArgs = 1;
 	
 	/* get base name and decide what we are doing, detex or delatex */
@@ -530,7 +531,7 @@
 ******/
 
 void
-SetEnvIgnore(char *sbEnvList)
+SetEnvIgnore(const char *sbEnvList)
 {
 	char *sb;
 
@@ -547,7 +548,7 @@
 ******/
 
 int
-BeginEnv(char *sbEnv)
+BeginEnv(const char *sbEnv)
 {
 	int	i;
 
@@ -565,7 +566,7 @@
 ******/
 
 int
-EndEnv(char *sbEnv)
+EndEnv(const char *sbEnv)
 {
 	if (!fLatex) return(0);
 	if (strcmp(sbEnv, sbCurrentEnv) == 0)
@@ -670,7 +671,8 @@
 void
 SetInputPaths(void)
 {
-	char *sb, *sbPaths;
+	const char *sb;
+	char *sbPaths;
 	int cchDefaults, cchPaths;
 
 	cchDefaults = strlen(DEFAULTINPUTS);
@@ -715,7 +717,7 @@
 
 	while (sbList && *sbList && csbList < csbMax) {
 	    rgsbList[csbList++] = sbList;
-	    if (sbList = index(sbList, chSep))
+	    if ((sbList = index(sbList, chSep)))
 		*sbList++ = '\0';
 	}
 	return(sbList && *sbList ? ERROR : csbList);
@@ -760,10 +762,12 @@
 	    /* If sbFile ends in .tex then it must be there */
 	    if ((pch = rindex(sbFullPath, '.')) != NULL
 			&& (strcmp(pch, ".tex") == 0))
+	    {
 		if ((fp = fopen(sbFullPath, "r")) != NULL)
 		    return(fp);
 		else
 		    continue;
+	    }
 
 	    /* if .<ext> then try to open it.  the '.' represents   */
 	    /* the beginning of an extension if it is not the first */
@@ -792,7 +796,7 @@
 ******/
 
 char *
-SafeMalloc(int cch, char *sbMessage)
+SafeMalloc(int cch, const char *sbMessage)
 {
 	char *sb;
 
@@ -806,7 +810,7 @@
 ******/
 
 void
-Warning(char *sb1, char *sb2)
+Warning(const char *sb1, const char *sb2)
 {
 	(void)fprintf(stderr, "%s: warning: %s %s\n", sbProgName, sb1, sb2);
 }
@@ -817,7 +821,7 @@
 ******/
 
 void
-ErrorExit(char *sb1)
+ErrorExit(const char *sb1)
 {
 	(void)fflush(stdout);
 	(void)fprintf(stderr, "%s: error: %s\n", sbProgName, sb1);