mirror of
https://github.com/notwa/mm
synced 2025-02-05 05:23:22 -08:00
use proper fixed width types
fixes checksumming when compiling for 64-bit
This commit is contained in:
parent
3f318bd0db
commit
f5de4b56dc
2 changed files with 6 additions and 7 deletions
|
@ -1,7 +1,8 @@
|
||||||
# decoder ripped from: http://www.amnoid.de/gc/yaz0.txt
|
# decoder ripped from: http://www.amnoid.de/gc/yaz0.txt
|
||||||
|
|
||||||
ctypedef unsigned long ulong
|
from libc.stdint cimport uint32_t, uint8_t
|
||||||
ctypedef unsigned char uchar
|
ctypedef uint32_t ulong
|
||||||
|
ctypedef uint8_t uchar
|
||||||
|
|
||||||
cdef ulong get_size(uchar *comp):
|
cdef ulong get_size(uchar *comp):
|
||||||
return comp[4]*0x1000000 + comp[5]*0x10000 + comp[6]*0x100 + comp[7]
|
return comp[4]*0x1000000 + comp[5]*0x10000 + comp[6]*0x100 + comp[7]
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
# Based on uCON64's N64 checksum algorithm by Andreas Sterbenz
|
# Based on uCON64's N64 checksum algorithm by Andreas Sterbenz
|
||||||
|
|
||||||
ctypedef unsigned long ulong
|
from libc.stdint cimport uint32_t, uint8_t
|
||||||
ctypedef unsigned char uchar
|
|
||||||
|
|
||||||
# ulong must be 32 bits since we expect them to overflow as such
|
# ulong must be 32 bits since we expect them to overflow as such
|
||||||
# TODO: test on different machines
|
ctypedef uint32_t ulong
|
||||||
assert(sizeof(ulong) == 4)
|
ctypedef uint8_t uchar
|
||||||
|
|
||||||
from zlib import crc32
|
from zlib import crc32
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue