diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2015-03-26 12:26:38 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2015-03-26 12:26:38 +0000 |
commit | fcd2cf22a4d38dcb230d9dd32b068620496bfe56 (patch) | |
tree | 92e457f1242e0ad63562b25fe70278ad9a1c46f8 /Build/source | |
parent | a10e44454a132f6244e5f7fce7b8ea614c917815 (diff) |
texk/web2c/xetexdir: Drop unused types and functions
git-svn-id: svn://tug.org/texlive/trunk@36632 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r-- | Build/source/texk/web2c/xetexdir/ChangeLog | 7 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/image/jpegimage.c | 8 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/image/mfileio.c | 8 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/image/mfileio.h | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/image/numbers.c | 198 | ||||
-rw-r--r-- | Build/source/texk/web2c/xetexdir/image/numbers.h | 25 |
6 files changed, 26 insertions, 224 deletions
diff --git a/Build/source/texk/web2c/xetexdir/ChangeLog b/Build/source/texk/web2c/xetexdir/ChangeLog index 7f340a9a8b8..ac7eccfafcc 100644 --- a/Build/source/texk/web2c/xetexdir/ChangeLog +++ b/Build/source/texk/web2c/xetexdir/ChangeLog @@ -1,3 +1,10 @@ +2015-03-26 Peter Breitenlohner <peb@mppmu.mpg.de> + + * image/jpegimage.c: Drop redundant #include directives. + * image/{mfileio,numbers}.c: First '#include <w2c/config.h>'. + * image/mfileio.h, image/numbers.[ch]: Drop unused types and + functions. + 2015-03-22 Akira Kakuto <kakuto@fuk.kindai.ac.jp> * XeTeX_ext.c: The SELFAUTOLOC issue has been considered on W32 diff --git a/Build/source/texk/web2c/xetexdir/image/jpegimage.c b/Build/source/texk/web2c/xetexdir/image/jpegimage.c index 4f40e410ca0..6a42962ae04 100644 --- a/Build/source/texk/web2c/xetexdir/image/jpegimage.c +++ b/Build/source/texk/web2c/xetexdir/image/jpegimage.c @@ -24,7 +24,7 @@ /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2002-2014 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2015 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -78,14 +78,8 @@ #include "mfileio.h" #include "numbers.h" - #include "jpegimage.h" -#include <stdlib.h> -#include <string.h> - -#include "kpathsea/lib.h" /* for xmalloc/xrealloc prototypes */ - #define JPEG_DEBUG_STR "JPEG" #define JPEG_DEBUG 3 diff --git a/Build/source/texk/web2c/xetexdir/image/mfileio.c b/Build/source/texk/web2c/xetexdir/image/mfileio.c index 977f74b165c..a12efb130ef 100644 --- a/Build/source/texk/web2c/xetexdir/image/mfileio.c +++ b/Build/source/texk/web2c/xetexdir/image/mfileio.c @@ -2,7 +2,7 @@ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2002 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2015 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team <dvipdfmx@project.ktug.or.kr> Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -22,8 +22,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#include <stdio.h> -#include <stdlib.h> +#if HAVE_CONFIG_H +#include <w2c/config.h> +#endif + #include "mfileio.h" #ifdef IODEBUG diff --git a/Build/source/texk/web2c/xetexdir/image/mfileio.h b/Build/source/texk/web2c/xetexdir/image/mfileio.h index e31fef23244..039284ff8c5 100644 --- a/Build/source/texk/web2c/xetexdir/image/mfileio.h +++ b/Build/source/texk/web2c/xetexdir/image/mfileio.h @@ -2,7 +2,7 @@ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2002 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2015 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team <dvipdfmx@project.ktug.or.kr> Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -41,8 +41,6 @@ int mfclose (FILE *file, const char *function, int line); #define MFCLOSE(file) fclose(file) #endif -extern UNSIGNED_BYTE read_byte (FILE *); - extern void seek_absolute (FILE *file, long pos); extern void seek_relative (FILE *file, long pos); diff --git a/Build/source/texk/web2c/xetexdir/image/numbers.c b/Build/source/texk/web2c/xetexdir/image/numbers.c index 06864f1e2bb..53a3ff76460 100644 --- a/Build/source/texk/web2c/xetexdir/image/numbers.c +++ b/Build/source/texk/web2c/xetexdir/image/numbers.c @@ -2,7 +2,7 @@ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2002 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2015 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team <dvipdfmx@project.ktug.or.kr> Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -22,206 +22,26 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#include <stdlib.h> +#if HAVE_CONFIG_H +#include <w2c/config.h> +#endif #include "mfileio.h" #include "numbers.h" -UNSIGNED_BYTE get_unsigned_byte (FILE *file) +unsigned char get_unsigned_byte (FILE *file) { int ch; if ((ch = fgetc (file)) < 0) { fprintf (stderr, "File ended prematurely\n"); exit(-1); } - return (UNSIGNED_BYTE) ch; -} - -UNSIGNED_BYTE sget_unsigned_byte (char *s) -{ - return *((unsigned char *) s); -} - -SIGNED_BYTE get_signed_byte (FILE *file) -{ - int byte; - byte = get_unsigned_byte(file); - if (byte >= 0x80) - byte -= 0x100; - return (SIGNED_BYTE) byte; + return (unsigned char) ch; } -UNSIGNED_PAIR get_unsigned_pair (FILE *file) +unsigned short get_unsigned_pair (FILE *file) { - int i; - UNSIGNED_BYTE byte; - UNSIGNED_PAIR pair = 0; - for (i=0; i<2; i++) { - byte = get_unsigned_byte(file); - pair = pair*0x100u + byte; - } - return pair; -} - -UNSIGNED_PAIR sget_unsigned_pair (unsigned char *s) -{ - int i; - UNSIGNED_BYTE byte; - UNSIGNED_PAIR pair = 0; - for (i=0; i<2; i++) { - byte = *(s++); - pair = pair*0x100u + byte; - } + unsigned short pair = get_unsigned_byte(file); + pair = pair*0x100u + get_unsigned_byte(file); return pair; } - -SIGNED_PAIR get_signed_pair (FILE *file) -{ - int i; - long pair = 0; - for (i=0; i<2; i++) { - pair = pair*0x100 + get_unsigned_byte(file); - } - if (pair >= 0x8000) { - pair -= 0x10000l; - } - return (SIGNED_PAIR) pair; -} - - -UNSIGNED_TRIPLE get_unsigned_triple(FILE *file) -{ - int i; - long triple = 0; - for (i=0; i<3; i++) { - triple = triple*0x100u + get_unsigned_byte(file); - } - return (UNSIGNED_TRIPLE) triple; -} - -SIGNED_TRIPLE get_signed_triple(FILE *file) -{ - int i; - long triple = 0; - for (i=0; i<3; i++) { - triple = triple*0x100 + get_unsigned_byte(file); - } - if (triple >= 0x800000l) - triple -= 0x1000000l; - return (SIGNED_TRIPLE) triple; -} - -SIGNED_QUAD get_signed_quad(FILE *file) -{ - int byte, i; - long quad = 0; - - /* Check sign on first byte before reading others */ - byte = get_unsigned_byte(file); - quad = byte; - if (quad >= 0x80) - quad = byte - 0x100; - for (i=0; i<3; i++) { - quad = quad*0x100 + get_unsigned_byte(file); - } - return (SIGNED_QUAD) quad; -} - -UNSIGNED_QUAD get_unsigned_quad(FILE *file) -{ - int i; - unsigned long quad = 0; - for (i=0; i<4; i++) { - quad = quad*0x100u + get_unsigned_byte(file); - } - return (UNSIGNED_QUAD) quad; -} - -#if 0 -SIGNED_QUAD sqxfw (SIGNED_QUAD sq, fixword fw) -{ - int sign = 1; - unsigned long a, b, c, d, ad, bd, bc, ac; - unsigned long e, f, g, h, i, j, k; - unsigned long result; - /* Make positive. */ - if (sq < 0) { - sign = -sign; - sq = -sq; - } - if (fw < 0) { - sign = -sign; - fw = -fw; - } - a = ((unsigned long) sq) >> 16u; - b = ((unsigned long) sq) & 0xffffu; - c = ((unsigned long) fw) >> 16u; - d = ((unsigned long) fw) & 0xffffu; - ad = a*d; bd = b*d; bc = b*c; ac = a*c; - e = bd >> 16u; - f = ad >> 16u; - g = ad & 0xffffu; - h = bc >> 16u; - i = bc & 0xffffu; - j = ac >> 16u; - k = ac & 0xffffu; - result = (e+g+i + (1<<3)) >> 4u; /* 1<<3 is for rounding */ - result += (f+h+k) << 12u; - result += j << 28u; - return (sign > 0) ? result : result * -1L; -} - -SIGNED_QUAD axboverc (SIGNED_QUAD n1, SIGNED_QUAD n2, SIGNED_QUAD divide) -{ - int sign = 1; - unsigned long a, b, c, d, ad, bd, bc, ac, e, f, g, h, i, j, o; - unsigned long high, low; - SIGNED_QUAD result = 0; - /* Make positive. */ - if (n1 < 0) { - sign = -sign; - n1 = -n1; - } - if (n2 < 0) { - sign = -sign; - n2 = -n2; - } - if (divide < 0) { - sign = -sign; - divide = -divide; - } - a = ((unsigned long) n1) >> 16u; - b = ((unsigned long) n1) & 0xffffu; - c = ((unsigned long) n2) >> 16u; - d = ((unsigned long) n2) & 0xffffu; - ad = a*d; bd = b*d; bc = b*c; ac = a*c; - e = bd >> 16u; f = bd & 0xffffu; - g = ad >> 16u; h = ad & 0xffffu; - i = bc >> 16u; j = bc & 0xffffu; - o = e+h+j; - high = g+i+(o>>16u)+ac; o &= 0xffffu; - low = (o << 16) + f; - if (high >= divide) - ERROR ("Overflow in axboc"); - { - int k; - for (k=0; k<32; k++) { - high *= 2; - result *= 2; - if (low >= 0x80000000) { - low -= 0x80000000; - high += 1; - } - low *= 2; - if (high > divide) { - high -= divide; - result += 1; - } - } - } - high *= 2; - if (high >= divide) - result += 1; - return (sign>0)?result:-result; -} -#endif diff --git a/Build/source/texk/web2c/xetexdir/image/numbers.h b/Build/source/texk/web2c/xetexdir/image/numbers.h index 1f61607654e..b7fb124e5ef 100644 --- a/Build/source/texk/web2c/xetexdir/image/numbers.h +++ b/Build/source/texk/web2c/xetexdir/image/numbers.h @@ -2,7 +2,7 @@ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2002, 2012 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2015 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team <dvipdfmx@project.ktug.or.kr> Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu> @@ -28,27 +28,8 @@ #include <stdio.h> #include <math.h> -typedef unsigned char Ubyte; -typedef int UNSIGNED_BYTE, SIGNED_BYTE, SIGNED_PAIR; -typedef unsigned UNSIGNED_PAIR; -typedef long UNSIGNED_TRIPLE, SIGNED_TRIPLE, SIGNED_QUAD; -typedef unsigned long UNSIGNED_QUAD; - -extern UNSIGNED_BYTE get_unsigned_byte (FILE *); -extern UNSIGNED_BYTE sget_unsigned_byte (char *); -extern SIGNED_BYTE get_signed_byte (FILE *); -extern UNSIGNED_PAIR get_unsigned_pair (FILE *); -extern UNSIGNED_PAIR sget_unsigned_pair (unsigned char *); -extern SIGNED_PAIR get_signed_pair (FILE *); -extern UNSIGNED_TRIPLE get_unsigned_triple (FILE *); -extern SIGNED_TRIPLE get_signed_triple (FILE *); -extern SIGNED_QUAD get_signed_quad (FILE *); -extern UNSIGNED_QUAD get_unsigned_quad (FILE *); - -typedef signed long fixword; - -extern SIGNED_QUAD sqxfw (SIGNED_QUAD sq, fixword fw); -extern SIGNED_QUAD axboverc (SIGNED_QUAD n1, SIGNED_QUAD n2, SIGNED_QUAD divide); +extern unsigned char get_unsigned_byte (FILE *); +extern unsigned short get_unsigned_pair (FILE *); #ifndef MAX # define MAX(a,b) ((a)>(b)?(a):(b)) |