summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2010-05-11 08:39:25 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2010-05-11 08:39:25 +0000
commit0f0e478dba51669836f1a6f3078a27c64816f151 (patch)
treed3f9a8d7db1d8f63498811a1ce6af6b47d586d47
parent4fd54ee7ff93817274972e2e2ed63c4c5c49cc76 (diff)
SET_BINARY and casts to void
git-svn-id: svn://tug.org/texlive/trunk@18196 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/dtl/ChangeLog4
-rw-r--r--Build/source/texk/dtl/dt2dv.c2
-rw-r--r--Build/source/texk/dtl/dv2dt.c2
-rw-r--r--Build/source/texk/dvidvi/ChangeLog4
-rw-r--r--Build/source/texk/dvidvi/dvidvi.c2
-rw-r--r--Build/source/texk/dvipsk/ChangeLog6
-rw-r--r--Build/source/texk/dvipsk/afm2tfm.c4
-rw-r--r--Build/source/texk/dvipsk/dvips.h4
-rw-r--r--Build/source/texk/dvipsk/finclude.c4
-rw-r--r--Build/source/texk/dvipsk/output.c6
-rw-r--r--Build/source/texk/dvipsk/search.c2
-rw-r--r--Build/source/texk/kpathsea/ChangeLog4
-rw-r--r--Build/source/texk/kpathsea/c-fopen.h7
-rw-r--r--Build/source/texk/seetexk/ChangeLog5
-rw-r--r--Build/source/texk/seetexk/dvibook.c6
-rw-r--r--Build/source/texk/seetexk/dviconcat.c8
-rw-r--r--Build/source/texk/seetexk/dviselect.c6
-rw-r--r--Build/source/texk/seetexk/dvitodvi.c6
18 files changed, 53 insertions, 29 deletions
diff --git a/Build/source/texk/dtl/ChangeLog b/Build/source/texk/dtl/ChangeLog
index 86588af72a0..f6ee7d419df 100644
--- a/Build/source/texk/dtl/ChangeLog
+++ b/Build/source/texk/dtl/ChangeLog
@@ -1,3 +1,7 @@
+2010-05-10 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * dt2dv.c, dv2dt.c (SET_BINARY): Remove casts to void.
+
2010-02-12 Peter Breitenlohner <peb@mppmu.mpg.de>
* Makefile.am (AM_CPPFLAGS): Remove '-DNO_DEBUG' ...
diff --git a/Build/source/texk/dtl/dt2dv.c b/Build/source/texk/dtl/dt2dv.c
index 41761f39bc4..c52beef3a0c 100644
--- a/Build/source/texk/dtl/dt2dv.c
+++ b/Build/source/texk/dtl/dt2dv.c
@@ -471,7 +471,7 @@ Void dvi_stdout (VOID)
dvi_filename = "Standard Output";
++ nfile;
if (!isatty(fileno(dvi_fp)))
- (void)SET_BINARY(fileno(dvi_fp));
+ SET_BINARY(fileno(dvi_fp));
}
diff --git a/Build/source/texk/dtl/dv2dt.c b/Build/source/texk/dtl/dv2dt.c
index 7d7e6f23503..49d540b41f4 100644
--- a/Build/source/texk/dtl/dv2dt.c
+++ b/Build/source/texk/dtl/dv2dt.c
@@ -172,7 +172,7 @@ main
if (argc > 1)
open_dvi (argv[1], &dvi);
else if (!isatty(fileno(dvi)))
- (void)SET_BINARY(fileno(dvi));
+ SET_BINARY(fileno(dvi));
if (argc > 2)
open_dtl (argv[2], &dtl);
diff --git a/Build/source/texk/dvidvi/ChangeLog b/Build/source/texk/dvidvi/ChangeLog
index f0259e6e9e4..3077b3470e7 100644
--- a/Build/source/texk/dvidvi/ChangeLog
+++ b/Build/source/texk/dvidvi/ChangeLog
@@ -1,3 +1,7 @@
+2010-05-10 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * dvidvi.c (SET_BINARY): Remove casts to void.
+
2010-02-12 Peter Breitenlohner <peb@mppmu.mpg.de>
* Makefile.am (AM_CPPFLAGS): Remove '-DNO_DEBUG' ...
diff --git a/Build/source/texk/dvidvi/dvidvi.c b/Build/source/texk/dvidvi/dvidvi.c
index c32ab1e5b62..f25a25a5c1a 100644
--- a/Build/source/texk/dvidvi/dvidvi.c
+++ b/Build/source/texk/dvidvi/dvidvi.c
@@ -817,7 +817,7 @@ default:
if(!oname) {
oname="stdout";
if (!isatty(fileno(stdout)))
- (void)SET_BINARY(fileno(stdout));
+ SET_BINARY(fileno(stdout));
}
if (*oname != 0 && !quiet) {
diff --git a/Build/source/texk/dvipsk/ChangeLog b/Build/source/texk/dvipsk/ChangeLog
index eea20f93b31..1f92c67950a 100644
--- a/Build/source/texk/dvipsk/ChangeLog
+++ b/Build/source/texk/dvipsk/ChangeLog
@@ -1,5 +1,11 @@
2010-05-10 Peter Breitenlohner <peb@mppmu.mpg.de>
+ * dvips.h [SET_BINARY]: Add cast to void.
+ * afm2tfm.c, finclude.c, output.c, search.c (SET_BINARY): Once
+ again remove casts to void.
+
+2010-05-10 Peter Breitenlohner <peb@mppmu.mpg.de>
+
* all files: Remove more useless casts to void.
* afm2tfm.c, finclude.c, output.c, search.c: Reintroduce a few
diff --git a/Build/source/texk/dvipsk/afm2tfm.c b/Build/source/texk/dvipsk/afm2tfm.c
index 7d05bf877f6..bf02aa79ee9 100644
--- a/Build/source/texk/dvipsk/afm2tfm.c
+++ b/Build/source/texk/dvipsk/afm2tfm.c
@@ -1687,7 +1687,7 @@ default: fprintf(stderr, "Unknown option %s %s ignored.\n", argv[2], argv[3]);
if ((afmin=fopen(inname, "r"))==NULL)
error("! can't open afm input file");
#endif /* KPATHSEA */
- (void)SET_BINARY(fileno(afmin));
+ SET_BINARY(fileno(afmin));
if (argc>3 || (argc==3 && *argv[2]=='-')) {
error("! need at most two non-option arguments");
@@ -1979,7 +1979,7 @@ readencoding(char *enc)
#else
afmin = fopen(enc, "r");
#endif
- (void)SET_BINARY(fileno(afmin));
+ SET_BINARY(fileno(afmin));
param = 0;
if (afmin == 0)
#ifdef KPATHSEA
diff --git a/Build/source/texk/dvipsk/dvips.h b/Build/source/texk/dvipsk/dvips.h
index 74025cdb90f..6cc1389dcaa 100644
--- a/Build/source/texk/dvipsk/dvips.h
+++ b/Build/source/texk/dvipsk/dvips.h
@@ -330,9 +330,9 @@ struct papsiz {
#include <fcntl.h>
#define O_BINARY _O_BINARY
#define register
-#define SET_BINARY(fd) _setmode((fd), _O_BINARY)
+#define SET_BINARY(fd) (void)_setmode((fd), _O_BINARY)
#else /* !WIN32 */
-#define SET_BINARY(fd) 0
+#define SET_BINARY(fd) (void)0
#endif
#if defined(DEVICESEP)
diff --git a/Build/source/texk/dvipsk/finclude.c b/Build/source/texk/dvipsk/finclude.c
index eac10dccaa6..44943924ea3 100644
--- a/Build/source/texk/dvipsk/finclude.c
+++ b/Build/source/texk/dvipsk/finclude.c
@@ -394,13 +394,13 @@ scanfontcomments(const char *filename)
* Allow scanning of ` commands. Better return same results both times.
*/
f = popen(filename+1, "r");
- (void)SET_BINARY(fileno(f));
+ SET_BINARY(fileno(f));
to_close = USE_PCLOSE;
} else {
f = search(figpath, filename, READ);
}
if (f) {
- (void)SET_BINARY(fileno(f));
+ SET_BINARY(fileno(f));
fc_state = 0;
check_atend = 0;
while (fgets(p,500,f) && p[0]=='%' &&
diff --git a/Build/source/texk/dvipsk/output.c b/Build/source/texk/dvipsk/output.c
index 467066c62d3..c3aa22a435f 100644
--- a/Build/source/texk/dvipsk/output.c
+++ b/Build/source/texk/dvipsk/output.c
@@ -152,7 +152,7 @@ copyfile_general(const char *s, struct header_list *cur_header)
sprintf(errbuf, "Execution of <%s> failed ", s);
f = popen(s, "r");
if (f != 0)
- (void)SET_BINARY(fileno(f));
+ SET_BINARY(fileno(f));
}
else {
sprintf(errbuf,"Secure mode is %d so execute <%s> will not run", secure,s);
@@ -1310,7 +1310,7 @@ open_output(void) {
#endif
if (pf == NULL && (pf = popen(oname+1, "w")) != NULL) {
popened = 1;
- (void)SET_BINARY(fileno(pf));
+ SET_BINARY(fileno(pf));
}
if (pf == NULL)
error("! couldn't open output pipe");
@@ -1322,7 +1322,7 @@ open_output(void) {
} else {
if ((bitfile=fopen(oname,"w"))==NULL)
error("! couldn't open PostScript file");
- (void)SET_BINARY(fileno(bitfile));
+ SET_BINARY(fileno(bitfile));
}
} else {
bitfile = stdout;
diff --git a/Build/source/texk/dvipsk/search.c b/Build/source/texk/dvipsk/search.c
index 7259b8ef445..e135ef2cd67 100644
--- a/Build/source/texk/dvipsk/search.c
+++ b/Build/source/texk/dvipsk/search.c
@@ -146,7 +146,7 @@ search(kpse_file_format_type format, const char *file, const char *mode)
char *prog = selfautoloc_prog (GUNZIP);
cmd = concat3 (prog, " -c ", quoted_name);
ret = popen (cmd, "r");
- (void)SET_BINARY(fileno(ret));
+ SET_BINARY(fileno(ret));
to_close = USE_PCLOSE;
free (cmd);
free (quoted_name);
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog
index ed4118b2ebc..34f7e3701c5 100644
--- a/Build/source/texk/kpathsea/ChangeLog
+++ b/Build/source/texk/kpathsea/ChangeLog
@@ -1,3 +1,7 @@
+2010-05-10 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * c-fopen.h [SET_BINARY]: Add cast to void.
+
2010-05-09 Peter Breitenlohner <peb@mppmu.mpg.de>
* progname.c (kpathsea_set_program_name): Drop superfluous cast.
diff --git a/Build/source/texk/kpathsea/c-fopen.h b/Build/source/texk/kpathsea/c-fopen.h
index c22c0ec7ea1..3ae1f911f48 100644
--- a/Build/source/texk/kpathsea/c-fopen.h
+++ b/Build/source/texk/kpathsea/c-fopen.h
@@ -49,7 +49,8 @@
/* How to switch an already open file handle to binary mode.
Used on DOSISH systems when we need to switch a standard
- stream, such as stdin or stdout, to binary mode. */
+ stream, such as stdin or stdout, to binary mode.
+ We never use the value return by setmode(). */
#include <fcntl.h>
#ifdef DOSISH
#include <io.h>
@@ -60,13 +61,13 @@
#endif
#if defined (__i386_pc_gnu__) || \
defined (WIN32) || defined (__WIN32__) || defined (_WIN32)
-#define SET_BINARY(f) setmode((f), O_BINARY)
+#define SET_BINARY(f) (void)setmode((f), O_BINARY)
#endif
#else /* not DOSISH */
#ifndef O_BINARY
#define O_BINARY 0
#endif
-#define SET_BINARY(f) 0
+#define SET_BINARY(f) (void)0
#endif /* not DOSISH */
#endif /* not C_FOPEN_H */
diff --git a/Build/source/texk/seetexk/ChangeLog b/Build/source/texk/seetexk/ChangeLog
index 71bfeef36b5..941de2c59cb 100644
--- a/Build/source/texk/seetexk/ChangeLog
+++ b/Build/source/texk/seetexk/ChangeLog
@@ -1,3 +1,8 @@
+2010-05-10 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * dvibook.c, dviconcat.c, dviselect.c, dvitodvi.c [SET_BINARY}:
+ Add casts to void. (SET_BINARY): Remove casts to void.
+
2010-02-26 Peter Breitenlohner <peb@mppmu.mpg.de>
* types.h: Don't #include <win32lib.h> for KPATHSEA.
diff --git a/Build/source/texk/seetexk/dvibook.c b/Build/source/texk/seetexk/dvibook.c
index d02dfe73d33..d33d383f9c7 100644
--- a/Build/source/texk/seetexk/dvibook.c
+++ b/Build/source/texk/seetexk/dvibook.c
@@ -22,7 +22,7 @@
#else
#define FOPEN_RBIN_MODE "r"
#define FOPEN_RBIN_MODE "w"
-#define SET_BINARY(x) 0
+#define SET_BINARY(x) (void)0
extern char *optarg;
extern int optind;
#endif
@@ -429,13 +429,13 @@ Usage: %s [-s signature] [-q] [-i infile] [-o outfile] [infile [outfile]]\n",
DVIFileName = "`stdin'";
inf = stdin;
if (!isatty(fileno(inf)))
- (void)SET_BINARY(fileno(inf));
+ SET_BINARY(fileno(inf));
} else if ((inf = fopen(DVIFileName, FOPEN_RBIN_MODE)) == 0)
error(1, -1, "cannot read %s", DVIFileName);
if (outname == NULL) {
outf = stdout;
if (!isatty(fileno(outf)))
- (void)SET_BINARY(fileno(outf));
+ SET_BINARY(fileno(outf));
}
else if ((outf = fopen(outname, FOPEN_WBIN_MODE)) == 0)
error(1, -1, "cannot write %s", outname);
diff --git a/Build/source/texk/seetexk/dviconcat.c b/Build/source/texk/seetexk/dviconcat.c
index 9bc8ee112e0..45d3821b2ae 100644
--- a/Build/source/texk/seetexk/dviconcat.c
+++ b/Build/source/texk/seetexk/dviconcat.c
@@ -20,7 +20,7 @@
#else
#define FOPEN_RBIN_MODE "rb"
#define FOPEN_RBIN_MODE "wb"
-#define SET_BINARY(x) 0
+#define SET_BINARY(x) (void)0
extern char *optarg;
extern int optind;
#endif
@@ -414,7 +414,7 @@ usage:
if (outf == NULL) {
outf = stdout;
if (!isatty(fileno(outf)))
- (void)SET_BINARY(fileno(outf));
+ SET_BINARY(fileno(outf));
}
if ((FontFinder = SCreate(sizeof(struct fontinfo *))) == 0)
error(1, 0, "cannot create font finder (out of memory?)");
@@ -426,7 +426,7 @@ usage:
*/
if (optind >= argc) {
if (!isatty(fileno(stdin)))
- (void)SET_BINARY(fileno(stdin));
+ SET_BINARY(fileno(stdin));
doit("`stdin'", stdin);
}
else {
@@ -434,7 +434,7 @@ usage:
s = argv[c];
if (*s == '-' && s[1] == 0) {
if (!isatty(fileno(stdin)))
- (void)SET_BINARY(fileno(stdin));
+ SET_BINARY(fileno(stdin));
doit("`stdin'", stdin);
}
else if ((f = fopen(s, FOPEN_RBIN_MODE)) == NULL) {
diff --git a/Build/source/texk/seetexk/dviselect.c b/Build/source/texk/seetexk/dviselect.c
index f5a14667ea1..a1ab9ac67cf 100644
--- a/Build/source/texk/seetexk/dviselect.c
+++ b/Build/source/texk/seetexk/dviselect.c
@@ -25,7 +25,7 @@
#else
#define FOPEN_RBIN_MODE "rb"
#define FOPEN_RBIN_MODE "wb"
-#define SET_BINARY(x) 0
+#define SET_BINARY(x) (void)0
extern char *optarg;
extern int optind;
#endif
@@ -523,13 +523,13 @@ Usage: %s [-s] [-i infile] [-o outfile] pages [...] [infile [outfile]]\n",
DVIFileName = "`stdin'";
inf = stdin;
if (!isatty(fileno(inf)))
- (void)SET_BINARY(fileno(inf));
+ SET_BINARY(fileno(inf));
} else if ((inf = fopen(DVIFileName, FOPEN_RBIN_MODE)) == 0)
error(1, -1, "cannot read %s", DVIFileName);
if (outname == NULL) {
outf = stdout;
if (!isatty(fileno(outf)))
- (void)SET_BINARY(fileno(outf));
+ SET_BINARY(fileno(outf));
} else if ((outf = fopen(outname, FOPEN_WBIN_MODE)) == 0)
error(1, -1, "cannot write %s", outname);
diff --git a/Build/source/texk/seetexk/dvitodvi.c b/Build/source/texk/seetexk/dvitodvi.c
index a91aa0c4045..d8643512fed 100644
--- a/Build/source/texk/seetexk/dvitodvi.c
+++ b/Build/source/texk/seetexk/dvitodvi.c
@@ -22,7 +22,7 @@
#else
#define FOPEN_RBIN_MODE "r"
#define FOPEN_RBIN_MODE "w"
-#define SET_BINARY(x) 0
+#define SET_BINARY(x) (void)0
extern char *optarg;
extern int optind;
#endif
@@ -665,13 +665,13 @@ Usage: %s [-q] [-i infile] [-o outfile] [-w width] [-h height] <pagespecs> [infi
DVIFileName = "`stdin'";
inf = stdin;
if (!isatty(fileno(inf)))
- (void)SET_BINARY(fileno(inf));
+ SET_BINARY(fileno(inf));
} else if ((inf = fopen(DVIFileName, FOPEN_RBIN_MODE)) == 0)
error(1, -1, "cannot read %s", DVIFileName);
if (outname == NULL) {
outf = stdout;
if (!isatty(fileno(outf)))
- (void)SET_BINARY(fileno(outf));
+ SET_BINARY(fileno(outf));
}
else if ((outf = fopen(outname, FOPEN_WBIN_MODE)) == 0)
error(1, -1, "cannot write %s", outname);