Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5eaeaf9

Browse files
committed
Added casts to forestall warnings with MetroWerks.
1 parent acda339 commit 5eaeaf9

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Modules/zipimport.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -685,15 +685,15 @@ read_directory(char *archive)
685685
"'%.200s'", archive);
686686
return NULL;
687687
}
688-
if (get_long(endof_central_dir) != 0x06054B50) {
688+
if (get_long((unsigned char *)endof_central_dir) != 0x06054B50) {
689689
/* Bad: End of Central Dir signature */
690690
fclose(fp);
691691
PyErr_Format(ZipImportError, "not a Zip file: "
692692
"'%.200s'", archive);
693693
return NULL;
694694
}
695695

696-
header_offset = get_long(endof_central_dir + 16);
696+
header_offset = get_long((unsigned char *)endof_central_dir + 16);
697697

698698
files = PyDict_New();
699699
if (files == NULL)
@@ -911,15 +911,15 @@ unmarshal_code(char *pathname, PyObject *data, time_t mtime)
911911
return NULL;
912912
}
913913

914-
if (get_long(buf) != PyImport_GetMagicNumber()) {
914+
if (get_long((unsigned char *)buf) != PyImport_GetMagicNumber()) {
915915
if (Py_VerboseFlag)
916916
PySys_WriteStderr("# %s has bad magic\n",
917917
pathname);
918918
Py_INCREF(Py_None);
919919
return Py_None; /* signal caller to try alternative */
920920
}
921921

922-
if (mtime != 0 && !eq_mtime(get_long(buf + 4), mtime)) {
922+
if (mtime != 0 && !eq_mtime(get_long((unsigned char *)buf + 4), mtime)) {
923923
if (Py_VerboseFlag)
924924
PySys_WriteStderr("# %s has bad mtime\n",
925925
pathname);

0 commit comments

Comments
 (0)