Browse code

fix compiler warnings

git-svn: trunk@1847

Tomasz Kojm authored on 2006/03/07 19:06:31
Showing 3 changed files
... ...
@@ -1,3 +1,7 @@
1
+Tue Mar  7 11:04:37 CET 2006 (tk)
2
+---------------------------------
3
+  * libclamav/zziplib: fix compiler warnings (patch by Stephen Gran)
4
+
1 5
 Wed Feb 15 01:39:12 CET 2006 (tk)
2 6
 ---------------------------------
3 7
   * libclamav: simplify internal function declarations by passing a context
... ...
@@ -61,11 +61,9 @@ static const struct zzip_plugin_io default_io =
61 61
 {
62 62
     &open,
63 63
     &close,
64
-    /* (int (*)(int, void*, unsigned)) */
65
-    &zzip_wrap_read,
66
-    /* (zzip_off_t (*)(int, zzip_off_t, int)) */
67
-    &zzip_wrap_lseek,
68
-    &zzip_filesize,
64
+    (int (*)(int, void*, unsigned)) &zzip_wrap_read,
65
+    (zzip_off_t (*)(int, zzip_off_t, int)) &zzip_wrap_lseek,
66
+    (zzip_off_t (*)(int)) &zzip_filesize,
69 67
     1
70 68
 };
71 69
 
... ...
@@ -28,14 +28,14 @@
28 28
 
29 29
 struct zzip_version 
30 30
 { 
31
-    char   version[1]; 
32
-    char   ostype[1]; 
31
+    unsigned char   version[1]; 
32
+    unsigned char   ostype[1]; 
33 33
 } __attribute__((packed));
34 34
 
35 35
 struct zzip_dostime 
36 36
 { 
37
-    char   time[2]; 
38
-    char   date[2]; 
37
+    unsigned char   time[2]; 
38
+    unsigned char   date[2]; 
39 39
 } __attribute__((packed)); 
40 40
 
41 41
 #define ZZIP_CHECKMAGIC(__p,__A,__B,__C,__D) \
... ...
@@ -49,16 +49,16 @@ struct zzip_file_header
49 49
 {
50 50
 #   define ZZIP_FILE_HEADER_MAGIC 0x04034b50
51 51
 #   define ZZIP_FILE_HEADER_CHECKMAGIC(__p) ZZIP_CHECKMAGIC(__p,'P','K','\3','\4')
52
-    char   z_magic[4]; /* local file header signature (0x04034b50) */
52
+    unsigned char   z_magic[4]; /* local file header signature (0x04034b50) */
53 53
     struct zzip_version z_extract; /* version needed to extract */
54
-    char   z_flags[2]; /* general purpose bit flag */
55
-    char   z_compr[2]; /* compression method */
54
+    unsigned char   z_flags[2]; /* general purpose bit flag */
55
+    unsigned char   z_compr[2]; /* compression method */
56 56
     struct zzip_dostime z_dostime; /* last mod file time (dos format) */
57
-    char   z_crc32[4]; /* crc-32 */
58
-    char   z_csize[4]; /* compressed size */
59
-    char   z_usize[4]; /* uncompressed size */
60
-    char   z_namlen[2]; /* filename length (null if stdin) */
61
-    char   z_extras[2]; /* extra field length */
57
+    unsigned char   z_crc32[4]; /* crc-32 */
58
+    unsigned char   z_csize[4]; /* compressed size */
59
+    unsigned char   z_usize[4]; /* uncompressed size */
60
+    unsigned char   z_namlen[2]; /* filename length (null if stdin) */
61
+    unsigned char   z_extras[2]; /* extra field length */
62 62
     /* followed by filename (of variable size) */
63 63
     /* followed by extra field (of variable size) */
64 64
 } __attribute__((packed));
... ...
@@ -90,22 +90,22 @@ struct zzip_root_dirent
90 90
 {
91 91
 #   define ZZIP_ROOT_DIRENT_MAGIC 0x02014b50
92 92
 #   define ZZIP_ROOT_DIRENT_CHECKMAGIC(__p) ZZIP_CHECKMAGIC(__p,'P','K','\1','\2')
93
-    char  z_magic[4];  /* central file header signature (0x02014b50) */
93
+    unsigned char  z_magic[4];  /* central file header signature (0x02014b50) */
94 94
     struct zzip_version z_encoder;  /* version made by */
95 95
     struct zzip_version z_extract;  /* version need to extract */
96
-    char  z_flags[2];  /* general purpose bit flag */
97
-    char  z_compr[2];  /* compression method */
96
+    unsigned char  z_flags[2];  /* general purpose bit flag */
97
+    unsigned char  z_compr[2];  /* compression method */
98 98
     struct zzip_dostime z_dostime;  /* last mod file time&date (dos format) */
99
-    char  z_crc32[4];  /* crc-32 */
100
-    char  z_csize[4];  /* compressed size */
101
-    char  z_usize[4];  /* uncompressed size */
102
-    char  z_namlen[2]; /* filename length (null if stdin) */
103
-    char  z_extras[2];  /* extra field length */
104
-    char  z_comment[2]; /* file comment length */
105
-    char  z_diskstart[2]; /* disk number of start (if spanning zip over multiple disks) */
106
-    char  z_filetype[2];  /* internal file attributes, bit0 = ascii */
107
-    char  z_filemode[4];  /* extrnal file attributes, eg. msdos attrib byte */
108
-    char  z_off[4];    /* relative offset of local file header, seekval if singledisk */
99
+    unsigned char  z_crc32[4];  /* crc-32 */
100
+    unsigned char  z_csize[4];  /* compressed size */
101
+    unsigned char  z_usize[4];  /* uncompressed size */
102
+    unsigned char  z_namlen[2]; /* filename length (null if stdin) */
103
+    unsigned char  z_extras[2];  /* extra field length */
104
+    unsigned char  z_comment[2]; /* file comment length */
105
+    unsigned char  z_diskstart[2]; /* disk number of start (if spanning zip over multiple disks) */
106
+    unsigned char  z_filetype[2];  /* internal file attributes, bit0 = ascii */
107
+    unsigned char  z_filemode[4];  /* extrnal file attributes, eg. msdos attrib byte */
108
+    unsigned char  z_off[4];    /* relative offset of local file header, seekval if singledisk */
109 109
     /* followed by filename (of variable size) */
110 110
     /* followed by extra field (of variable size) */
111 111
     /* followed by file comment (of variable size) */
... ...
@@ -116,15 +116,15 @@ struct zzip_disk_trailer
116 116
 {
117 117
 #   define ZZIP_DISK_TRAILER_MAGIC 0x06054b50
118 118
 #   define ZZIP_DISK_TRAILER_CHECKMAGIC(__p) ZZIP_CHECKMAGIC(__p,'P','K','\5','\6')
119
-    char  z_magic[4]; /* end of central dir signature (0x06054b50) */
120
-    char  z_disk[2];  /* number of this disk */
121
-    char  z_finaldisk[2]; /* number of the disk with the start of the central dir */
122
-    char  z_entries[2]; /* total number of entries in the central dir on this disk */
123
-    char  z_finalentries[2]; /* total number of entries in the central dir */
124
-    char  z_rootsize[4]; /* size of the central directory */
125
-    char  z_rootseek[4]; /* offset of start of central directory with respect to *
119
+    unsigned char  z_magic[4]; /* end of central dir signature (0x06054b50) */
120
+    unsigned char  z_disk[2];  /* number of this disk */
121
+    unsigned char  z_finaldisk[2]; /* number of the disk with the start of the central dir */
122
+    unsigned char  z_entries[2]; /* total number of entries in the central dir on this disk */
123
+    unsigned char  z_finalentries[2]; /* total number of entries in the central dir */
124
+    unsigned char  z_rootsize[4]; /* size of the central directory */
125
+    unsigned char  z_rootseek[4]; /* offset of start of central directory with respect to *
126 126
                           * the starting disk number */
127
-    char  z_comment[2];  /* zipfile comment length */
127
+    unsigned char  z_comment[2];  /* zipfile comment length */
128 128
     /* followed by zipfile comment (of variable size) */
129 129
 } __attribute__((packed));
130 130