Hi, attached patch fixes some compiler warning, by: - making functions static, which aren't used outside their declaring file - including the corresponding header file in the implementing .c-file, so protoypes for exported function are found - adds prototypes for exported functions to to the header files - used function(void) syntax instead of function(), as the first one is the correct c syntax.
Regards, Stefan
? log ? log-orig ? patches Index: clamd/others.c =================================================================== RCS file: /cvsroot/clamav/clamav-devel/clamd/others.c,v retrieving revision 1.29 diff -u -r1.29 others.c --- clamd/others.c 30 Oct 2005 20:24:39 -0000 1.29 +++ clamd/others.c 9 Dec 2005 01:16:23 -0000 @@ -68,6 +68,7 @@ #include "memory.h" #include "cfgparser.h" #include "session.h" +#include "others.h" #define ENV_FILE "CLAM_VIRUSEVENT_FILENAME" #define ENV_VIRUS "CLAM_VIRUSEVENT_VIRUSNAME" Index: clamd/scanner.c =================================================================== RCS file: /cvsroot/clamav/clamav-devel/clamd/scanner.c,v retrieving revision 1.52 diff -u -r1.52 scanner.c --- clamd/scanner.c 20 Aug 2005 23:09:11 -0000 1.52 +++ clamd/scanner.c 9 Dec 2005 01:16:23 -0000 @@ -68,7 +68,7 @@ # endif #endif -int checksymlink(const char *path) +static int checksymlink(const char *path) { struct stat statbuf; Index: clamd/thrmgr.c =================================================================== RCS file: /cvsroot/clamav/clamav-devel/clamd/thrmgr.c,v retrieving revision 1.10 diff -u -r1.10 thrmgr.c --- clamd/thrmgr.c 25 Jun 2005 11:15:05 -0000 1.10 +++ clamd/thrmgr.c 9 Dec 2005 01:16:23 -0000 @@ -29,7 +29,7 @@ #define FALSE (0) #define TRUE (1) -work_queue_t *work_queue_new() +static work_queue_t *work_queue_new(void) { work_queue_t *work_q; @@ -40,7 +40,7 @@ return work_q; } -void work_queue_add(work_queue_t *work_q, void *data) +static void work_queue_add(work_queue_t *work_q, void *data) { work_item_t *work_item; @@ -63,7 +63,7 @@ return; } -void *work_queue_pop(work_queue_t *work_q) +static void *work_queue_pop(work_queue_t *work_q) { work_item_t *work_item; void *data; Index: clamdscan/client.c =================================================================== RCS file: /cvsroot/clamav/clamav-devel/clamdscan/client.c,v retrieving revision 1.28 diff -u -r1.28 client.c --- clamdscan/client.c 22 Jun 2005 15:54:27 -0000 1.28 +++ clamdscan/client.c 9 Dec 2005 01:16:23 -0000 @@ -59,7 +59,7 @@ void move_infected(const char *filename, const struct optstruct *opt); int notremoved = 0, notmoved = 0; -int dsresult(int sockd, const struct optstruct *opt) +static int dsresult(int sockd, const struct optstruct *opt) { int infected = 0, waserror = 0; char buff[4096], *pt; @@ -109,7 +109,7 @@ return infected ? infected : (waserror ? -1 : 0); } -int dsfile(int sockd, const char *filename, const struct optstruct *opt) +static int dsfile(int sockd, const char *filename, const struct optstruct *opt) { int ret; char *scancmd; @@ -137,7 +137,7 @@ #if defined(ENABLE_FD_PASSING) && defined(HAVE_SENDMSG) && (defined(HAVE_ACCRIGHTS_IN_MSGHDR) || defined(HAVE_CONTROL_IN_MSGHDR)) && !defined(C_CYGWIN) /* Submitted by Richard Lyons <frob-clamav*webcentral.com.au> */ -int dsfd(int sockfd, int fd, const struct optstruct *opt) +static int dsfd(int sockfd, int fd, const struct optstruct *opt) { struct iovec iov[1]; struct msghdr msg; @@ -177,13 +177,13 @@ return dsresult(sockfd, opt); } #else -int dsfd(int sockfd, int fd, const struct optstruct *opt) +static int dsfd(int sockfd, int fd, const struct optstruct *opt) { return -1; } #endif -int dsstream(int sockd, const struct optstruct *opt) +static int dsstream(int sockd, const struct optstruct *opt) { int wsockd, loopw = 60, bread, port, infected = 0; struct sockaddr_in server; @@ -275,7 +275,7 @@ return infected; } -char *abpath(const char *filename) +static char *abpath(const char *filename) { struct stat foo; char *fullpath, cwd[200]; @@ -300,7 +300,7 @@ return fullpath; } -int dconnect(const struct optstruct *opt) +static int dconnect(const struct optstruct *opt) { struct sockaddr_un server; struct sockaddr_in server2; Index: freshclam/dns.c =================================================================== RCS file: /cvsroot/clamav/clamav-devel/freshclam/dns.c,v retrieving revision 1.6 diff -u -r1.6 dns.c --- freshclam/dns.c 7 Jun 2005 01:40:08 -0000 1.6 +++ freshclam/dns.c 9 Dec 2005 01:16:23 -0000 @@ -33,6 +33,7 @@ #include "memory.h" #include "output.h" +#include "dns.h" #ifndef PACKETSZ #define PACKETSZ 512 Index: freshclam/manager.c =================================================================== RCS file: /cvsroot/clamav/clamav-devel/freshclam/manager.c,v retrieving revision 1.65 diff -u -r1.65 manager.c --- freshclam/manager.c 21 Nov 2005 22:14:42 -0000 1.65 +++ freshclam/manager.c 9 Dec 2005 01:16:23 -0000 @@ -588,7 +588,7 @@ return -2; } -int Rfc2822DateTime(char *buf, time_t mtime) +static int Rfc2822DateTime(char *buf, time_t mtime) { struct tm *time; Index: libclamav/cvd.c =================================================================== RCS file: /cvsroot/clamav/clamav-devel/libclamav/cvd.c,v retrieving revision 1.25 diff -u -r1.25 cvd.c --- libclamav/cvd.c 13 Nov 2005 16:48:38 -0000 1.25 +++ libclamav/cvd.c 9 Dec 2005 01:16:23 -0000 @@ -35,6 +35,7 @@ #include "others.h" #include "dsig.h" #include "str.h" +#include "cvd.h" #define TAR_BLOCKSIZE 512 @@ -274,7 +275,7 @@ free(cvd); } -int cli_cvdverify(FILE *fd, struct cl_cvd *cvdpt) +static int cli_cvdverify(FILE *fd, struct cl_cvd *cvdpt) { struct cl_cvd *cvd; char *md5, head[513]; Index: libclamav/fsg.c =================================================================== RCS file: /cvsroot/clamav/clamav-devel/libclamav/fsg.c,v retrieving revision 1.8 diff -u -r1.8 fsg.c --- libclamav/fsg.c 3 Nov 2005 21:34:54 -0000 1.8 +++ libclamav/fsg.c 9 Dec 2005 01:16:23 -0000 @@ -47,6 +47,7 @@ #include "pe.h" #include "rebuildpe.h" #include "others.h" +#include "fsg.h" #if WORDS_BIGENDIAN == 0 #define EC16(v) (v) Index: libclamav/matcher-bm.c =================================================================== RCS file: /cvsroot/clamav/clamav-devel/libclamav/matcher-bm.c,v retrieving revision 1.19 diff -u -r1.19 matcher-bm.c --- libclamav/matcher-bm.c 23 Sep 2005 02:23:36 -0000 1.19 +++ libclamav/matcher-bm.c 9 Dec 2005 01:16:23 -0000 @@ -21,6 +21,7 @@ #include "others.h" #include "cltypes.h" #include "matcher.h" +#include "matcher-bm.h" /* TODO: Check prefix regularity and automatically transfer some signatures * to AC Index: libclamav/matcher-bm.h =================================================================== RCS file: /cvsroot/clamav/clamav-devel/libclamav/matcher-bm.h,v retrieving revision 1.4 diff -u -r1.4 matcher-bm.h --- libclamav/matcher-bm.h 23 Sep 2005 02:23:36 -0000 1.4 +++ libclamav/matcher-bm.h 9 Dec 2005 01:16:23 -0000 @@ -21,6 +21,7 @@ #include "clamav.h" #include "matcher.h" +#include "matcher-bm.h" int cli_bm_addpatt(struct cli_matcher *root, struct cli_bm_patt *pattern); int cli_bm_init(struct cli_matcher *root); Index: libclamav/mbox.h =================================================================== RCS file: /cvsroot/clamav/clamav-devel/libclamav/mbox.h,v retrieving revision 1.7 diff -u -r1.7 mbox.h --- libclamav/mbox.h 30 Apr 2005 13:12:28 -0000 1.7 +++ libclamav/mbox.h 9 Dec 2005 01:16:23 -0000 @@ -39,3 +39,4 @@ size_t strstrip(char *s); /* remove trailing white space */ const char *cli_pmemstr(const char *haystack, size_t hs, const char *needle, size_t ns); +int cli_mbox(const char *dir, int desc, unsigned int options); Index: libclamav/msexpand.c =================================================================== RCS file: /cvsroot/clamav/clamav-devel/libclamav/msexpand.c,v retrieving revision 1.1 diff -u -r1.1 msexpand.c --- libclamav/msexpand.c 2 May 2004 00:51:01 -0000 1.1 +++ libclamav/msexpand.c 9 Dec 2005 01:16:23 -0000 @@ -31,6 +31,7 @@ #endif #include "cltypes.h" #include "others.h" +#include "msexpand.h" int cli_msexpand(FILE *in, FILE *out) { Index: libclamav/ole2_extract.c =================================================================== RCS file: /cvsroot/clamav/clamav-devel/libclamav/ole2_extract.c,v retrieving revision 1.36 diff -u -r1.36 ole2_extract.c --- libclamav/ole2_extract.c 18 Oct 2005 10:32:06 -0000 1.36 +++ libclamav/ole2_extract.c 9 Dec 2005 01:16:23 -0000 @@ -44,6 +44,7 @@ #include "cltypes.h" #include "others.h" +#include "ole2_extract.h" #ifndef FALSE #define FALSE (0) Index: libclamav/others.c =================================================================== RCS file: /cvsroot/clamav/clamav-devel/libclamav/others.c,v retrieving revision 1.70 diff -u -r1.70 others.c --- libclamav/others.c 10 Nov 2005 22:52:55 -0000 1.70 +++ libclamav/others.c 9 Dec 2005 01:16:23 -0000 @@ -697,7 +697,7 @@ return n; } -bitset_t *cli_bitset_init() +bitset_t *cli_bitset_init(void) { bitset_t *bs; Index: libclamav/others.h =================================================================== RCS file: /cvsroot/clamav/clamav-devel/libclamav/others.h,v retrieving revision 1.15 diff -u -r1.15 others.h --- libclamav/others.h 18 Oct 2005 10:32:06 -0000 1.15 +++ libclamav/others.h 9 Dec 2005 01:16:23 -0000 @@ -49,7 +49,7 @@ char *cli_gentempstream(const char *dir, FILE **fs); unsigned int cli_rndnum(unsigned int max); int cli_filecopy(const char *src, const char *dest); -bitset_t *cli_bitset_init(); +bitset_t *cli_bitset_init(void); void cli_bitset_free(bitset_t *bs); int cli_bitset_set(bitset_t *bs, unsigned long bit_offset); int cli_bitset_test(bitset_t *bs, unsigned long bit_offset); Index: libclamav/pdf.c =================================================================== RCS file: /cvsroot/clamav/clamav-devel/libclamav/pdf.c,v retrieving revision 1.34 diff -u -r1.34 pdf.c --- libclamav/pdf.c 6 Nov 2005 14:41:18 -0000 1.34 +++ libclamav/pdf.c 9 Dec 2005 01:16:23 -0000 @@ -50,6 +50,7 @@ #include "table.h" #include "mbox.h" #include "blob.h" +#include "pdf.h" #ifndef MIN #define MIN(a, b) (((a) < (b)) ? (a) : (b)) Index: libclamav/petite.c =================================================================== RCS file: /cvsroot/clamav/clamav-devel/libclamav/petite.c,v retrieving revision 1.7 diff -u -r1.7 petite.c --- libclamav/petite.c 3 Nov 2005 21:37:32 -0000 1.7 +++ libclamav/petite.c 9 Dec 2005 01:16:23 -0000 @@ -58,6 +58,7 @@ #include "pe.h" #include "rebuildpe.h" #include "others.h" +#include "petite.h" #if WORDS_BIGENDIAN == 0 #define EC32(v) (v) Index: libclamav/special.c =================================================================== RCS file: /cvsroot/clamav/clamav-devel/libclamav/special.c,v retrieving revision 1.12 diff -u -r1.12 special.c --- libclamav/special.c 12 May 2005 08:25:18 -0000 1.12 +++ libclamav/special.c 9 Dec 2005 01:16:23 -0000 @@ -28,6 +28,7 @@ #include "clamav.h" #include "others.h" #include "cltypes.h" +#include "special.h" #define FALSE (0) #define TRUE (1) Index: libclamav/spin.c =================================================================== RCS file: /cvsroot/clamav/clamav-devel/libclamav/spin.c,v retrieving revision 1.4 diff -u -r1.4 spin.c --- libclamav/spin.c 17 Aug 2005 13:55:45 -0000 1.4 +++ libclamav/spin.c 9 Dec 2005 01:16:23 -0000 @@ -61,6 +61,7 @@ #include "pe.h" #include "rebuildpe.h" #include "others.h" +#include "spin.h" #if WORDS_BIGENDIAN == 0 #define EC32(v) (v) Index: libclamav/mspack/lzxd.c =================================================================== RCS file: /cvsroot/clamav/clamav-devel/libclamav/mspack/lzxd.c,v retrieving revision 1.2 diff -u -r1.2 lzxd.c --- libclamav/mspack/lzxd.c 12 Jun 2004 19:16:12 -0000 1.2 +++ libclamav/mspack/lzxd.c 9 Dec 2005 01:16:23 -0000 @@ -354,7 +354,7 @@ static unsigned int position_base[51]; static unsigned char extra_bits[51]; -static void lzxd_static_init() { +static void lzxd_static_init(void) { int i, j; for (i = 0, j = 0; i < 51; i += 2) { Index: libclamav/mspack/qtmd.c =================================================================== RCS file: /cvsroot/clamav/clamav-devel/libclamav/mspack/qtmd.c,v retrieving revision 1.2 diff -u -r1.2 qtmd.c --- libclamav/mspack/qtmd.c 24 Jun 2005 12:30:46 -0000 1.2 +++ libclamav/mspack/qtmd.c 9 Dec 2005 01:16:23 -0000 @@ -119,7 +119,7 @@ static unsigned int position_base[42]; static unsigned char extra_bits[42], length_base[27], length_extra[27]; -static void qtmd_static_init() { +static void qtmd_static_init(void) { unsigned int i, offset; for (i = 0, offset = 0; i < 42; i++) { Index: libclamav/mspack/system.c =================================================================== RCS file: /cvsroot/clamav/clamav-devel/libclamav/mspack/system.c,v retrieving revision 1.3 diff -u -r1.3 system.c --- libclamav/mspack/system.c 13 Oct 2004 18:24:02 -0000 1.3 +++ libclamav/mspack/system.c 9 Dec 2005 01:16:23 -0000 @@ -13,6 +13,7 @@ #include <mspack.h> #include "others.h" +#include "system.h" int mspack_version(int entity) { switch (entity) { Index: libclamav/unrar/unrarfilter.c =================================================================== RCS file: /cvsroot/clamav/clamav-devel/libclamav/unrar/unrarfilter.c,v retrieving revision 1.2 diff -u -r1.2 unrarfilter.c --- libclamav/unrar/unrarfilter.c 19 Apr 2005 11:32:41 -0000 1.2 +++ libclamav/unrar/unrarfilter.c 9 Dec 2005 01:16:23 -0000 @@ -61,7 +61,7 @@ return TRUE; } -struct UnpackFilter *rar_filter_new() +struct UnpackFilter *rar_filter_new(void) { struct UnpackFilter *filter; Index: libclamav/unrar/unrarfilter.h =================================================================== RCS file: /cvsroot/clamav/clamav-devel/libclamav/unrar/unrarfilter.h,v retrieving revision 1.2 diff -u -r1.2 unrarfilter.h --- libclamav/unrar/unrarfilter.h 19 Apr 2005 11:32:41 -0000 1.2 +++ libclamav/unrar/unrarfilter.h 9 Dec 2005 01:16:23 -0000 @@ -34,6 +34,6 @@ void rar_filter_array_init(rar_filter_array_t *filter_a); void rar_filter_array_reset(rar_filter_array_t *filter_a); int rar_filter_array_add(rar_filter_array_t *filter_a, int num); -struct UnpackFilter *rar_filter_new(); +struct UnpackFilter *rar_filter_new(void); void rar_filter_delete(struct UnpackFilter *filter); #endif Index: sigtool/sigtool.c =================================================================== RCS file: /cvsroot/clamav/clamav-devel/sigtool/sigtool.c,v retrieving revision 1.52 diff -u -r1.52 sigtool.c --- sigtool/sigtool.c 19 Aug 2005 22:35:36 -0000 1.52 +++ sigtool/sigtool.c 9 Dec 2005 01:16:23 -0000 @@ -213,7 +213,7 @@ } -int countlines(const char *filename) +static int countlines(const char *filename) { FILE *fd; char buff[65536]; Index: sigtool/vba.c =================================================================== RCS file: /cvsroot/clamav/clamav-devel/sigtool/vba.c,v retrieving revision 1.7 diff -u -r1.7 vba.c --- sigtool/vba.c 18 Jun 2005 00:02:47 -0000 1.7 +++ sigtool/vba.c 9 Dec 2005 01:16:23 -0000 @@ -76,7 +76,7 @@ return newname; } -void output_token (unsigned char token) +static void output_token (unsigned char token) { int i; mac_token_t mac_token[] = { @@ -172,7 +172,7 @@ return; } -void output_token67 (uint16_t token) +static void output_token67 (uint16_t token) { int i; mac_token2_t mac_token[] = { @@ -522,7 +522,7 @@ return; } -void output_token73 (uint16_t token) +static void output_token73 (uint16_t token) { int i; mac_token2_t mac_token[] = { @@ -773,7 +773,7 @@ return; } -void print_hex_buff (unsigned char *start, unsigned char *end, int hex_output) +static void print_hex_buff (unsigned char *start, unsigned char *end, int hex_output) { if (!hex_output) { return; @@ -786,7 +786,7 @@ printf ("]\n"); } -void wm_decode_macro (unsigned char *buff, uint32_t len, int hex_output) +static void wm_decode_macro (unsigned char *buff, uint32_t len, int hex_output) { int i, j; uint8_t s_length;
_______________________________________________ http://lurker.clamav.net/list/clamav-devel.html