diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2014-03-06 15:02:58 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2014-03-06 15:02:58 +0000 |
commit | a859338462e1d8bc6c0bbeb0403d84727a190011 (patch) | |
tree | ac36f0d34dfda261ffe00375610766aaea43368c /Build | |
parent | 05e88b695a1d56112eee8b4fa0d57f0a1f738231 (diff) |
texk/dvipdfm-x: remove unused code
git-svn-id: svn://tug.org/texlive/trunk@33106 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/dvipdfm-x/ChangeLog | 6 | ||||
-rw-r--r-- | Build/source/texk/dvipdfm-x/dvi.c | 69 | ||||
-rw-r--r-- | Build/source/texk/dvipdfm-x/dvipdfmx.c | 6 | ||||
-rw-r--r-- | Build/source/texk/dvipdfm-x/pdfdraw.c | 51 |
4 files changed, 29 insertions, 103 deletions
diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog index 867eed20c71..471e96170b7 100644 --- a/Build/source/texk/dvipdfm-x/ChangeLog +++ b/Build/source/texk/dvipdfm-x/ChangeLog @@ -1,3 +1,9 @@ +2014-03-06 Peter Breitenlohner <peb@mppmu.mpg.de> + + * dvi.c, dvipdfmx.c: Remove unused code. + * pdfdraw.c: Remove unused arg1 of pdf_dev__rectshape() and + pdf_dev__flushpath(). + 2014-01-27 TANAKA Takuji <KXD02663@nifty.ne.jp> * dvipdfmx.c: Revise procedure of reading command line arguments. diff --git a/Build/source/texk/dvipdfm-x/dvi.c b/Build/source/texk/dvipdfm-x/dvi.c index a18a6ab9dc0..4431fbde7a2 100644 --- a/Build/source/texk/dvipdfm-x/dvi.c +++ b/Build/source/texk/dvipdfm-x/dvi.c @@ -2,7 +2,7 @@ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2002-2013 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2014 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -181,7 +181,6 @@ static unsigned char* dvi_page_buffer; static unsigned long dvi_page_buf_size; static unsigned long dvi_page_buf_index; -#if 1 /* functions to read numbers from the dvi file and store them in dvi_page_buffer */ static UNSIGNED_BYTE get_and_buffer_unsigned_byte (FILE *file) { @@ -380,28 +379,6 @@ static UNSIGNED_QUAD get_buffered_unsigned_quad(void) } return (UNSIGNED_QUAD) quad; } -#else -#define get_and_buffer_unsigned_byte(fp) get_unsigned_byte(fp) -#if 0 -#define get_and_buffer_signed_byte(fp) get_signed_byte(fp) -#endif -#define get_and_buffer_unsigned_pair(fp) get_unsigned_pair(fp) -#define get_and_buffer_signed_pair(fp) get_signed_pair(fp) -#define get_and_buffer_unsigned_triple(fp) get_unsigned_triple(fp) -#define get_and_buffer_signed_triple(fp) get_signed_triple(fp) -#define get_and_buffer_signed_quad(fp) get_unsigned_quad(fp) -#define get_and_buffer_unsigned_quad(fp) get_unsigned_quad(fp) -#define get_and_buffer_bytes(fp, ct) seek_relative(fp, ct) - -#define get_buffered_unsigned_byte() get_unsigned_byte(dvi_file) -#define get_buffered_signed_byte() get_signed_byte(dvi_file) -#define get_buffered_unsigned_pair() get_unsigned_pair(dvi_file) -#define get_buffered_signed_pair() get_signed_pair(dvi_file) -#define get_buffered_unsigned_triple() get_unsigned_triple(dvi_file) -#define get_buffered_signed_triple() get_signed_triple(dvi_file) -#define get_buffered_signed_quad() get_signed_quad(dvi_file) -#define get_buffered_unsigned_quad() get_unsigned_quad(dvi_file) -#endif void dvi_set_verbose (void) @@ -1663,7 +1640,6 @@ skip_fntdef (void) } } -#if 1 /* when pre-scanning the page, we process fntdef and remove the fntdef opcode from the buffer */ #define DO_FNTDEF(f) \ @@ -1675,11 +1651,6 @@ skip_fntdef (void) skip_fntdef(); \ --dvi_page_buf_index; \ } -#else -#define DO_FNTDEF(f) \ - f(dvi_file); \ - skip_fntdef(); -#endif static void do_fntdef1 (int scanning) @@ -1790,20 +1761,8 @@ do_fnt4 (void) static void do_xxx (UNSIGNED_QUAD size) { -#if 1 dvi_do_special(dvi_page_buffer + dvi_page_buf_index, size); dvi_page_buf_index += size; -#else - UNSIGNED_QUAD i; - Ubyte *buffer; - - buffer = NEW(size+1, Ubyte); - for (i = 0; i < size; i++) { - buffer[i] = get_buffered_unsigned_byte(); - } - dvi_do_special(buffer, size); - RELEASE(buffer); -#endif } static void @@ -2071,15 +2030,9 @@ dvi_do_page (long n, unsigned char sbuf[SBUF_SIZE]; unsigned int slen = 0; -#if 1 /* before this is called, we have scanned the page for papersize specials and the complete DVI data is now in dvi_page_buffer */ dvi_page_buf_index = 0; -#else - if (!page_loc || n >= num_pages) - ERROR("Tried to process non-existent page: %ld", n); - seek_absolute(dvi_file, page_loc[n]); -#endif /* DVI coordinate */ dev_origin_x = hmargin; @@ -2302,10 +2255,8 @@ dvi_init (char *dvi_filename, double mag) } clear_state(); -#if 1 dvi_page_buf_size = DVI_PAGE_BUF_CHUNK; dvi_page_buffer = NEW(dvi_page_buf_size, unsigned char); -#endif return dvi2pts; } @@ -2642,11 +2593,8 @@ dvi_scan_specials (long page_no, FILE *fp = dvi_file; long offset; unsigned char opcode; -#if 1 static long buffered_page = -1; -#endif -#if 1 if (page_no == buffered_page) return; /* because dvipdfmx wants to scan first page twice! */ buffered_page = page_no; @@ -2654,9 +2602,6 @@ dvi_scan_specials (long page_no, dvi_page_buf_index = 0; if (!linear) { -#else - { -#endif if (page_no >= num_pages) ERROR("Invalid page number: %u", page_no); offset = page_loc[page_no]; @@ -2671,37 +2616,25 @@ dvi_scan_specials (long page_no, else if (opcode == XXX1 || opcode == XXX2 || opcode == XXX3 || opcode == XXX4) { UNSIGNED_QUAD size; -#if 1 -#else - char *buf; -#endif switch (opcode) { case XXX1: size = get_and_buffer_unsigned_byte(fp); break; case XXX2: size = get_and_buffer_unsigned_pair(fp); break; case XXX3: size = get_and_buffer_unsigned_triple(fp); break; case XXX4: size = get_and_buffer_unsigned_quad(fp); break; } -#if 1 if (dvi_page_buf_index + size >= dvi_page_buf_size) { dvi_page_buf_size = (dvi_page_buf_index + size + DVI_PAGE_BUF_CHUNK); dvi_page_buffer = RENEW(dvi_page_buffer, dvi_page_buf_size, unsigned char); } #define buf (char*)dvi_page_buffer + dvi_page_buf_index -#else - buf = NEW(size, char); -#endif if (fread(buf, sizeof(char), size, fp) != size) ERROR("Reading DVI file failed!"); if (scan_special(page_width, page_height, x_offset, y_offset, landscape, minorversion, do_enc, key_bits, permission, owner_pw, user_pw, buf, size)) WARN("Reading special command failed: \"%.*s\"", size, buf); -#if 1 #undef buf dvi_page_buf_index += size; -#else - RELEASE(buf); -#endif continue; } diff --git a/Build/source/texk/dvipdfm-x/dvipdfmx.c b/Build/source/texk/dvipdfm-x/dvipdfmx.c index 85c19b4ac9e..530debde169 100644 --- a/Build/source/texk/dvipdfm-x/dvipdfmx.c +++ b/Build/source/texk/dvipdfm-x/dvipdfmx.c @@ -6,7 +6,7 @@ Copyright (c) 2006 SIL. (xdvipdfmx extensions for XeTeX support) - Copyright (C) 2002-2013 by Jin-Hwan Cho, Matthias Franz, and Shunsaku Hirata, + Copyright (C) 2002-2014 by Jin-Hwan Cho, Matthias Franz, and Shunsaku Hirata, the DVIPDFMx project team. Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -958,15 +958,11 @@ main (int argc, char *argv[]) dpx_delete_old_cache(image_cache_life); if (!dvi_filename) { -#if 1 if (verbose) MESG("No dvi filename specified, reading standard input.\n"); if (!pdf_filename) if (verbose) MESG("No pdf filename specified, writing to standard output.\n"); -#else - ERROR("dvipdfmx needs an input dvi file!"); -#endif } else if (!pdf_filename) set_default_pdf_filename(); diff --git a/Build/source/texk/dvipdfm-x/pdfdraw.c b/Build/source/texk/dvipdfm-x/pdfdraw.c index 9bbd18d5c03..c01228ccdc8 100644 --- a/Build/source/texk/dvipdfm-x/pdfdraw.c +++ b/Build/source/texk/dvipdfm-x/pdfdraw.c @@ -41,10 +41,6 @@ #include "pdfdraw.h" -#if 1 -typedef void pdf_dev; -#endif - /* * Numbers are rounding to 0-5 fractional digits @@ -61,9 +57,7 @@ inversematrix (pdf_tmatrix *W, const pdf_tmatrix *M) det = detP(M); if (fabs(det) < 1.e-8) { -#if 1 WARN("Inverting matrix with zero determinant..."); -#endif return -1; /* result is undefined. */ } @@ -265,9 +259,8 @@ static const struct { #define GS_FLAG_CURRENTPOINT_SET (1 << 0) -static char fmt_buf[1024]; /* FIXME */ -#define FORMAT_BUFF_PTR(p) fmt_buf -#define FORMAT_BUFF_LEN(p) 1024 +#define FORMAT_BUFF_LEN 1024 +static char fmt_buf[FORMAT_BUFF_LEN]; static void init_a_path (pdf_path *p) @@ -743,13 +736,12 @@ INVERTIBLE_MATRIX (const pdf_tmatrix *M) * current graphcs state parameter. */ static int -pdf_dev__rectshape (pdf_dev *P, - const pdf_rect *r, +pdf_dev__rectshape (const pdf_rect *r, const pdf_tmatrix *M, char opchr ) { - char *buf = FORMAT_BUFF_PTR(P); + char *buf = fmt_buf; int len = 0; int isclip = 0; pdf_coord p; @@ -811,15 +803,14 @@ static int path_added = 0; /* FIXME */ static int -pdf_dev__flushpath (pdf_dev *P, - pdf_path *pa, +pdf_dev__flushpath (pdf_path *pa, char opchr, int rule, int ignore_rule) { pa_elem *pe, *pe1; - char *b = FORMAT_BUFF_PTR(P); - long b_len = FORMAT_BUFF_LEN(P); + char *b = fmt_buf; + long b_len = FORMAT_BUFF_LEN; pdf_rect r; /* FIXME */ pdf_coord *pt; int n_pts, n_seg; @@ -1318,7 +1309,7 @@ pdf_dev_concat (const pdf_tmatrix *M) pdf_coord *cpt = &gs->cp; pdf_tmatrix *CTM = &gs->matrix; pdf_tmatrix W = {0, 0, 0, 0, 0, 0}; /* Init to avoid compiler warning */ - char *buf = FORMAT_BUFF_PTR(NULL); + char *buf = fmt_buf; int len = 0; ASSERT(M); @@ -1369,7 +1360,7 @@ pdf_dev_setmiterlimit (double mlimit) m_stack *gss = &gs_stack; pdf_gstate *gs = m_stack_top(gss); int len = 0; - char *buf = FORMAT_BUFF_PTR(NULL); + char *buf = fmt_buf; if (gs->miterlimit != mlimit) { buf[len++] = ' '; @@ -1389,7 +1380,7 @@ pdf_dev_setlinecap (int capstyle) m_stack *gss = &gs_stack; pdf_gstate *gs = m_stack_top(gss); int len = 0; - char *buf = FORMAT_BUFF_PTR(NULL); + char *buf = fmt_buf; if (gs->linecap != capstyle) { len = sprintf(buf, " %d J", capstyle); @@ -1406,7 +1397,7 @@ pdf_dev_setlinejoin (int joinstyle) m_stack *gss = &gs_stack; pdf_gstate *gs = m_stack_top(gss); int len = 0; - char *buf = FORMAT_BUFF_PTR(NULL); + char *buf = fmt_buf; if (gs->linejoin != joinstyle) { len = sprintf(buf, " %d j", joinstyle); @@ -1423,7 +1414,7 @@ pdf_dev_setlinewidth (double width) m_stack *gss = &gs_stack; pdf_gstate *gs = m_stack_top(gss); int len = 0; - char *buf = FORMAT_BUFF_PTR(NULL); + char *buf = fmt_buf; if (gs->linewidth != width) { buf[len++] = ' '; @@ -1443,7 +1434,7 @@ pdf_dev_setdash (int count, double *pattern, double offset) m_stack *gss = &gs_stack; pdf_gstate *gs = m_stack_top(gss); int len = 0; - char *buf = FORMAT_BUFF_PTR(NULL); + char *buf = fmt_buf; int i; gs->linedash.num_dash = count; @@ -1470,7 +1461,7 @@ pdf_dev_setflat (int flatness) m_stack *gss = &gs_stack; pdf_gstate *gs = m_stack_top(gss); int len = 0; - char *buf = FORMAT_BUFF_PTR(NULL); + char *buf = fmt_buf; if (flatness < 0 || flatness > 100) return -1; @@ -1493,7 +1484,7 @@ pdf_dev_clip (void) pdf_gstate *gs = m_stack_top(gss); pdf_path *cpa = &gs->path; - return pdf_dev__flushpath(NULL, cpa, 'W', PDF_FILL_RULE_NONZERO, 0); + return pdf_dev__flushpath(cpa, 'W', PDF_FILL_RULE_NONZERO, 0); } int @@ -1503,7 +1494,7 @@ pdf_dev_eoclip (void) pdf_gstate *gs = m_stack_top(gss); pdf_path *cpa = &gs->path; - return pdf_dev__flushpath(NULL, cpa, 'W', PDF_FILL_RULE_EVENODD, 0); + return pdf_dev__flushpath(cpa, 'W', PDF_FILL_RULE_EVENODD, 0); } int @@ -1518,7 +1509,7 @@ pdf_dev_flushpath (char p_op, int fill_rule) * that can be converted to a rect where fill rule * is inessential. */ - error = pdf_dev__flushpath(NULL, cpa, p_op, fill_rule, 1); + error = pdf_dev__flushpath(cpa, p_op, fill_rule, 1); pdf_path__clearpath(cpa); gs->flags &= ~GS_FLAG_CURRENTPOINT_SET; @@ -1820,7 +1811,7 @@ pdf_dev_rectstroke (double x, double y, r.urx = x + w; r.ury = y + h; - return pdf_dev__rectshape(NULL, &r, M, 'S'); + return pdf_dev__rectshape(&r, M, 'S'); } #endif @@ -1835,7 +1826,7 @@ pdf_dev_rectfill (double x, double y, r.urx = x + w; r.ury = y + h; - return pdf_dev__rectshape(NULL, &r, NULL, 'f'); + return pdf_dev__rectshape(&r, NULL, 'f'); } int @@ -1849,7 +1840,7 @@ pdf_dev_rectclip (double x, double y, r.urx = x + w; r.ury = y + h; - return pdf_dev__rectshape(NULL, &r, NULL, 'W'); + return pdf_dev__rectshape(&r, NULL, 'W'); } int @@ -1864,7 +1855,7 @@ pdf_dev_rectadd (double x, double y, r.ury = y + h; path_added = 1; - return pdf_dev__rectshape(NULL, &r, NULL, ' '); + return pdf_dev__rectshape(&r, NULL, ' '); } void |