diff options
Diffstat (limited to 'Build/source/utils/t1utils/t1utils-1.39-PATCHES/patch-03-warnings')
-rw-r--r-- | Build/source/utils/t1utils/t1utils-1.39-PATCHES/patch-03-warnings | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/Build/source/utils/t1utils/t1utils-1.39-PATCHES/patch-03-warnings b/Build/source/utils/t1utils/t1utils-1.39-PATCHES/patch-03-warnings new file mode 100644 index 00000000000..f945094761a --- /dev/null +++ b/Build/source/utils/t1utils/t1utils-1.39-PATCHES/patch-03-warnings @@ -0,0 +1,83 @@ + Avoid compiler warnings (gcc's -Wcast-qual). + +diff -ur t1utils-1.39.orig/clp.c t1utils-1.39/clp.c +--- t1utils-1.39.orig/clp.c 2014-12-11 18:20:22.000000000 +0100 ++++ t1utils-1.39/clp.c 2015-03-02 08:50:06.829885555 +0100 +@@ -1075,21 +1075,27 @@ + parse_int(Clp_Parser *clp, const char *arg, int complain, void *user_data) + { + const char *val; ++ char *temp; + if (*arg == 0 || isspace((unsigned char) *arg) + || (user_data != 0 && *arg == '-')) + val = arg; + else if (user_data != 0) { /* unsigned */ + #if HAVE_STRTOUL +- clp->val.u = strtoul(arg, (char **) &val, 0); ++ clp->val.u = strtoul(arg, &temp, 0); ++ val = temp; + #else + /* don't bother really trying to do it right */ + if (arg[0] == '-') + val = arg; +- else +- clp->val.u = strtol(arg, (char **) &val, 0); ++ else { ++ clp->val.u = strtol(arg, &temp, 0); ++ val = temp; ++ } + #endif +- } else +- clp->val.i = strtol(arg, (char **) &val, 0); ++ } else { ++ clp->val.i = strtol(arg, &temp, 0); ++ val = temp; ++ } + if (*arg != 0 && *val == 0) + return 1; + else if (complain) { +@@ -1105,11 +1111,14 @@ + parse_double(Clp_Parser *clp, const char *arg, int complain, void *user_data) + { + const char *val; ++ char *temp; + (void)user_data; + if (*arg == 0 || isspace((unsigned char) *arg)) + val = arg; +- else +- clp->val.d = strtod(arg, (char **) &val); ++ else { ++ clp->val.d = strtod(arg, &temp); ++ val = temp; ++ } + if (*arg != 0 && *val == 0) + return 1; + else if (complain) +diff -ur t1utils-1.39.orig/t1disasm.c t1utils-1.39/t1disasm.c +--- t1utils-1.39.orig/t1disasm.c 2015-02-26 21:25:22.000000000 +0100 ++++ t1utils-1.39/t1disasm.c 2015-03-02 08:50:06.000000000 +0100 +@@ -302,11 +302,11 @@ + /* 23.Feb.2004 - use 'memstr', not strstr, because the strings input to + eexec_line aren't null terminated! Reported by Werner Lemberg. */ + +-static const unsigned char * +-oog_memstr(const unsigned char *line, int line_len, const char *pattern, int pattern_len) ++static unsigned char * ++oog_memstr(unsigned char *line, int line_len, const char *pattern, int pattern_len) + { +- const unsigned char *try; +- const unsigned char *last = line + line_len - pattern_len + 1; ++ unsigned char *try; ++ unsigned char *last = line + line_len - pattern_len + 1; + while (line < last + && (try = memchr(line, (unsigned char)*pattern, last - line))) { + if (memcmp(try, pattern, pattern_len) == 0) +@@ -401,7 +401,7 @@ + badly: a charstring definition follows "/Charstrings ... begin", ON THE + SAME LINE. */ + { +- const char *CharStrings = (const char *) ++ char *CharStrings = (char *) + oog_memstr(line, line_len, "/CharStrings ", 13); + int crap, n; + char should_be_slash = 0; |