summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/util-sac.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2017-05-09 11:20:37 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2017-05-09 11:20:37 +0200
commit2498bbe606e7cca22799e33dc29ae5160693b3d8 (patch)
tree2e71bea973ba924760facb782342ed063ab096e2 /tex/context/base/mkiv/util-sac.lua
parent57c3891a6b93b57f91ea77c9bbecffacbcc0da28 (diff)
downloadcontext-2498bbe606e7cca22799e33dc29ae5160693b3d8.tar.gz
2017-05-09 10:20:00
Diffstat (limited to 'tex/context/base/mkiv/util-sac.lua')
-rw-r--r--tex/context/base/mkiv/util-sac.lua30
1 files changed, 15 insertions, 15 deletions
diff --git a/tex/context/base/mkiv/util-sac.lua b/tex/context/base/mkiv/util-sac.lua
index 50bb14d35..b509d9a9b 100644
--- a/tex/context/base/mkiv/util-sac.lua
+++ b/tex/context/base/mkiv/util-sac.lua
@@ -239,9 +239,9 @@ function streams.readfixed4(f)
f[2] = j + 1
local a, b, c, d = byte(f[1],i,j)
if a >= 0x80 then
- return (0x1000000 * a + 0x10000 * b + 0x100 * c + d - 0x100000000)/65536.0
+ return (0x100 * a + b - 0x10000) + (0x100 * c + d)/0x10000
else
- return (0x1000000 * a + 0x10000 * b + 0x100 * c + d)/65536.0
+ return (0x100 * a + b ) + (0x100 * c + d)/0x10000
end
end
@@ -251,9 +251,9 @@ function streams.readfixed2(f)
f[2] = j + 1
local a, b = byte(f[1],i,j)
if a >= 0x80 then
- return (0x100 * a + b - 0x10000)/256.0
+ return (a - 0x100) + b/0x100
else
- return (0x100 * a + b)/256.0
+ return (a ) + b/0x100
end
end
@@ -300,7 +300,7 @@ if sio and sio.readcardinal2 then
local readfixed4 = sio.readfixed4
local read2dot14 = sio.read2dot14
local readbytes = sio.readbytes
- local readbytetable = sio.readbytetable
+ local readbytetable = sio.readbytetable
function streams.readcardinal1(f)
local i = f[2]
@@ -342,16 +342,16 @@ if sio and sio.readcardinal2 then
f[2] = i + 4
return readinteger4(f[1],i)
end
- function streams.readfixed2(f)
- local i = f[2]
- f[2] = i + 2
- return readfixed2(f[1],i)
- end
- function streams.readfixed4(f)
- local i = f[2]
- f[2] = i + 4
- return readfixed4(f[1],i)
- end
+ -- function streams.readfixed2(f) -- needs recent luatex
+ -- local i = f[2]
+ -- f[2] = i + 2
+ -- return readfixed2(f[1],i)
+ -- end
+ -- function streams.readfixed4(f) -- needs recent luatex
+ -- local i = f[2]
+ -- f[2] = i + 4
+ -- return readfixed4(f[1],i)
+ -- end
function streams.read2dot4(f)
local i = f[2]
f[2] = i + 2