summaryrefslogtreecommitdiff
path: root/emulators/fceu/patches/patch-src_file.c
blob: 19df3dad01cb39b646ba1d3aba97042b87ca37df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
$NetBSD: patch-src_file.c,v 1.1 2017/02/14 21:29:39 joerg Exp $

Newer zlib expects gzgetc argument to be correctly typed.

--- src/file.c.orig	2017-02-09 16:51:34.243801811 +0000
+++ src/file.c
@@ -154,7 +154,7 @@ static MEMWRAP *MakeMemWrap(void *tz, in
  {
   /* Bleck.  The gzip file format has the size of the uncompressed data,
      but I can't get to the info with the zlib interface(?). */
-  for(tmp->size=0; gzgetc(tz) != EOF; tmp->size++);
+  for(tmp->size=0; gzgetc((gzFile)tz) != EOF; tmp->size++);
   gzseek(tz,0,SEEK_SET);
   if(!(tmp->data=(uint8 *)FCEU_malloc(tmp->size)))
   {
@@ -529,7 +529,7 @@ int FCEU_read32le(uint32 *Bufo, FCEUFILE
 int FCEU_fgetc(FCEUFILE *fp)
 {
  if(fp->type==1)
-  return gzgetc(fp->fp); 
+  return gzgetc((gzFile)fp->fp); 
  else if(fp->type>=2)
  {
   MEMWRAP *wz;
@@ -549,7 +549,7 @@ uint64 FCEU_fgetsize(FCEUFILE *fp)
   int x,t;
   t=gztell(fp->fp);
   gzrewind(fp->fp);
-  for(x=0; gzgetc(fp->fp) != EOF; x++);
+  for(x=0; gzgetc((gzFile)fp->fp) != EOF; x++);
   gzseek(fp->fp,t,SEEK_SET);
   return(x);
  }