summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorJonathan Kew <jfkthame@googlemail.com>2008-04-27 20:18:39 +0000
committerJonathan Kew <jfkthame@googlemail.com>2008-04-27 20:18:39 +0000
commit610515863eb0735c5cc2728fd3a46dd9dc1448ac (patch)
tree86ff3aa60c31c6f1560b67778c48a95e329e0655 /Build
parentd2b812efcb00f795dc13fba2c60a3260f2255699 (diff)
xdvipdfmx portability fix and warning reduction, cf xetex svn r.662
git-svn-id: svn://tug.org/texlive/trunk@7683 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/xdvipdfmx/src/dvipdfmx.c4
-rw-r--r--Build/source/texk/xdvipdfmx/src/error.c10
-rw-r--r--Build/source/texk/xdvipdfmx/src/error.h2
-rw-r--r--Build/source/texk/xdvipdfmx/src/pdfobj.c17
-rw-r--r--Build/source/texk/xdvipdfmx/src/spc_dvips.c4
5 files changed, 20 insertions, 17 deletions
diff --git a/Build/source/texk/xdvipdfmx/src/dvipdfmx.c b/Build/source/texk/xdvipdfmx/src/dvipdfmx.c
index 2eeb6e10972..b04a8f809eb 100644
--- a/Build/source/texk/xdvipdfmx/src/dvipdfmx.c
+++ b/Build/source/texk/xdvipdfmx/src/dvipdfmx.c
@@ -439,7 +439,7 @@ do_args (int argc, char *argv[])
WARN("dvipdfm \"-e\" option not supported.");
break;
case 'q':
- really_quiet = 1;
+ really_quiet++;
break;
case 'v':
verbose++;
@@ -837,7 +837,7 @@ main (int argc, char *argv[])
do_args (argc, argv);
if (really_quiet)
- shut_up();
+ shut_up(really_quiet);
#ifndef MIKTEX
kpse_init_prog("", font_dpi, NULL, NULL);
diff --git a/Build/source/texk/xdvipdfmx/src/error.c b/Build/source/texk/xdvipdfmx/src/error.c
index ac0a1d8a79f..b23571879d5 100644
--- a/Build/source/texk/xdvipdfmx/src/error.c
+++ b/Build/source/texk/xdvipdfmx/src/error.c
@@ -37,9 +37,9 @@ static int _mesg_type = DPX_MESG;
static int really_quiet = 0;
void
-shut_up (void)
+shut_up (int quietness)
{
- really_quiet = 1;
+ really_quiet = quietness;
}
void
@@ -47,7 +47,7 @@ MESG (const char *fmt, ...)
{
va_list argp;
- if (!really_quiet) {
+ if (really_quiet < 1) {
va_start(argp, fmt);
vfprintf(stderr, fmt, argp);
va_end(argp);
@@ -60,7 +60,7 @@ WARN (const char *fmt, ...)
{
va_list argp;
- if (!really_quiet) {
+ if (really_quiet < 2) {
if (WANT_NEWLINE())
fprintf(stderr, "\n");
fprintf(stderr, "** WARNING ** ");
@@ -80,7 +80,7 @@ ERROR (const char *fmt, ...)
{
va_list argp;
- if (!really_quiet) {
+ if (really_quiet < 3) {
if (WANT_NEWLINE())
fprintf(stderr, "\n");
fprintf(stderr, "** ERROR ** ");
diff --git a/Build/source/texk/xdvipdfmx/src/error.h b/Build/source/texk/xdvipdfmx/src/error.h
index 68b414d20c5..762cc282a51 100644
--- a/Build/source/texk/xdvipdfmx/src/error.h
+++ b/Build/source/texk/xdvipdfmx/src/error.h
@@ -35,7 +35,7 @@ extern void error_cleanup();
#include <assert.h>
#include <stdio.h>
-extern void shut_up (void);
+extern void shut_up (int quietness);
extern void ERROR (const char *fmt, ...);
extern void MESG (const char *fmt, ...);
diff --git a/Build/source/texk/xdvipdfmx/src/pdfobj.c b/Build/source/texk/xdvipdfmx/src/pdfobj.c
index 1ad7de2a928..2a7ec02ac92 100644
--- a/Build/source/texk/xdvipdfmx/src/pdfobj.c
+++ b/Build/source/texk/xdvipdfmx/src/pdfobj.c
@@ -410,13 +410,14 @@ dump_xref_stream (void)
for (i = 0; i < next_label; i++) {
unsigned j;
+ unsigned short f3;
buf[0] = output_xref[i].type;
pos = output_xref[i].field2;
for (j = poslen; j--; ) {
buf[1+j] = (unsigned char) pos;
pos >>= 8;
}
- unsigned short f3 = output_xref[i].field3;
+ f3 = output_xref[i].field3;
buf[poslen+1] = (unsigned char) (f3 >> 8);
buf[poslen+2] = (unsigned char) (f3);
pdf_add_stream(xref_stream, &buf, poslen+3);
@@ -1885,25 +1886,27 @@ static void
pdf_flush_objstm (pdf_objstm *objstm)
{
unsigned char pos = objstm->pos;
- pdf_obj *stream_obj = objstm->stream;
+ pdf_obj *stream_obj = objstm->stream, *dict;
+ pdf_stream *stream;
+ unsigned char *old_buf;
+ unsigned long old_length, i;
TYPECHECK(stream_obj, PDF_STREAM);
- pdf_stream *stream = (pdf_stream *) stream_obj->data;
+ stream = (pdf_stream *) stream_obj->data;
/* Precede stream data by offset table */
- unsigned char *old_buf = stream->stream;
- unsigned long old_length = stream->stream_length;
+ old_buf = stream->stream;
+ old_length = stream->stream_length;
/* Reserve 22 bytes for each entry (two 10 digit numbers plus two spaces) */
stream->stream = NEW(old_length + 22*pos, unsigned char);
stream->stream_length = 0;
- unsigned char i;
for (i = 0; i < pos; i++) {
long length = sprintf(format_buffer, "%lu %lu ",
objstm->obj_label[i], objstm->obj_pos[i]);
pdf_add_stream(stream_obj, format_buffer, length);
}
- pdf_obj *dict = pdf_stream_dict(stream_obj);
+ dict = pdf_stream_dict(stream_obj);
pdf_add_dict(dict, pdf_new_name("Type"), pdf_new_name("ObjStm"));
pdf_add_dict(dict, pdf_new_name("N"), pdf_new_number(pos));
pdf_add_dict(dict, pdf_new_name("First"), pdf_new_number(stream->stream_length));
diff --git a/Build/source/texk/xdvipdfmx/src/spc_dvips.c b/Build/source/texk/xdvipdfmx/src/spc_dvips.c
index 2eac7ebcbd1..70484258032 100644
--- a/Build/source/texk/xdvipdfmx/src/spc_dvips.c
+++ b/Build/source/texk/xdvipdfmx/src/spc_dvips.c
@@ -470,7 +470,7 @@ check_next_obj(unsigned char * buffer)
return 0;
}
- if (strncmp(buffer, "pst:", 4))
+ if (strncmp((char*)buffer, "pst:", 4))
return 0;
return 1;
}
@@ -594,7 +594,7 @@ spc_handler_ps_tricks_render (struct spc_env *spe, struct spc_arg *args)
fwrite(args->curptr, 1, args->endptr - args->curptr, fp);
fprintf(fp, "\ncount 1 sub {pop} repeat restore\n");
- if (check_next_obj(args->endptr)) {
+ if (check_next_obj((unsigned char*)args->endptr)) {
fclose(fp);
} else {
char *distiller_template = get_distiller_template();