summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2012-07-26 06:33:04 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2012-07-26 06:33:04 +0000
commitd84171379c3fd670e89155dbb8860f0b38d964d8 (patch)
tree33212471a9ddba85eadd7fc3142fd8586d0b084b
parent9f9853cc00d8112434d185ec2adebeba44a2d413 (diff)
luaTeX: Use uint64_t and PRIu64
git-svn-id: svn://tug.org/texlive/trunk@27166 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/web2c/luatexdir/ChangeLog5
-rw-r--r--Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc8
-rw-r--r--Build/source/texk/web2c/luatexdir/image/writejp2.w18
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/loslibext.c4
4 files changed, 21 insertions, 14 deletions
diff --git a/Build/source/texk/web2c/luatexdir/ChangeLog b/Build/source/texk/web2c/luatexdir/ChangeLog
index dc34e5397d0..7b290e4886f 100644
--- a/Build/source/texk/web2c/luatexdir/ChangeLog
+++ b/Build/source/texk/web2c/luatexdir/ChangeLog
@@ -1,3 +1,8 @@
+2012-07-25 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * image/pdftoepdf.cc (get_file_checksum): Use uint64_t and PRIu64.
+ * image/writejp2.w, lua/loslibext.c: Use uint64_t.
+
2012-07-23 Peter Breitenlohner <peb@mppmu.mpg.de>
* tex/texfileio.w (runpopen): Sync with ../lib/texmfmp.c.
diff --git a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc
index 9bc0b5a7d86..e0fa02927dc 100644
--- a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc
+++ b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.cc
@@ -1,7 +1,7 @@
/* pdftoepdf.cc
Copyright 1996-2006 Han The Thanh <thanh@pdftex.org>
- Copyright 2006-2010 Taco Hoekwater <taco@luatex.org>
+ Copyright 2006-2012 Taco Hoekwater <taco@luatex.org>
This file is part of LuaTeX.
@@ -22,6 +22,8 @@ static const char _svn_version[] =
"$Id: pdftoepdf.cc 4136 2011-04-11 22:06:50Z hhenkel $ "
"$URL: http://foundry.supelec.fr/svn/luatex/tags/beta-0.66.0/source/texk/web2c/luatexdir/image/pdftoepdf.cc $";
+#define __STDC_FORMAT_MACROS /* for PRId64 etc. */
+
// define DEBUG
#include "epdf.h"
@@ -75,8 +77,8 @@ static char *get_file_checksum(char *a, file_error_mode fe)
if (ck == NULL)
pdftex_fail("PDF inclusion: out of memory while processing '%s'",
a);
- snprintf(ck, PDF_CHECKSUM_SIZE, "%llu_%llu", (unsigned long long) size,
- (unsigned long long) mtime);
+ snprintf(ck, PDF_CHECKSUM_SIZE, "%" PRIu64 "_%" PRIu64, (uint64_t) size,
+ (uint64_t) mtime);
} else {
switch (fe) {
case FE_FAIL:
diff --git a/Build/source/texk/web2c/luatexdir/image/writejp2.w b/Build/source/texk/web2c/luatexdir/image/writejp2.w
index 1d27f733c56..6317c36ee3f 100644
--- a/Build/source/texk/web2c/luatexdir/image/writejp2.w
+++ b/Build/source/texk/web2c/luatexdir/image/writejp2.w
@@ -50,13 +50,13 @@ ISO/IEC 15444-1, Second edition, 2004-09-15, file |15444-1annexi.pdf|.
/* 1.4 Box definition */
typedef struct {
- unsigned long long lbox;
+ uint64_t lbox;
unsigned int tbox;
} hdr_struct;
-static unsigned long long read8bytes(FILE * f)
+static uint64_t read8bytes(FILE * f)
{
- unsigned long long l = read4bytes(f);
+ uint64_t l = read4bytes(f);
l = (l << 32) + read4bytes(f);
return l;
}
@@ -110,10 +110,10 @@ static void scan_resc_resd(image_dict * idict)
}
/* 1.5.3.7 Resolution box (superbox) */
-static void scan_res(image_dict * idict, unsigned long long epos_s)
+static void scan_res(image_dict * idict, uint64_t epos_s)
{
hdr_struct hdr;
- unsigned long long spos, epos;
+ uint64_t spos, epos;
epos = xftell(img_file(idict), img_filepath(idict));
while (1) {
spos = epos;
@@ -146,11 +146,11 @@ static void scan_res(image_dict * idict, unsigned long long epos_s)
}
/* 1.5.3 JP2 Header box (superbox) */
-static boolean scan_jp2h(image_dict * idict, unsigned long long epos_s)
+static boolean scan_jp2h(image_dict * idict, uint64_t epos_s)
{
boolean ihdr_found = false;
hdr_struct hdr;
- unsigned long long spos, epos;
+ uint64_t spos, epos;
epos = xftell(img_file(idict), img_filepath(idict));
while (1) {
spos = epos;
@@ -194,7 +194,7 @@ void read_jp2_info(image_dict * idict, img_readtype_e readtype)
{
boolean ihdr_found = false;
hdr_struct hdr;
- unsigned long long spos, epos;
+ uint64_t spos, epos;
assert(img_type(idict) == IMG_TYPE_JP2);
img_totalpages(idict) = 1;
img_pagenum(idict) = 1;
@@ -208,7 +208,7 @@ void read_jp2_info(image_dict * idict, img_readtype_e readtype)
(int) xftell(img_file(idict), img_filepath(idict));
xfseek(img_file(idict), 0, SEEK_SET, img_filepath(idict));
- assert(sizeof(unsigned long long) >= 8);
+ assert(sizeof(uint64_t) >= 8);
spos = epos = 0;
/* 1.5.1 JPEG 2000 Signature box */
diff --git a/Build/source/texk/web2c/luatexdir/lua/loslibext.c b/Build/source/texk/web2c/luatexdir/lua/loslibext.c
index 5bc46fca400..87c290e6a3f 100644
--- a/Build/source/texk/web2c/luatexdir/lua/loslibext.c
+++ b/Build/source/texk/web2c/luatexdir/lua/loslibext.c
@@ -1,6 +1,6 @@
/* loslibext.c
- Copyright 2006-2008 Taco Hoekwater <taco@luatex.org>
+ Copyright 2006-2012 Taco Hoekwater <taco@luatex.org>
This file is part of LuaTeX.
@@ -880,7 +880,7 @@ static int os_gettimeofday(lua_State * L)
v = (double) tv.tv_sec + (double) tv.tv_usec / 1000000.0;
# else
FILETIME ft;
- unsigned __int64 tmpres = 0;
+ uint64_t tmpres = 0;
GetSystemTimeAsFileTime(&ft);