summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipdfm-x/tt_cmap.c
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2015-08-24 08:49:38 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2015-08-24 08:49:38 +0000
commit186bbd00ffa404c29caaeeeee89437c127e95df7 (patch)
tree1adffc6952f6d43b9ecd8002064da7189fbeae5d /Build/source/texk/dvipdfm-x/tt_cmap.c
parent90e1eb12c7fa4c597d0b72e1a8af3186110e2bb2 (diff)
texk/dvipdfm-x: No reason to use 'long' for 32-bit integers
git-svn-id: svn://tug.org/texlive/trunk@38194 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfm-x/tt_cmap.c')
-rw-r--r--Build/source/texk/dvipdfm-x/tt_cmap.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/Build/source/texk/dvipdfm-x/tt_cmap.c b/Build/source/texk/dvipdfm-x/tt_cmap.c
index e760a7c082a..c1aa14d913a 100644
--- a/Build/source/texk/dvipdfm-x/tt_cmap.c
+++ b/Build/source/texk/dvipdfm-x/tt_cmap.c
@@ -563,7 +563,7 @@ tt_cmap_release (tt_cmap *cmap)
USHORT
-tt_cmap_lookup (tt_cmap *cmap, long cc)
+tt_cmap_lookup (tt_cmap *cmap, ULONG cc)
{
USHORT gid = 0;
@@ -876,7 +876,8 @@ handle_subst_glyphs (CMap *cmap,
for (count = 0, i = 0; i < 8192; i++) {
int j;
- long len, inbytesleft, outbytesleft;
+ int32_t len;
+ long inbytesleft, outbytesleft;
const unsigned char *inbuf;
unsigned char *outbuf;
@@ -893,7 +894,7 @@ handle_subst_glyphs (CMap *cmap,
#define MAX_UNICODES 16
/* try to look up Unicode values from the glyph name... */
char* name;
- long unicodes[MAX_UNICODES];
+ int32_t unicodes[MAX_UNICODES];
int unicode_count = -1;
name = sfnt_get_glyphname(post, cffont, gid);
if (name) {
@@ -993,7 +994,7 @@ add_to_cmap_if_used (CMap *cmap,
wbuf[0] = (cid >> 8) & 0xff;
wbuf[1] = (cid & 0xff);
- len = UC_sput_UTF16BE((long) ch, &p, wbuf + WBUF_SIZE);
+ len = UC_sput_UTF16BE(ch, &p, wbuf + WBUF_SIZE);
CMap_add_bfchar(cmap, wbuf, 2, wbuf + 2, len);
/* Skip PUA characters and alphabetic presentation forms, allowing
@@ -1104,11 +1105,11 @@ create_ToUnicode_cmap (tt_cmap *ttcmap,
ch = CMap_reverse_decode(code_to_cid_cmap, cid);
if (ch >= 0) {
- long len;
+ int len;
unsigned char *p = wbuf + 2;
wbuf[0] = (cid >> 8) & 0xff;
wbuf[1] = cid & 0xff;
- len = UC_sput_UTF16BE((long)ch, &p, wbuf + WBUF_SIZE);
+ len = UC_sput_UTF16BE(ch, &p, wbuf + WBUF_SIZE);
CMap_add_bfchar(cmap, wbuf, 2, wbuf + 2, len);
count++;
}
@@ -1179,7 +1180,7 @@ otf_create_ToUnicode_stream (const char *font_name,
char *cmap_name;
FILE *fp = NULL;
sfnt *sfont;
- long offset = 0;
+ ULONG offset = 0;
int i, cmap_type;
/* replace slash in map name with dash to make the output cmap name valid,
@@ -1352,7 +1353,7 @@ create_cmaps (CMap *cmap, CMap *tounicode,
static void
add_glyph (struct ht_table *unencoded,
- USHORT gid, long ucv, int num_unicodes, long *unicodes)
+ USHORT gid, int32_t ucv, int num_unicodes, int32_t *unicodes)
{
struct gent *glyph;
int i;
@@ -1399,9 +1400,9 @@ handle_subst (pdf_obj *dst_obj, pdf_obj *src_obj, int flag,
struct ht_table *unencoded)
{
pdf_obj *tmp;
- long i, j, src_size, dst_size;
- long src, dst;
- long src_start, src_end, dst_start, dst_end;
+ int32_t i, j, src_size, dst_size;
+ int32_t src, dst;
+ int32_t src_start, src_end, dst_start, dst_end;
src_size = pdf_array_length(src_obj);
dst_size = pdf_array_length(dst_obj);
@@ -1416,10 +1417,10 @@ handle_subst (pdf_obj *dst_obj, pdf_obj *src_obj, int flag,
tmp = pdf_get_array(src_obj, i);
if (PDF_OBJ_ARRAYTYPE(tmp)) {
- src_start = (long) pdf_number_value(pdf_get_array(tmp, 0));
- src_end = (long) pdf_number_value(pdf_get_array(tmp, 1));
+ src_start = (int32_t) pdf_number_value(pdf_get_array(tmp, 0));
+ src_end = (int32_t) pdf_number_value(pdf_get_array(tmp, 1));
} else {
- src_start = src_end = (long) pdf_number_value(tmp);
+ src_start = src_end = (int32_t) pdf_number_value(tmp);
}
for (src = src_start; src <= src_end; src++) {
glyph = find_glyph(unencoded, src);
@@ -1432,10 +1433,10 @@ handle_subst (pdf_obj *dst_obj, pdf_obj *src_obj, int flag,
if (dst > dst_end) {
tmp = pdf_get_array(dst_obj, j++);
if (PDF_OBJ_ARRAYTYPE(tmp)) {
- dst_start = (long) pdf_number_value(pdf_get_array(tmp, 0));
- dst_end = (long) pdf_number_value(pdf_get_array(tmp, 1));
+ dst_start = (int32_t) pdf_number_value(pdf_get_array(tmp, 0));
+ dst_end = (int32_t) pdf_number_value(pdf_get_array(tmp, 1));
} else {
- dst_start = dst_end = (long) pdf_number_value(tmp);
+ dst_start = dst_end = (int32_t) pdf_number_value(tmp);
}
dst = dst_start;
}
@@ -1498,12 +1499,12 @@ handle_assign (pdf_obj *dst, pdf_obj *src, int flag,
otl_gsub *gsub_list, tt_cmap *ttcmap,
struct ht_table *unencoded)
{
- long unicodes[MAX_UNICODES], ucv;
+ int32_t unicodes[MAX_UNICODES], ucv;
int i, n_unicodes, rv;
USHORT gid_in[MAX_UNICODES], lig;
n_unicodes = pdf_array_length(src); /* FIXME */
- ucv = (long) pdf_number_value(pdf_get_array(dst, 0)); /* FIXME */
+ ucv = (int32_t) pdf_number_value(pdf_get_array(dst, 0)); /* FIXME */
if (!UC_is_valid(ucv)) {
if (flag == 'r' || flag == 'p') {
if (ucv < 0x10000) {
@@ -1513,7 +1514,7 @@ handle_assign (pdf_obj *dst, pdf_obj *src, int flag,
}
}
if (flag == 'r') {
- ERROR("Invalid Unicode code specified.", ucv);
+ ERROR("Invalid Unicode code specified.");
}
return;
}
@@ -1524,7 +1525,7 @@ handle_assign (pdf_obj *dst, pdf_obj *src, int flag,
for (i = 0; i < n_unicodes; i++) {
unicodes[i] =
- (long) pdf_number_value(pdf_get_array(src, i));
+ (int32_t) pdf_number_value(pdf_get_array(src, i));
gid_in[i] = tt_cmap_lookup(ttcmap, unicodes[i]);
if (verbose > VERBOSE_LEVEL_MIN) {
@@ -1756,7 +1757,7 @@ otf_load_Unicode_CMap (const char *map_name, int ttc_index, /* 0 for non-TTC fon
int cmap_id = -1;
int tounicode_id = -1, is_cidfont = 0;
sfnt *sfont;
- unsigned long offset = 0;
+ ULONG offset = 0;
char *base_name = NULL, *cmap_name = NULL;
char *tounicode_name = NULL;
FILE *fp = NULL;