From 619f14f6c7d6fcc6fd505f712dbddc51725a7e9f Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Wed, 18 Jul 2012 06:21:39 +0000 Subject: ttf2pk(2): Use binary mode for output files Change function params to int to avoid MSVC warnings without casting Drop XCDECL (from W32TeX) git-svn-id: svn://tug.org/texlive/trunk@27080 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/ttf2pk/ChangeLog | 8 ++++++++ Build/source/texk/ttf2pk/errormsg.h | 20 -------------------- Build/source/texk/ttf2pk/pklib.c | 2 +- Build/source/texk/ttf2pk/tfmaux.c | 7 +++---- Build/source/texk/ttf2pk/ttf2tfm.c | 2 +- Build/source/texk/ttf2pk2/ChangeLog | 8 ++++++++ Build/source/texk/ttf2pk2/errormsg.h | 20 -------------------- Build/source/texk/ttf2pk2/pklib.c | 2 +- Build/source/texk/ttf2pk2/tfmaux.c | 7 +++---- Build/source/texk/ttf2pk2/ttf2tfm.c | 2 +- 10 files changed, 26 insertions(+), 52 deletions(-) (limited to 'Build/source/texk') diff --git a/Build/source/texk/ttf2pk/ChangeLog b/Build/source/texk/ttf2pk/ChangeLog index c43a3b26645..226fc38a2c2 100644 --- a/Build/source/texk/ttf2pk/ChangeLog +++ b/Build/source/texk/ttf2pk/ChangeLog @@ -1,3 +1,11 @@ +2012-07-18 Peter Breitenlohner + + * tfmaux.c, ttf2tfm.c: Use binary mode for output files. + * pklib.c (putshort), tfmaux.c (write16): Change the param from + short into int to avoid MSVC warnings without casting args. + * errormsg.h, tfmaux.c [WIN32]: Drop XCDECL. + From W32TeX. + 2011-12-06 Peter Breitenlohner * Makefile.am: Replace ${prefix}/texmf => $(datarootdir)/texmf. diff --git a/Build/source/texk/ttf2pk/errormsg.h b/Build/source/texk/ttf2pk/errormsg.h index 841dd42a036..1c534ce92ed 100644 --- a/Build/source/texk/ttf2pk/errormsg.h +++ b/Build/source/texk/ttf2pk/errormsg.h @@ -11,26 +11,6 @@ #ifndef ERRORMSG_H #define ERRORMSG_H - -/* - Disable some annoying warnings when you compile with -W3. Namely the - warnings about missing __cdecl specifiers at some places where they are - not really needed because the compiler can generate them. - - This is relevant only if you compile with -Gr option, i.e., use fastcall - calling convention. - - This is needed for fpTeX. - */ - -#ifdef WIN32 -#pragma warning (disable : 4007 4096) -#define XCDECL __cdecl -#else -#define XCDECL -#endif - - extern const char *progname; /* the origin of the error/warning message */ void oops(const char *message, diff --git a/Build/source/texk/ttf2pk/pklib.c b/Build/source/texk/ttf2pk/pklib.c index 5b5b380c277..25b1c5c956c 100644 --- a/Build/source/texk/ttf2pk/pklib.c +++ b/Build/source/texk/ttf2pk/pklib.c @@ -652,7 +652,7 @@ pk_bm_cvt(void) static void -putshort(short w) +putshort(int w) { putc(w >> 8, pk_file); putc(w, pk_file); diff --git a/Build/source/texk/ttf2pk/tfmaux.c b/Build/source/texk/ttf2pk/tfmaux.c index 208307d3684..68e80a708bf 100644 --- a/Build/source/texk/ttf2pk/tfmaux.c +++ b/Build/source/texk/ttf2pk/tfmaux.c @@ -50,7 +50,7 @@ static int unsort[257]; * A simple function for sorting sf_array (in inverse order) */ -static int XCDECL +static int compare_sf(const void *a, const void *b) { return (int)(((const struct sf *)b)->sf_code - ((const struct sf *)a)->sf_code); @@ -163,8 +163,7 @@ remap(long *what, static void -write16(register short what, - register FILE *out) +write16(int what, FILE *out) { (void)fputc(what >> 8, out); (void)fputc(what & 0xFF, out); @@ -607,7 +606,7 @@ writeenc(Font *fnt) strcat(enc_name, fnt->fullname); strcat(enc_name, ".enc"); - if ((out = fopen(enc_name, "wt")) == NULL) + if ((out = fopen(enc_name, "wb")) == NULL) oops("Cannot open enc file `%s'.", enc_name); free(enc_name); diff --git a/Build/source/texk/ttf2pk/ttf2tfm.c b/Build/source/texk/ttf2pk/ttf2tfm.c index 7f566af32f4..b118529014f 100644 --- a/Build/source/texk/ttf2pk/ttf2tfm.c +++ b/Build/source/texk/ttf2pk/ttf2tfm.c @@ -688,7 +688,7 @@ handle_options(int argc, char *argv[], Font *fnt) oops("Bad small caps height."); if (vpl_name) - if ((fnt->vplout = fopen(vpl_name, "wt")) == NULL) + if ((fnt->vplout = fopen(vpl_name, "wb")) == NULL) oops("Cannot open vpl output file."); if (fnt->subfont_ligs) diff --git a/Build/source/texk/ttf2pk2/ChangeLog b/Build/source/texk/ttf2pk2/ChangeLog index 1e9fb42ec42..840cd0bb0ac 100644 --- a/Build/source/texk/ttf2pk2/ChangeLog +++ b/Build/source/texk/ttf2pk2/ChangeLog @@ -1,3 +1,11 @@ +2012-07-18 Peter Breitenlohner + + * tfmaux.c, ttf2tfm.c: Use binary mode for output files. + * pklib.c (putshort), tfmaux.c (write16): Change the param from + short into int to avoid MSVC warnings without casting args. + * errormsg.h, tfmaux.c [WIN32]: Drop XCDECL. + From W32TeX. + 2011-12-06 Peter Breitenlohner * Makefile.am: Replace ${prefix}/texmf => $(datarootdir)/texmf. diff --git a/Build/source/texk/ttf2pk2/errormsg.h b/Build/source/texk/ttf2pk2/errormsg.h index 841dd42a036..1c534ce92ed 100644 --- a/Build/source/texk/ttf2pk2/errormsg.h +++ b/Build/source/texk/ttf2pk2/errormsg.h @@ -11,26 +11,6 @@ #ifndef ERRORMSG_H #define ERRORMSG_H - -/* - Disable some annoying warnings when you compile with -W3. Namely the - warnings about missing __cdecl specifiers at some places where they are - not really needed because the compiler can generate them. - - This is relevant only if you compile with -Gr option, i.e., use fastcall - calling convention. - - This is needed for fpTeX. - */ - -#ifdef WIN32 -#pragma warning (disable : 4007 4096) -#define XCDECL __cdecl -#else -#define XCDECL -#endif - - extern const char *progname; /* the origin of the error/warning message */ void oops(const char *message, diff --git a/Build/source/texk/ttf2pk2/pklib.c b/Build/source/texk/ttf2pk2/pklib.c index 5b5b380c277..25b1c5c956c 100644 --- a/Build/source/texk/ttf2pk2/pklib.c +++ b/Build/source/texk/ttf2pk2/pklib.c @@ -652,7 +652,7 @@ pk_bm_cvt(void) static void -putshort(short w) +putshort(int w) { putc(w >> 8, pk_file); putc(w, pk_file); diff --git a/Build/source/texk/ttf2pk2/tfmaux.c b/Build/source/texk/ttf2pk2/tfmaux.c index 208307d3684..68e80a708bf 100644 --- a/Build/source/texk/ttf2pk2/tfmaux.c +++ b/Build/source/texk/ttf2pk2/tfmaux.c @@ -50,7 +50,7 @@ static int unsort[257]; * A simple function for sorting sf_array (in inverse order) */ -static int XCDECL +static int compare_sf(const void *a, const void *b) { return (int)(((const struct sf *)b)->sf_code - ((const struct sf *)a)->sf_code); @@ -163,8 +163,7 @@ remap(long *what, static void -write16(register short what, - register FILE *out) +write16(int what, FILE *out) { (void)fputc(what >> 8, out); (void)fputc(what & 0xFF, out); @@ -607,7 +606,7 @@ writeenc(Font *fnt) strcat(enc_name, fnt->fullname); strcat(enc_name, ".enc"); - if ((out = fopen(enc_name, "wt")) == NULL) + if ((out = fopen(enc_name, "wb")) == NULL) oops("Cannot open enc file `%s'.", enc_name); free(enc_name); diff --git a/Build/source/texk/ttf2pk2/ttf2tfm.c b/Build/source/texk/ttf2pk2/ttf2tfm.c index 7f566af32f4..b118529014f 100644 --- a/Build/source/texk/ttf2pk2/ttf2tfm.c +++ b/Build/source/texk/ttf2pk2/ttf2tfm.c @@ -688,7 +688,7 @@ handle_options(int argc, char *argv[], Font *fnt) oops("Bad small caps height."); if (vpl_name) - if ((fnt->vplout = fopen(vpl_name, "wt")) == NULL) + if ((fnt->vplout = fopen(vpl_name, "wb")) == NULL) oops("Cannot open vpl output file."); if (fnt->subfont_ligs) -- cgit v1.2.3