summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipos
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2012-07-10 11:59:24 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2012-07-10 11:59:24 +0000
commita99c15329e7586e69373bf882c49813298ba1521 (patch)
treef3c340a4f14c194e5dc969e2840184e81035f8fe /Build/source/texk/dvipos
parenta59a95241f8036bc92a4166f056e2f7cf1bcef9c (diff)
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
Diffstat (limited to 'Build/source/texk/dvipos')
-rw-r--r--Build/source/texk/dvipos/ChangeLog6
-rw-r--r--Build/source/texk/dvipos/dvicore.c2
-rw-r--r--Build/source/texk/dvipos/dvipos.c12
3 files changed, 15 insertions, 5 deletions
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 <peb@mppmu.mpg.de>
+
+ * dvipos.c: Use binary mode for output files.
+ * dvicore.c: Cast argument to avoid MSVC compiler warnings.
+ From W32TeX.
+
2011-04-19 Peter Breitenlohner <peb@mppmu.mpg.de>
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 <limits.h>
-#if defined(MIKTEX) && defined(WIN32) && !defined(__MINGW32__)
+#ifdef MIKTEX
#include <getopt.h>
#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 */