summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristos Zoulas <christos@zoulas.com>2009-02-04 18:24:32 +0000
committerChristos Zoulas <christos@zoulas.com>2009-02-04 18:24:32 +0000
commit4ffd72806affd6b1aa36a75d7552196b6308d1aa (patch)
treece4f950f1775e17a3045e15681699b835a4723e2
parent2c287e38eacd6aec7b800db40373396bb5eb00f4 (diff)
downloadfile-git-4ffd72806affd6b1aa36a75d7552196b6308d1aa.tar.gz
fix warnings on OS/2
-rw-r--r--src/apprentice.c10
-rw-r--r--src/apptype.c4
-rw-r--r--src/file.h10
-rw-r--r--src/magic.c8
4 files changed, 18 insertions, 14 deletions
diff --git a/src/apprentice.c b/src/apprentice.c
index d78cb84c..32edfac6 100644
--- a/src/apprentice.c
+++ b/src/apprentice.c
@@ -32,7 +32,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: apprentice.c,v 1.146 2008/11/07 18:57:08 christos Exp $")
+FILE_RCSID("@(#)$File: apprentice.c,v 1.147 2009/02/03 20:27:51 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -324,11 +324,15 @@ file_delmagic(struct magic *p, int type, size_t entries)
if (p == NULL)
return;
switch (type) {
-#ifdef QUICK
case 2:
+#ifdef QUICK
p--;
(void)munmap((void *)p, sizeof(*p) * (entries + 1));
break;
+#else
+ (void)&entries;
+ abort();
+ /*NOTREACHED*/
#endif
case 1:
p--;
@@ -2084,7 +2088,7 @@ apprentice_map(struct magic_set *ms, struct magic **magicp, uint32_t *nmagicp,
file_oomem(ms, (size_t)st.st_size);
goto error1;
}
- if (read(fd, mm, (size_t)st.st_size) != (size_t)st.st_size) {
+ if (read(fd, mm, (size_t)st.st_size) != (ssize_t)st.st_size) {
file_badread(ms);
goto error1;
}
diff --git a/src/apptype.c b/src/apptype.c
index e02f730d..84c0133b 100644
--- a/src/apptype.c
+++ b/src/apptype.c
@@ -27,7 +27,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: apptype.c,v 1.9 2008/11/04 16:38:28 christos Exp $")
+FILE_RCSID("@(#)$File: apptype.c,v 1.10 2009/02/03 20:27:51 christos Exp $")
#endif /* lint */
#include <stdlib.h>
@@ -76,7 +76,7 @@ file_os2_apptype(struct magic_set *ms, const char *fn, const void *buf,
}
(void)fclose(fp);
}
- rc = DosQueryAppType(path, &type);
+ rc = DosQueryAppType((unsigned char *)path, &type);
if (fn == NULL) {
unlink(path);
diff --git a/src/file.h b/src/file.h
index c2bc47ed..4a5a18ff 100644
--- a/src/file.h
+++ b/src/file.h
@@ -27,7 +27,7 @@
*/
/*
* file.h - definitions for file(1) program
- * @(#)$File: file.h,v 1.117 2008/11/22 17:01:28 chl Exp $
+ * @(#)$File: file.h,v 1.118 2009/02/03 20:27:51 christos Exp $
*/
#ifndef __file_h__
@@ -387,7 +387,13 @@ protected size_t file_mbswidth(const char *);
protected const char *file_getbuffer(struct magic_set *);
protected ssize_t sread(int, void *, size_t, int);
protected int file_check_mem(struct magic_set *, unsigned int);
-protected int file_looks_utf8(const unsigned char *, size_t, unichar *, size_t *);
+protected int file_looks_utf8(const unsigned char *, size_t, unichar *,
+ size_t *);
+#ifdef __EMX__
+protected int file_os2_apptype(struct magic_set *, const char *, const void *,
+ size_t);
+#endif /* __EMX__ */
+
#ifndef COMPILE_ONLY
extern const char *file_names[];
diff --git a/src/magic.c b/src/magic.c
index c2a2daf5..9f7c217a 100644
--- a/src/magic.c
+++ b/src/magic.c
@@ -28,7 +28,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: magic.c,v 1.58 2009/01/12 20:15:11 christos Exp $")
+FILE_RCSID("@(#)$File: magic.c,v 1.59 2009/02/03 20:27:51 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -74,12 +74,6 @@ FILE_RCSID("@(#)$File: magic.c,v 1.58 2009/01/12 20:15:11 christos Exp $")
#endif
#endif
-#ifdef __EMX__
-private char *apptypeName = NULL;
-protected int file_os2_apptype(struct magic_set *ms, const char *fn,
- const void *buf, size_t nb);
-#endif /* __EMX__ */
-
private void free_mlist(struct mlist *);
private void close_and_restore(const struct magic_set *, const char *, int,
const struct stat *);