summaryrefslogtreecommitdiff
path: root/Build/source/utils/t1utils/TLpatches/patch-07-warnings
blob: 0d5bbf7fb4faa30d0d746238e2d09943f6687e02 (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
	Avoid compiler warnings (gcc's -Wcast-qual).

diff -ur t1utils-1.41.orig/t1asmhelp.h t1utils-1.41/t1asmhelp.h
--- t1utils-1.41.orig/t1asmhelp.h	Thu Aug 17 00:20:27 2017
+++ t1utils-1.41/t1asmhelp.h	Wed Aug 30 13:42:34 2017
@@ -26,7 +28,8 @@
 }
 
 
-static const char* cs_start = "";
+static char cs_start_init[] = "";
+static char *cs_start = cs_start_init;
 
 static void
 set_cs_start(const char* line, size_t line_len)
@@ -37,13 +40,13 @@
     if ((p = memmem(line, line_len, "string currentfile", 18))
         && memmem(line, line_len, "readstring", 10)) {
         /* locate the name of the charstring start command */
-        for (q = p; q != line && q[-1] != '/'; --q)
+        for (q = p; q != line && *(q-1) != '/'; --q)
             /* nada */;
         if (q != line) {
             for (r = q; r != p && !isspace((unsigned char) *r) && *r != '{'; ++r)
                 /* nada */;
             if (cs_start_set)
-                free((char*) cs_start);
+                free(cs_start);
             cs_start = p = malloc(r - q + 1);
             memcpy(p, q, r - q);
             p[r - q] = 0;