- more casts of void pointers
- fseeko replacement
- bump version to 0.6.1b
--HG--
branch : HEAD
diff --git a/configure.ac b/configure.ac
index 5eb6bbd..45e287f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
AC_PREREQ(2.57)
-AC_INIT([libzip],[0.6.1a],[nih@giga.or.at])
+AC_INIT([libzip],[0.6.1b],[nih@giga.or.at])
AC_CONFIG_SRCDIR([lib/zip_add.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE
@@ -43,6 +43,7 @@
AM_PROG_LIBTOOL
+AC_CHECK_FUNCS([fseeko])
AC_CHECK_FUNCS([mkstemp], [], [AC_LIBOBJ(mkstemp)])
case $host_os
diff --git a/lib/mkstemp.c b/lib/mkstemp.c
index c926a99..a875712 100644
--- a/lib/mkstemp.c
+++ b/lib/mkstemp.c
@@ -1,4 +1,4 @@
-/* $NiH$ */
+/* $NiH: mkstemp.c,v 1.1 2006/02/21 10:56:44 dillo Exp $ */
/* Adapted from NetBSB libc by Dieter Baron */
@@ -51,7 +51,7 @@
int fd;
char *start, *trv;
struct stat sbuf;
- u_int pid;
+ pid_t pid;
/* To guarantee multiple calls generate unique names even if
the file is not created. 676 different possibilities with 7
diff --git a/lib/zip_fread.c b/lib/zip_fread.c
index 0df56ca..181a020 100644
--- a/lib/zip_fread.c
+++ b/lib/zip_fread.c
@@ -1,5 +1,5 @@
/*
- $NiH: zip_fread.c,v 1.18 2005/07/14 16:20:56 wiz Exp $
+ $NiH: zip_fread.c,v 1.19 2006/02/21 09:41:00 dillo Exp $
zip_fread.c -- read from file
Copyright (C) 1999, 2004, 2005 Dieter Baron and Thomas Klausner
@@ -70,13 +70,13 @@
ret = _zip_file_fillbuf(outbuf, toread, zf);
if (ret > 0) {
if (zf->flags & ZIP_ZF_CRC)
- zf->crc = crc32(zf->crc, outbuf, ret);
+ zf->crc = crc32(zf->crc, (Bytef *)outbuf, ret);
zf->bytes_left -= ret;
}
return ret;
}
- zf->zstr->next_out = outbuf;
+ zf->zstr->next_out = (Bytef *)outbuf;
zf->zstr->avail_out = toread;
out_before = zf->zstr->total_out;
@@ -93,7 +93,7 @@
len = zf->zstr->total_out - out_before;
if (len >= zf->bytes_left || len >= toread) {
if (zf->flags & ZIP_ZF_CRC)
- zf->crc = crc32(zf->crc, outbuf, len);
+ zf->crc = crc32(zf->crc, (Bytef *)outbuf, len);
zf->bytes_left -= len;
return len;
}
diff --git a/lib/zip_open.c b/lib/zip_open.c
index 701133b..aa794c0 100644
--- a/lib/zip_open.c
+++ b/lib/zip_open.c
@@ -1,5 +1,5 @@
/*
- $NiH: zip_open.c,v 1.31 2006/02/21 09:41:00 dillo Exp $
+ $NiH: zip_open.c,v 1.32 2006/02/21 10:55:16 dillo Exp $
zip_open.c -- open zip archive
Copyright (C) 1999, 2003, 2004, 2005 Dieter Baron and Thomas Klausner
@@ -139,7 +139,7 @@
cdir = NULL;
match = buf;
while ((match=_zip_memmem(match, buflen-(match-buf)-18,
- EOCD_MAGIC, 4))!=NULL) {
+ (const unsigned char *)EOCD_MAGIC, 4))!=NULL) {
/* found match -- check, if good */
/* to avoid finding the same match all over again */
match++;
@@ -283,7 +283,8 @@
}
if (cd->comment_len)
- if ((cd->comment=_zip_memdup(eocd+EOCDLEN, cd->comment_len, error))
+ if ((cd->comment=(char *)_zip_memdup(eocd+EOCDLEN,
+ cd->comment_len, error))
== NULL) {
free(cd);
return NULL;
diff --git a/lib/zip_source_buffer.c b/lib/zip_source_buffer.c
index fd3bfe1..a038459 100644
--- a/lib/zip_source_buffer.c
+++ b/lib/zip_source_buffer.c
@@ -1,5 +1,5 @@
/*
- $NiH: zip_source_buffer.c,v 1.5 2005/06/09 19:57:10 dillo Exp $
+ $NiH: zip_source_buffer.c,v 1.6 2006/02/21 09:41:00 dillo Exp $
zip_source_buffer.c -- create zip data source from buffer
Copyright (C) 1999, 2003, 2004, 2005 Dieter Baron and Thomas Klausner
@@ -71,7 +71,7 @@
return NULL;
}
- f->data = data;
+ f->data = (const char *)data;
f->end = ((const char *)data)+len;
f->freep = freep;
f->mtime = time(NULL);
diff --git a/lib/zipint.h b/lib/zipint.h
index e6658fd..f96c0fd 100644
--- a/lib/zipint.h
+++ b/lib/zipint.h
@@ -2,7 +2,7 @@
#define _HAD_ZIPINT_H
/*
- $NiH: zipint.h,v 1.43 2006/02/21 09:41:00 dillo Exp $
+ $NiH: zipint.h,v 1.44 2006/02/21 10:56:44 dillo Exp $
zipint.h -- internal declarations.
Copyright (C) 1999, 2003, 2004, 2005, 2006 Dieter Baron and Thomas Klausner
@@ -46,6 +46,10 @@
#define mkstemp _zip_mkstemp
#endif
+#ifndef HAVE_FSEEKO
+#define fseeko(s, o, w) (fseek((s), (long int)(o), (w)))
+#endif
+
#define CENTRAL_MAGIC "PK\1\2"