summaryrefslogtreecommitdiffstats
path: root/generic/tclZipfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclZipfs.c')
-rw-r--r--generic/tclZipfs.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/generic/tclZipfs.c b/generic/tclZipfs.c
index afd3db5..82e125c 100644
--- a/generic/tclZipfs.c
+++ b/generic/tclZipfs.c
@@ -27,7 +27,6 @@
#define MAP_FILE 0
#endif /* !MAP_FILE */
#define NOBYFOUR
-#define crc32tab crc_table[0]
#ifndef TBLS
#define TBLS 1
#endif
@@ -75,6 +74,8 @@
#include "zutil.h"
#include "crc32.h"
+static const z_crc_t* crc32tab;
+
/*
** We are compiling as part of the core.
** TIP430 style zipfs prefix
@@ -466,7 +467,8 @@ ZipReadInt(
Tcl_Panic("out of bounds read(4): start=%p, end=%p, ptr=%p",
bufferStart, bufferEnd, ptr);
}
- return ptr[0] | (ptr[1] << 8) | (ptr[2] << 16) | (ptr[3] << 24);
+ return ptr[0] | (ptr[1] << 8) | (ptr[2] << 16) |
+ ((unsigned int)ptr[3] << 24);
}
static inline unsigned short
@@ -1864,6 +1866,7 @@ ZipfsSetup(void)
Tcl_MutexUnlock(&ZipFSMutex);
#endif /* TCL_THREADS */
+ crc32tab = get_crc_table();
Tcl_FSRegister(NULL, &zipfsFilesystem);
Tcl_InitHashTable(&ZipFS.fileHash, TCL_STRING_KEYS);
Tcl_InitHashTable(&ZipFS.zipHash, TCL_STRING_KEYS);
@@ -3041,7 +3044,7 @@ ZipFSMkZipOrImg(
}
}
Tcl_IncrRefCount(list);
- if (TclListObjGetElements(interp, list, &lobjc, &lobjv) != TCL_OK) {
+ if (TclListObjGetElementsM(interp, list, &lobjc, &lobjv) != TCL_OK) {
Tcl_DecrRefCount(list);
return TCL_ERROR;
}