summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2009-12-18 01:53:06 +0100
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2009-12-18 01:53:06 +0100
commit4baad7bd19349b55ca19e6c903e28bfd3de0d17b (patch)
tree2556a4e362140e4d26a8c0b0da6dca569e92107d
parent4862b34243321055b7f94766b63a0eb726d5cd66 (diff)
Getting rid of 'MIN' completely; this too much a pain.
-rw-r--r--lib/LuaHandle.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/LuaHandle.cc b/lib/LuaHandle.cc
index 72602b3..88dccc5 100644
--- a/lib/LuaHandle.cc
+++ b/lib/LuaHandle.cc
@@ -275,7 +275,7 @@ int sLuaHandle::readfile(lua_State * __L) {
return 1;
}
-#define MAXCHUNKSIZE 65536L
+#define MAXCHUNKSIZE 65536
int sLuaHandle::adler32(lua_State * __L) {
Lua * L = Lua::find(__L);
@@ -298,7 +298,7 @@ int sLuaHandle::adler32(lua_State * __L) {
Uint32 adler = ::adler32(0L, Z_NULL, 0);
while (tg > 0) {
- blk = MIN(MAXCHUNKSIZE, tg);
+ blk = tg > MAXCHUNKSIZE ? MAXCHUNKSIZE : tg
h->read(buf, blk);
tg -= blk;
adler = ::adler32(adler, buf, blk);
@@ -331,7 +331,7 @@ int sLuaHandle::crc32(lua_State * __L) {
Uint32 crc = ::crc32(0L, Z_NULL, 0);
while (tg > 0) {
- blk = MIN(MAXCHUNKSIZE, tg);
+ blk = tg > MAXCHUNKSIZE ? MAXCHUNKSIZE : tg
h->read(buf, blk);
tg -= blk;
crc = ::crc32(crc, buf, blk);