From a99c15329e7586e69373bf882c49813298ba1521 Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Tue, 10 Jul 2012 11:59:24 +0000 Subject: dvipos: Use binary mode for output files Cast argument to avoid MSVC compiler warnings (from W32TeX) git-svn-id: svn://tug.org/texlive/trunk@26988 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/dvipos/ChangeLog | 6 ++++++ Build/source/texk/dvipos/dvicore.c | 2 +- Build/source/texk/dvipos/dvipos.c | 12 ++++++++---- 3 files changed, 15 insertions(+), 5 deletions(-) (limited to 'Build/source/texk/dvipos') diff --git a/Build/source/texk/dvipos/ChangeLog b/Build/source/texk/dvipos/ChangeLog index 84f8234c15e..3b4f017c8df 100644 --- a/Build/source/texk/dvipos/ChangeLog +++ b/Build/source/texk/dvipos/ChangeLog @@ -1,3 +1,9 @@ +2012-07-10 Peter Breitenlohner + + * dvipos.c: Use binary mode for output files. + * dvicore.c: Cast argument to avoid MSVC compiler warnings. + From W32TeX. + 2011-04-19 Peter Breitenlohner Avoid 'differ in signedness' warnings. diff --git a/Build/source/texk/dvipos/dvicore.c b/Build/source/texk/dvipos/dvicore.c index 5a1db99c9e6..e01226dd9b3 100644 --- a/Build/source/texk/dvipos/dvicore.c +++ b/Build/source/texk/dvipos/dvicore.c @@ -744,7 +744,7 @@ static void fin_set (UNSIGNED_BYTE p, int move) static void do_setchar (UNSIGNED_BYTE opcode) { if (opcode > 32 && opcode < 127) /* from '!' to '~' */ - out_text(opcode - SET_CHAR_0); + out_text((char)(opcode - SET_CHAR_0)); else flush_text(); msg_out(M_DEBUG, "%ld: setchar%d", dvi_location, opcode - SET_CHAR_0); diff --git a/Build/source/texk/dvipos/dvipos.c b/Build/source/texk/dvipos/dvipos.c index da1fff0cd2a..f4613111289 100644 --- a/Build/source/texk/dvipos/dvipos.c +++ b/Build/source/texk/dvipos/dvipos.c @@ -21,7 +21,7 @@ #include "dvicore.h" #include -#if defined(MIKTEX) && defined(WIN32) && !defined(__MINGW32__) +#ifdef MIKTEX #include #endif @@ -212,12 +212,16 @@ int main (int argc, char *argv[]) msg_out(M_FAIL, "Could not open the input file %s.", infname); /* Open the output file */ - if (outfname == NULL) outfp = stdout; - else if ((outfp = fopen(outfname, "at")) == NULL) + if (outfname == NULL) { + outfp = stdout; +#ifdef WIN32 + setmode(fileno(stdout), _O_BINARY); +#endif + } else if ((outfp = fopen(outfname, "ab")) == NULL) msg_out(M_FAIL, "Could not open the output file %s.\n", outfname); /* Open the boundingbox file */ - if (bbxfname && (bbxfp = fopen(bbxfname, "wt")) == NULL) + if (bbxfname && (bbxfp = fopen(bbxfname, "wb")) == NULL) msg_out(M_FAIL, "Could not open the boundingbox file %s.\n", bbxfname); /* Open the framed DVI file */ -- cgit v1.2.3