Search
lxdream.org :: lxdream/src/util.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/util.c
changeset 674:377d987db8f2
prev586:2a3ba82cf243
next736:a02d1475ccfd
author nkeynes
date Mon May 26 10:42:18 2008 +0000 (14 years ago)
permissions -rw-r--r--
last change Fix save states for x86-64, and ensure compatibility between 32-bit and 64-bit versions
file annotate diff log raw
1.1 --- a/src/util.c Tue Jan 15 20:50:23 2008 +0000
1.2 +++ b/src/util.c Mon May 26 10:42:18 2008 +0000
1.3 @@ -88,7 +88,8 @@
1.4 unsigned char *tmp = g_malloc0( csize );
1.5 int status = compress( tmp, &csize, p, size );
1.6 assert( status == Z_OK );
1.7 - fwrite( &csize, sizeof(csize), 1, f );
1.8 + uint32_t wsize = (uint32_t)csize;
1.9 + fwrite( &wsize, sizeof(wsize), 1, f );
1.10 fwrite( tmp, csize, 1, f );
1.11 g_free(tmp);
1.12 }
1.13 @@ -96,7 +97,7 @@
1.14 int fread_gzip( void *p, size_t sz, size_t count, FILE *f )
1.15 {
1.16 uLongf size = sz*count;
1.17 - uLongf csize;
1.18 + uint32_t csize;
1.19 unsigned char *tmp;
1.20
1.21 fread( &csize, sizeof(csize), 1, f );
.