compiles

--HG--
branch : HEAD
diff --git a/lib/zip_free_entry.c b/lib/zip_free_entry.c
index f7b4fd4..597b17e 100644
--- a/lib/zip_free_entry.c
+++ b/lib/zip_free_entry.c
@@ -1,3 +1,4 @@
+#include <stdlib.h>
 #include "zip.h"
 
 int
@@ -8,12 +9,12 @@
     free(ze->fn);
     free(ze->fn_old);
     
-    zip_meta_free(ze->meta);
-    zip_meta_free(ze->ch_meta);
+    zip_free_meta(ze->meta);
+    zip_free_meta(ze->ch_meta);
     if (ze->ch_func)
 	ret = ze->ch_func(ze->ch_data, NULL, 0, ZIP_CMD_CLOSE);
     
-    free(ch_data);
+    free(ze->ch_data);
 
     return ret;
 }
diff --git a/lib/zip_free_meta.c b/lib/zip_free_meta.c
index 9eae3e5..07ad428 100644
--- a/lib/zip_free_meta.c
+++ b/lib/zip_free_meta.c
@@ -1,3 +1,4 @@
+#include <stdlib.h>
 #include "zip.h"
 
 void
diff --git a/lib/zip_merge_meta.c b/lib/zip_merge_meta.c
index e78c200..e610641 100644
--- a/lib/zip_merge_meta.c
+++ b/lib/zip_merge_meta.c
@@ -1,57 +1,58 @@
+#include <stdlib.h>
 #include "zip.h"
 #include "zipint.h"
 
 int
-_zip_merge_meta(struct meta *dest, struct meta *src)
+_zip_merge_meta(struct zip_meta *dest, struct zip_meta *src)
 {
-    if (src->version_made != -1)
+    if (src->version_made != (unsigned short)-1)
 	dest->version_made = src->version_made;
-    if (src->version_need != -1)
+    if (src->version_need != (unsigned short)-1)
 	dest->version_need = src->version_need;
-    if (src->bitflags != -1)
+    if (src->bitflags != (unsigned short)-1)
 	dest->bitflags = src->bitflags;
-    if (src->comp_method != -1)
+    if (src->comp_method != (unsigned short)-1)
 	dest->comp_method = src->comp_method;
-    if (src->disknrstart != -1)
+    if (src->disknrstart != (unsigned short)-1)
 	dest->disknrstart = src->disknrstart;
-    if (src->int_attr != -1)
+    if (src->int_attr != (unsigned short)-1)
 	dest->int_attr = src->int_attr;
     
-    if (src->crc != -1)
+    if (src->crc != (unsigned int)-1)
 	dest->crc = src->crc;
-    if (src->uncomp_size != -1)
+    if (src->uncomp_size != (unsigned int)-1)
 	dest->uncomp_size = src->uncomp_size;
-    if (src->comp_size != -1)
+    if (src->comp_size != (unsigned int)-1)
 	dest->comp_size = src->comp_size;
-    if (src->ext_attr != -1)
+    if (src->ext_attr != (unsigned int)-1)
 	dest->ext_attr = src->ext_attr;
-    if (src->local_offset != -1)
+    if (src->local_offset != (unsigned int)-1)
 	dest->local_offset = src->local_offset;
 
     if (src->last_mod != 0)
 	dest->last_mod = src->last_mod;
     
-    if ((src->ef_len != -1) && src->ef) {
+    if ((src->ef_len != (unsigned short)-1) && src->ef) {
 	free(dest->ef);
-	dest->ef = _zip_memdup(dest->ef, src->ef, src->ef_len);
+	dest->ef = _zip_memdup(src->ef, src->ef_len);
 	if (!dest->ef) {
 	    zip_err = ZERR_MEMORY;
 	    return -1;
 	}
     }
 
-    if ((src->lef_len != -1) && src->lef) {
+    if ((src->lef_len != (unsigned short)-1) && src->lef) {
 	free(dest->lef);
-	dest->lef = _zip_memdup(dest->lef, src->lef, src->lef_len);
+	dest->lef = _zip_memdup(src->lef, src->lef_len);
 	if (!dest->lef) {
 	    zip_err = ZERR_MEMORY;
 	    return -1;
 	}
     }
 
-    if ((src->fc_len != -1) && src->fc) {
+    if ((src->fc_len != (unsigned short)-1) && src->fc) {
 	free(dest->fc);
-	dest->fc = _zip_memdup(dest->fc, src->fc, src->fc_len);
+	dest->fc = _zip_memdup(src->fc, src->fc_len);
 	if (!dest->fc) {
 	    zip_err = ZERR_MEMORY;
 	    return -1;
diff --git a/lib/zip_new_entry.c b/lib/zip_new_entry.c
index 3061af7..61821d1 100644
--- a/lib/zip_new_entry.c
+++ b/lib/zip_new_entry.c
@@ -1,3 +1,4 @@
+#include <stdlib.h>
 #include "zip.h"
 
 struct zip_entry *
@@ -27,9 +28,9 @@
 	return NULL;
 
     ze->fn = ze->fn_old = NULL;
-    ze->state = Z_UNCHANGED;
+    ze->state = ZIP_ST_UNCHANGED;
 
-    ze->zip_read_func = NULL;
+    ze->ch_func = NULL;
     ze->ch_data = NULL;
     ze->ch_comp = -1;
     ze->ch_meta = NULL;
diff --git a/lib/zip_new_meta.c b/lib/zip_new_meta.c
index 5bb08fa..c5b8838 100644
--- a/lib/zip_new_meta.c
+++ b/lib/zip_new_meta.c
@@ -1,3 +1,4 @@
+#include <stdlib.h>
 #include "zip.h"
 
 struct zip_meta *
diff --git a/lib/zip_rename.c b/lib/zip_rename.c
index f094003..5b63ecd 100644
--- a/lib/zip_rename.c
+++ b/lib/zip_rename.c
@@ -7,12 +7,12 @@
 zip_rename(struct zip *zf, int idx, char *name)
 {
     if (idx >= zf->nentry || idx < 0) {
-	zip_err = ZIP_NOENT;
+	zip_err = ZERR_NOENT;
 	return -1;
     }
 
-    if (zf->entry[idx].state == Z_UNCHANGED) 
-	zf->entry[idx].state = Z_RENAMED;
+    if (zf->entry[idx].state == ZIP_ST_UNCHANGED) 
+	zf->entry[idx].state = ZIP_ST_RENAMED;
     
     zf->changes = 1;
 
diff --git a/lib/zip_unchange_data.c b/lib/zip_unchange_data.c
index 8e6247c..98d0841 100644
--- a/lib/zip_unchange_data.c
+++ b/lib/zip_unchange_data.c
@@ -1,3 +1,4 @@
+#include <stdlib.h>
 #include "zip.h"
 #include "zipint.h"