Browse code

fix GCC warnings.

especially the one about gzFile vs gzFile*, gzopen returns gzFile!

Conflicts:

libclamav/bignum_fast.h
libclamav/iso9660.c
libclamav/matcher.c
libclamav/pdf.c
libclamav/tomsfastmath/misc/fp_ident.c
libclamav/untar.c

Török Edvin authored on 2012/05/30 19:37:32
Showing 8 changed files
... ...
@@ -1316,7 +1316,7 @@ static int buildcld(const char *tmpdir, const char *dbname, const char *newfile,
1316 1316
 	char cwd[512], info[32], buff[513], *pt;
1317 1317
 	struct dirent *dent;
1318 1318
 	int fd, err = 0;
1319
-	gzFile *gzs = NULL;
1319
+	gzFile gzs = NULL;
1320 1320
 
1321 1321
     if(!getcwd(cwd, sizeof(cwd))) {
1322 1322
 	logg("!buildcld: Can't get path of current working directory\n");
... ...
@@ -54,7 +54,7 @@ static int cli_untgz(int fd, const char *destdir)
54 54
 	unsigned int size, pathlen = strlen(destdir) + 100 + 5;
55 55
 	FILE *outfile = NULL;
56 56
 	struct stat foo;
57
-	gzFile *infile;
57
+	gzFile infile;
58 58
 
59 59
 
60 60
     cli_dbgmsg("in cli_untgz()\n");
... ...
@@ -28,7 +28,7 @@
28 28
 #include "sha256.h"
29 29
 
30 30
 struct cli_dbio {
31
-    gzFile *gzs;
31
+    gzFile gzs;
32 32
     FILE *fs;
33 33
     unsigned int size, bread;
34 34
     char *buf, *bufpt, *readpt;
... ...
@@ -479,7 +479,7 @@ static inline void html_tag_contents_append(struct tag_contents *cont, const uns
479 479
             if (mbchar && (c < 0x80 || mbchar >= 0x10000)) {
480 480
                 if (mbchar == 0xE38082 || mbchar == 0xEFBC8E
481 481
                     || mbchar == 0xEFB992 ||
482
-                    mbchar == 0xA1 && (c == 0x43 || c == 0x44 || c == 0x4F)) {
482
+                    (mbchar == 0xA1 && (c == 0x43 || c == 0x44 || c == 0x4F))) {
483 483
                     cont->contents[i++] = '.';
484 484
                     if (mbchar == 0xA1) {
485 485
                         --i;
... ...
@@ -786,7 +786,7 @@ static int cli_html_normalise(int fd, m_area_t *m_area, const char *dirname, tag
786 786
                                 if (*ptr < 0x80 || mbchar >= 0x10000) {
787 787
                                     if (mbchar == 0xE38082 || mbchar == 0xEFBC8E
788 788
                                         || mbchar == 0xEFB992 ||
789
-                                        mbchar == 0xA1 && (*ptr == 0x43 || *ptr == 0x44 || *ptr == 0x4F)) {
789
+                                        (mbchar == 0xA1 && (*ptr == 0x43 || *ptr == 0x44 || *ptr == 0x4F))) {
790 790
                                         /* bb #4097 */
791 791
                                         html_output_c(file_buff_o2, '.');
792 792
                                         html_output_c(file_buff_text, '.');
... ...
@@ -1084,7 +1084,7 @@ static int cli_html_normalise(int fd, m_area_t *m_area, const char *dirname, tag
1084 1084
                                     if (mbchar2 && (*ptr < 0x80 || mbchar2 >= 0x10000)) {
1085 1085
                                         if (mbchar2 == 0xE38082 || mbchar2 == 0xEFBC8E
1086 1086
                                             || mbchar2 == 0xEFB992 ||
1087
-                                            mbchar2 == 0xA1 && (*ptr == 0x43 || *ptr == 0x44 || *ptr == 0x4F)) {
1087
+                                            (mbchar2 == 0xA1 && (*ptr == 0x43 || *ptr == 0x44 || *ptr == 0x4F))) {
1088 1088
                                             html_output_c(file_buff_o2, '.');
1089 1089
                                             if (tag_val_length < HTML_STR_LENGTH)
1090 1090
 						tag_val[tag_val_length++] = '.';
... ...
@@ -757,7 +757,7 @@ int cdiff_apply(int fd, unsigned short mode)
757 757
 {
758 758
 	struct cdiff_ctx ctx;
759 759
 	FILE *fh;
760
-	gzFile *gzh;
760
+	gzFile gzh;
761 761
 	char *line, *lbuf, buff[FILEBUFF], *dsig = NULL;
762 762
 	unsigned int lines = 0, cmds = 0;
763 763
 	unsigned int difflen, diffremain, line_size = CDIFF_LINE_SIZE;
... ...
@@ -47,7 +47,7 @@ struct tar_header {
47 47
 };
48 48
 #define TARBLK 512
49 49
 
50
-int tar_addfile(int fd, gzFile *gzs, const char *file)
50
+int tar_addfile(int fd, gzFile gzs, const char *file)
51 51
 {
52 52
 	int s, bytes;
53 53
 	struct tar_header hdr;
... ...
@@ -23,6 +23,6 @@
23 23
 
24 24
 #include <zlib.h>
25 25
 
26
-int tar_addfile(int fd, gzFile *gzs, const char *file);
26
+int tar_addfile(int fd, gzFile gzs, const char *file);
27 27
 
28 28
 #endif
... ...
@@ -500,7 +500,7 @@ static int script2cdiff(const char *script, const char *builder, const struct op
500 500
 	SHA256_CTX ctx;
501 501
 	struct stat sb;
502 502
 	FILE *scripth, *cdiffh;
503
-	gzFile *gzh;
503
+	gzFile gzh;
504 504
 	unsigned int ver, osize;
505 505
 	int bytes;
506 506
 
... ...
@@ -629,7 +629,7 @@ static int build(const struct optstruct *opts)
629 629
 	const char *newcvd, *localdbdir = NULL;
630 630
         struct cl_engine *engine;
631 631
 	FILE *cvd, *fh;
632
-	gzFile *tar;
632
+	gzFile tar;
633 633
 	time_t timet;
634 634
 	struct tm *brokent;
635 635
 	struct cl_cvd *oldcvd;