1
0
Fork 0
mirror of https://github.com/notwa/mm synced 2024-04-26 05:13:23 -07:00

use proper fixed width types

fixes checksumming when compiling for 64-bit
This commit is contained in:
Connor Olding 2016-11-27 22:15:06 -08:00
parent 3f318bd0db
commit f5de4b56dc
2 changed files with 6 additions and 7 deletions

View File

@ -1,7 +1,8 @@
# decoder ripped from: http://www.amnoid.de/gc/yaz0.txt
ctypedef unsigned long ulong
ctypedef unsigned char uchar
from libc.stdint cimport uint32_t, uint8_t
ctypedef uint32_t ulong
ctypedef uint8_t uchar
cdef ulong get_size(uchar *comp):
return comp[4]*0x1000000 + comp[5]*0x10000 + comp[6]*0x100 + comp[7]

View File

@ -1,11 +1,9 @@
# Based on uCON64's N64 checksum algorithm by Andreas Sterbenz
ctypedef unsigned long ulong
ctypedef unsigned char uchar
from libc.stdint cimport uint32_t, uint8_t
# ulong must be 32 bits since we expect them to overflow as such
# TODO: test on different machines
assert(sizeof(ulong) == 4)
ctypedef uint32_t ulong
ctypedef uint8_t uchar
from zlib import crc32