summaryrefslogtreecommitdiff
path: root/Build/source/texk/afm2pl
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/afm2pl')
-rw-r--r--Build/source/texk/afm2pl/ChangeLog6
-rw-r--r--Build/source/texk/afm2pl/afm2pl.c30
-rwxr-xr-xBuild/source/texk/afm2pl/configure32
3 files changed, 37 insertions, 31 deletions
diff --git a/Build/source/texk/afm2pl/ChangeLog b/Build/source/texk/afm2pl/ChangeLog
index 6274127a598..dde61398f94 100644
--- a/Build/source/texk/afm2pl/ChangeLog
+++ b/Build/source/texk/afm2pl/ChangeLog
@@ -1,3 +1,9 @@
+2011-06-16 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * afm2pl.c (find_suffix, !KPATHSEA): Declare result as const.
+ (openout, writepl, conspsfonts): Allow find_suffix() to return
+ a const string.
+
2010-12-08 Peter Breitenlohner <peb@mppmu.mpg.de>
* configure.ac: Version 0.7.1 (since 2009-06-21).
diff --git a/Build/source/texk/afm2pl/afm2pl.c b/Build/source/texk/afm2pl/afm2pl.c
index 7820119195a..2ab70f5e704 100644
--- a/Build/source/texk/afm2pl/afm2pl.c
+++ b/Build/source/texk/afm2pl/afm2pl.c
@@ -386,11 +386,11 @@ concat(const char *s1, const char *s2)
/* Return pointer to first character after `.' in last directory element
* of NAME. If the name is `foo' or `/foo.bar/baz', we have no extension.
*/
-static char *
+static const char *
find_suffix(const char *name)
{
const char *slash_pos;
- char *dot_pos = (char *) strrchr (name, '.');
+ const char *dot_pos = (char *) strrchr (name, '.');
if (dot_pos == NULL)
return NULL;
@@ -501,15 +501,14 @@ openout(const char *fname, int based_on, const char *outext)
const char *inext = ".afm";
/* use inext+1 and outext+1 when the leading dot is not desired */
const char *realfname;
- char *suf;
+ const char *suf;
if (based_on) { /* compute output filename */
suf = find_suffix (fname);
if (suf && !strcmp ((inext + 1), suf)) { /* replace afm suffix */
char * q;
q = newstring (fname);
- suf = find_suffix (q);
- suf[0] = 0;
+ q[suf - fname] = 0;
strcat (q, (outext + 1));
realfname = q;
/* no allocation required: new suffix not longer than old one */
@@ -1787,7 +1786,8 @@ writepl(void)
register struct kern *nkern;
struct adobeinfo *asucc, *asub;
int ht, dt;
- char labeled, *pp;
+ char labeled;
+ const char *pp;
outname = openout (outname, based_on, ".pl");
@@ -1795,7 +1795,8 @@ writepl(void)
{
char *outbase = newstring (xbasename (outname));
pp = find_suffix (outbase);
- if (pp) { pp--; *pp = 0; }
+ if (pp)
+ outbase[pp - outbase - 1] = 0;
(void) sprintf (obuffer, "%s%s%s", outbase,
(efactor == 1.0 ? "" : "-E"),
(slant == 0.0 ? "" : "-S"));
@@ -2260,15 +2261,14 @@ readargs(int argc, char **argv)
static void
conspsfonts(void)
{
- char *p, *q;
+ char *p;
+ const char *q;
/* TeX fontname is file basename without path or extension */
p = newstring (xbasename (outname));
q = find_suffix (p);
- if (q > p) {
- q--;
- *q = 0;
- }
+ if (q)
+ p[q - p - 1] = 0;
openout (p, 0, ".map");
(void) fprintf (outfile, "%s %s", p, fontname);
free (p);
@@ -2288,10 +2288,8 @@ conspsfonts(void)
}
p = newstring (xbasename (afmname));
q = find_suffix (p);
- if (q > p) {
- q--;
- *q = 0;
- }
+ if (q)
+ p[q - p - 1] = 0;
(void) fprintf (outfile, " <%s.pfb", p);
free (p);
(void) fprintf (outfile, "\n");
diff --git a/Build/source/texk/afm2pl/configure b/Build/source/texk/afm2pl/configure
index 663714ce27a..724a91291cd 100755
--- a/Build/source/texk/afm2pl/configure
+++ b/Build/source/texk/afm2pl/configure
@@ -758,8 +758,7 @@ CFLAGS
LDFLAGS
LIBS
CPPFLAGS
-CPP
-CPPFLAGS'
+CPP'
# Initialize some variables set by options.
@@ -12456,39 +12455,42 @@ $as_echo_n "checking what warning flags to pass to the C compiler... " >&6; }
if ${kpse_cv_warning_cflags+:} false; then :
$as_echo_n "(cached) " >&6
else
- if test "x$enable_compiler_warnings" = xno; then
+ if test "x$GCC" = xyes; then
kpse_cv_warning_cflags=
-elif test "x$GCC" = xyes; then
+if test "x$enable_compiler_warnings" != xno; then
kpse_cv_warning_cflags="-Wimplicit -Wreturn-type"
-case `$CC -dumpversion` in #(
+ case `$CC -dumpversion` in #(
3.4.* | 4.*) :
kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wdeclaration-after-statement" ;; #(
*) :
;;
esac
-case `$CC -dumpversion` in #(
+ case `$CC -dumpversion` in #(
3.[234].* | 4.*) :
kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wno-unknown-pragmas" ;; #(
*) :
;;
esac
-if test "x$enable_compiler_warnings" != xmin; then
- kpse_cv_warning_cflags="-Wall -Wunused $kpse_cv_warning_cflags"
- kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wmissing-prototypes -Wmissing-declarations"
- if test "x$enable_compiler_warnings" != xyes; then
- kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wparentheses -Wswitch -Wtrigraphs -Wpointer-arith"
- kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wcast-qual -Wcast-align -Wwrite-strings"
- case `$CC -dumpversion` in #(
+ if test "x$enable_compiler_warnings" != xmin; then
+ kpse_cv_warning_cflags="-Wall -Wunused $kpse_cv_warning_cflags"
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wmissing-prototypes -Wmissing-declarations"
+ if test "x$enable_compiler_warnings" != xyes; then
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wparentheses -Wswitch -Wtrigraphs -Wpointer-arith"
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wcast-qual -Wcast-align -Wwrite-strings"
+ case `$CC -dumpversion` in #(
3.4.* | 4.*) :
kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wold-style-definition" ;; #(
*) :
;;
esac
- if test "x$enable_compiler_warnings" != xmax; then
- kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wshadow"
+ if test "x$enable_compiler_warnings" != xmax; then
+ kpse_cv_warning_cflags="$kpse_cv_warning_cflags -Wshadow"
+ fi
fi
fi
fi
+elif test "x$enable_compiler_warnings" = xno; then
+ kpse_cv_warning_cflags=
else
kpse_cv_warning_cflags= # FIXME: warning flags for non-GNU C compilers
fi