-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

this patch removes some warning using casts or converting const stuff to non 
const,
please review

not resolved warnings:
libclamav\ole2_extract.c(169) : warning C4333: '>>' : right shift by too large 
amount, data loss
libclamav\ole2_extract.c(170) : warning C4333: '>>' : right shift by too large 
amount, data loss
libclamav\vba_extract.c(132) : warning C4333: '>>' : right shift by too large 
amount, data loss
libclamav\vba_extract.c(133) : warning C4333: '>>' : right shift by too large 
amount, data loss

newname[j++] = 'a'+((x>>16)&0xF);
newname[j++] = 'a'+((x>>24)&0xF);

newname is a char

and
j:\microsoft visual studio\local\include\zlib.h(198) : note C6311:
j:\devel\clamav\native-clamav\clamav-devel\libclamav\nsis\nsis_zlib.h(196) : 
see previous definition of 'Z_ASCII'
j:\microsoft visual studio\local\include\bzlib.h(125) : note C6311:
j:\devel\clamav\native-clamav\clamav-devel\libclamav\nsis\nsis_bzlib.h(77) : 
see previous definition of 'BZ_API'

ifndef is not enough because on my env zlib.h and bzlib.h are picked after

Regards
- --
Gianluigi Tiesi <[EMAIL PROTECTED]>
EDP Project Leader
Netfarm S.r.l. - http://www.netfarm.it/
Free Software: http://oss.netfarm.it/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGUlVu3UE5cRfnO04RAkwlAJ9YaTRsjiGSb/0Wyixb4mpF2l5WJgCeMMZn
mQeh5RjtfLxiH3l002NRPok=
=kziq
-----END PGP SIGNATURE-----
Index: libclamav/hashtab.c
===================================================================
--- libclamav/hashtab.c (revision 1284)
+++ libclamav/hashtab.c (working copy)
@@ -345,7 +345,7 @@
        struct element* e = hashtab_find(s,key,len);
        if(e && e->key) {       
                PROFILE_HASH_DELETE(s);
-               free(e->key);/*FIXME: any way to shut up warnings here? if I 
make key char*, I get tons of warnings in entitylist.h */
+               free((void *)e->key);
                e->key = DELETED_KEY;
                s->used--;
        }
@@ -357,7 +357,7 @@
        PROFILE_HASH_CLEAR(s);
        for(i=0;i < s->capacity;i++) {
                if(s->htable[i].key && s->htable[i].key != DELETED_KEY)
-                       free(s->htable[i].key);/*FIXME: shut up warnings */
+                       free((void *)s->htable[i].key);
        }
        memset(s->htable, 0, s->capacity);
        s->used = 0;
Index: libclamav/hashtab.h
===================================================================
--- libclamav/hashtab.h (revision 1240)
+++ libclamav/hashtab.h (working copy)
@@ -78,7 +78,7 @@
 int hashtab_generate_c(const struct hashtable *s,const char* name);
 struct element* hashtab_find(const struct hashtable *s,const unsigned char* 
key,const size_t len);
 int hashtab_init(struct hashtable *s,size_t capacity);
-int hashtab_insert(struct hashtable *s,const unsigned char* key,size_t 
len,element_data data);
+int hashtab_insert(struct hashtable *s,const unsigned char* key,const size_t 
len,const element_data data);
 void hashtab_delete(struct hashtable *s,const unsigned char* key,const size_t 
len);
 void hashtab_clear(struct hashtable *s);
 
Index: libclamav/others.c
===================================================================
--- libclamav/others.c  (revision 1288)
+++ libclamav/others.c  (working copy)
@@ -303,7 +303,7 @@
 
 
     cli_md5_init(&ctx);
-    cli_md5_update(&ctx, buffer, len);
+    cli_md5_update(&ctx, (void *)buffer, len);
     cli_md5_final(digest, &ctx);
 
     if(dig)
Index: libclamav/regex_list.c
===================================================================
--- libclamav/regex_list.c      (revision 1284)
+++ libclamav/regex_list.c      (working copy)
@@ -821,9 +821,9 @@
        /*TODO: find where the regex part begins, for ex:
         * abcd+, regex begins at 'd'
         * */
-       const unsigned char* last=NULL;
-       const unsigned char* tmp=NULL;
-       const unsigned char** altpositions = 
cli_malloc(INITIAL_ALT_STACK*sizeof(*altpositions));
+       unsigned char* last=NULL;
+       unsigned char* tmp=NULL;
+       unsigned char** altpositions = 
cli_malloc(INITIAL_ALT_STACK*sizeof(*altpositions));
        size_t altpositions_capacity = INITIAL_ALT_STACK;
        size_t altpositions_cnt = 0;
        char lasttype = -1;
@@ -839,7 +839,7 @@
         * TODO: what about open parantheses? maybe once we found a special 
char, we have top back out before the first (?
         * */
        do {    
-               tmp = pat;
+               tmp = (unsigned char *)pat;
                pat = getNextToken(pat,&token);
                if(token.type!=TOKEN_REGEX) {
                        last = tmp;
Index: libclamav/unrar/unrar.h
===================================================================
--- libclamav/unrar/unrar.h     (revision 1240)
+++ libclamav/unrar/unrar.h     (working copy)
@@ -313,7 +313,7 @@
        rar_metadata_t *metadata_tail;
        unpack_data_t *unpack_data;
        main_header_t *main_hdr;
-       const char* comment_dir;
+       char* comment_dir;
        unsigned long file_count;
        off_t offset;
        int fd;
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net

Reply via email to