summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipdfm-x/numbers.h
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2014-08-20 10:46:22 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2014-08-20 10:46:22 +0000
commit418eab4ae66c2d3f4d636feda4aa6e61bffad7f2 (patch)
tree68bcb3aaa4a67a9b58d5ec79bc62af9fe85e4fc0 /Build/source/texk/dvipdfm-x/numbers.h
parent53c39c070e16923aa7b27141d330883eee19f7eb (diff)
texk/dvipdfm-x: Simplify handling of DVI commands. Clarify signed vs unsigned four byte numbers
git-svn-id: svn://tug.org/texlive/trunk@34990 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfm-x/numbers.h')
-rw-r--r--Build/source/texk/dvipdfm-x/numbers.h23
1 files changed, 16 insertions, 7 deletions
diff --git a/Build/source/texk/dvipdfm-x/numbers.h b/Build/source/texk/dvipdfm-x/numbers.h
index 6f03c980d75..06e987ca200 100644
--- a/Build/source/texk/dvipdfm-x/numbers.h
+++ b/Build/source/texk/dvipdfm-x/numbers.h
@@ -25,17 +25,29 @@
#include <stdio.h>
#include <math.h>
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+
+/* When reading numbers from binary files 1, 2, or 3 bytes are
+ interpreted as either signed or unsigned.
+
+ Four bytes from DVI, PK, TFM, or VF files always yield a signed
+ 32-bit integer (int32_t), but some of them must not be negative.
+
+ Four byte numbers from JPEG2000, OpenType, or TrueType files are
+ mostly unsigned (uint32_t) and occasionally signed (int32_t).
+*/
-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 *);
-#if 0
-extern UNSIGNED_BYTE sget_unsigned_byte (char *);
-#endif
extern SIGNED_BYTE get_signed_byte (FILE *);
extern UNSIGNED_PAIR get_unsigned_pair (FILE *);
extern UNSIGNED_PAIR sget_unsigned_pair (unsigned char *);
@@ -48,9 +60,6 @@ extern UNSIGNED_QUAD get_unsigned_quad (FILE *);
typedef signed long fixword;
extern SIGNED_QUAD sqxfw (SIGNED_QUAD sq, fixword fw);
-#if 0
-extern SIGNED_QUAD axboverc (SIGNED_QUAD n1, SIGNED_QUAD n2, SIGNED_QUAD divide);
-#endif
#ifndef MAX
# define MAX(a,b) ((a)>(b)?(a):(b))