fix some compiler warnings, patch by Stefan Huehner <stefan*huehner.org>

git-svn: trunk@1778
This commit is contained in:
Tomasz Kojm 2005-12-10 18:50:26 +00:00
parent 9f2024cc93
commit 079229d60d
26 changed files with 42 additions and 25 deletions

View file

@ -1,3 +1,7 @@
Sat Dec 10 19:45:48 CET 2005 (tk)
---------------------------------
* fix some compiler warnings, patch by Stefan Huehner <stefan*huehner.org>
Tue Nov 29 16:31:23 GMT 2005 (trog) Tue Nov 29 16:31:23 GMT 2005 (trog)
----------------------------------- -----------------------------------
* libclamav/unrar/unrar.c unrarvm.c: #include clamav-config.h * libclamav/unrar/unrar.c unrarvm.c: #include clamav-config.h

View file

@ -68,6 +68,7 @@
#include "memory.h" #include "memory.h"
#include "cfgparser.h" #include "cfgparser.h"
#include "session.h" #include "session.h"
#include "others.h"
#define ENV_FILE "CLAM_VIRUSEVENT_FILENAME" #define ENV_FILE "CLAM_VIRUSEVENT_FILENAME"
#define ENV_VIRUS "CLAM_VIRUSEVENT_VIRUSNAME" #define ENV_VIRUS "CLAM_VIRUSEVENT_VIRUSNAME"

View file

@ -68,7 +68,7 @@ dev_t procdev; /* /proc device */
# endif # endif
#endif #endif
int checksymlink(const char *path) static int checksymlink(const char *path)
{ {
struct stat statbuf; struct stat statbuf;

View file

@ -29,7 +29,7 @@
#define FALSE (0) #define FALSE (0)
#define TRUE (1) #define TRUE (1)
work_queue_t *work_queue_new() static work_queue_t *work_queue_new(void)
{ {
work_queue_t *work_q; work_queue_t *work_q;
@ -40,7 +40,7 @@ work_queue_t *work_queue_new()
return work_q; 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; work_item_t *work_item;
@ -63,7 +63,7 @@ void work_queue_add(work_queue_t *work_q, void *data)
return; 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; work_item_t *work_item;
void *data; void *data;

View file

@ -59,7 +59,7 @@
void move_infected(const char *filename, const struct optstruct *opt); void move_infected(const char *filename, const struct optstruct *opt);
int notremoved = 0, notmoved = 0; 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; int infected = 0, waserror = 0;
char buff[4096], *pt; char buff[4096], *pt;
@ -109,7 +109,7 @@ int dsresult(int sockd, const struct optstruct *opt)
return infected ? infected : (waserror ? -1 : 0); 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; int ret;
char *scancmd; char *scancmd;
@ -137,7 +137,7 @@ int dsfile(int sockd, const char *filename, const struct optstruct *opt)
#if defined(ENABLE_FD_PASSING) && defined(HAVE_SENDMSG) && (defined(HAVE_ACCRIGHTS_IN_MSGHDR) || defined(HAVE_CONTROL_IN_MSGHDR)) && !defined(C_CYGWIN) #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> */ /* 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 iovec iov[1];
struct msghdr msg; struct msghdr msg;
@ -177,13 +177,13 @@ int dsfd(int sockfd, int fd, const struct optstruct *opt)
return dsresult(sockfd, opt); return dsresult(sockfd, opt);
} }
#else #else
int dsfd(int sockfd, int fd, const struct optstruct *opt) static int dsfd(int sockfd, int fd, const struct optstruct *opt)
{ {
return -1; return -1;
} }
#endif #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; int wsockd, loopw = 60, bread, port, infected = 0;
struct sockaddr_in server; struct sockaddr_in server;
@ -275,7 +275,7 @@ int dsstream(int sockd, const struct optstruct *opt)
return infected; return infected;
} }
char *abpath(const char *filename) static char *abpath(const char *filename)
{ {
struct stat foo; struct stat foo;
char *fullpath, cwd[200]; char *fullpath, cwd[200];
@ -300,7 +300,7 @@ char *abpath(const char *filename)
return fullpath; return fullpath;
} }
int dconnect(const struct optstruct *opt) static int dconnect(const struct optstruct *opt)
{ {
struct sockaddr_un server; struct sockaddr_un server;
struct sockaddr_in server2; struct sockaddr_in server2;

View file

@ -33,6 +33,7 @@
#include "memory.h" #include "memory.h"
#include "output.h" #include "output.h"
#include "dns.h"
#ifndef PACKETSZ #ifndef PACKETSZ
#define PACKETSZ 512 #define PACKETSZ 512

View file

@ -588,7 +588,7 @@ int wwwconnect(const char *server, const char *proxy, int pport, char *ip, char
return -2; return -2;
} }
int Rfc2822DateTime(char *buf, time_t mtime) static int Rfc2822DateTime(char *buf, time_t mtime)
{ {
struct tm *time; struct tm *time;

View file

@ -35,6 +35,7 @@
#include "others.h" #include "others.h"
#include "dsig.h" #include "dsig.h"
#include "str.h" #include "str.h"
#include "cvd.h"
#define TAR_BLOCKSIZE 512 #define TAR_BLOCKSIZE 512
@ -274,7 +275,7 @@ void cl_cvdfree(struct cl_cvd *cvd)
free(cvd); 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; struct cl_cvd *cvd;
char *md5, head[513]; char *md5, head[513];

View file

@ -47,6 +47,7 @@
#include "pe.h" #include "pe.h"
#include "rebuildpe.h" #include "rebuildpe.h"
#include "others.h" #include "others.h"
#include "fsg.h"
#if WORDS_BIGENDIAN == 0 #if WORDS_BIGENDIAN == 0
#define EC16(v) (v) #define EC16(v) (v)

View file

@ -21,6 +21,7 @@
#include "others.h" #include "others.h"
#include "cltypes.h" #include "cltypes.h"
#include "matcher.h" #include "matcher.h"
#include "matcher-bm.h"
/* TODO: Check prefix regularity and automatically transfer some signatures /* TODO: Check prefix regularity and automatically transfer some signatures
* to AC * to AC

View file

@ -21,6 +21,7 @@
#include "clamav.h" #include "clamav.h"
#include "matcher.h" #include "matcher.h"
#include "matcher-bm.h"
int cli_bm_addpatt(struct cli_matcher *root, struct cli_bm_patt *pattern); int cli_bm_addpatt(struct cli_matcher *root, struct cli_bm_patt *pattern);
int cli_bm_init(struct cli_matcher *root); int cli_bm_init(struct cli_matcher *root);

View file

@ -39,3 +39,4 @@ typedef enum {
size_t strstrip(char *s); /* remove trailing white space */ 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); 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);

View file

@ -31,6 +31,7 @@
#endif #endif
#include "cltypes.h" #include "cltypes.h"
#include "others.h" #include "others.h"
#include "msexpand.h"
int cli_msexpand(FILE *in, FILE *out) int cli_msexpand(FILE *in, FILE *out)
{ {

View file

@ -354,7 +354,7 @@ static int lzxd_read_lens(struct lzxd_stream *lzx, unsigned char *lens,
static unsigned int position_base[51]; static unsigned int position_base[51];
static unsigned char extra_bits[51]; static unsigned char extra_bits[51];
static void lzxd_static_init() { static void lzxd_static_init(void) {
int i, j; int i, j;
for (i = 0, j = 0; i < 51; i += 2) { for (i = 0, j = 0; i < 51; i += 2) {

View file

@ -119,7 +119,7 @@ static int qtmd_read_input(struct qtmd_stream *qtm) {
static unsigned int position_base[42]; static unsigned int position_base[42];
static unsigned char extra_bits[42], length_base[27], length_extra[27]; 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; unsigned int i, offset;
for (i = 0, offset = 0; i < 42; i++) { for (i = 0, offset = 0; i < 42; i++) {

View file

@ -13,6 +13,7 @@
#include <mspack.h> #include <mspack.h>
#include "others.h" #include "others.h"
#include "system.h"
int mspack_version(int entity) { int mspack_version(int entity) {
switch (entity) { switch (entity) {

View file

@ -44,6 +44,7 @@
#include "cltypes.h" #include "cltypes.h"
#include "others.h" #include "others.h"
#include "ole2_extract.h"
#ifndef FALSE #ifndef FALSE
#define FALSE (0) #define FALSE (0)

View file

@ -697,7 +697,7 @@ static unsigned long nearest_power(unsigned long num)
return n; return n;
} }
bitset_t *cli_bitset_init() bitset_t *cli_bitset_init(void)
{ {
bitset_t *bs; bitset_t *bs;

View file

@ -49,7 +49,7 @@ char *cli_gentempdesc(const char *dir, int *fd);
char *cli_gentempstream(const char *dir, FILE **fs); char *cli_gentempstream(const char *dir, FILE **fs);
unsigned int cli_rndnum(unsigned int max); unsigned int cli_rndnum(unsigned int max);
int cli_filecopy(const char *src, const char *dest); 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); void cli_bitset_free(bitset_t *bs);
int cli_bitset_set(bitset_t *bs, unsigned long bit_offset); int cli_bitset_set(bitset_t *bs, unsigned long bit_offset);
int cli_bitset_test(bitset_t *bs, unsigned long bit_offset); int cli_bitset_test(bitset_t *bs, unsigned long bit_offset);

View file

@ -58,6 +58,7 @@
#include "pe.h" #include "pe.h"
#include "rebuildpe.h" #include "rebuildpe.h"
#include "others.h" #include "others.h"
#include "petite.h"
#if WORDS_BIGENDIAN == 0 #if WORDS_BIGENDIAN == 0
#define EC32(v) (v) #define EC32(v) (v)

View file

@ -28,6 +28,7 @@
#include "clamav.h" #include "clamav.h"
#include "others.h" #include "others.h"
#include "cltypes.h" #include "cltypes.h"
#include "special.h"
#define FALSE (0) #define FALSE (0)
#define TRUE (1) #define TRUE (1)

View file

@ -61,6 +61,7 @@
#include "pe.h" #include "pe.h"
#include "rebuildpe.h" #include "rebuildpe.h"
#include "others.h" #include "others.h"
#include "spin.h"
#if WORDS_BIGENDIAN == 0 #if WORDS_BIGENDIAN == 0
#define EC32(v) (v) #define EC32(v) (v)

View file

@ -61,7 +61,7 @@ int rar_filter_array_add(rar_filter_array_t *filter_a, int num)
return TRUE; return TRUE;
} }
struct UnpackFilter *rar_filter_new() struct UnpackFilter *rar_filter_new(void)
{ {
struct UnpackFilter *filter; struct UnpackFilter *filter;

View file

@ -34,6 +34,6 @@ typedef struct rar_filter_array_tag
void rar_filter_array_init(rar_filter_array_t *filter_a); void rar_filter_array_init(rar_filter_array_t *filter_a);
void rar_filter_array_reset(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); 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); void rar_filter_delete(struct UnpackFilter *filter);
#endif #endif

View file

@ -213,7 +213,7 @@ void sigtool(struct optstruct *opt)
} }
int countlines(const char *filename) static int countlines(const char *filename)
{ {
FILE *fd; FILE *fd;
char buff[65536]; char buff[65536];

View file

@ -76,7 +76,7 @@ static char *get_unicode_name (char *name, int size)
return newname; return newname;
} }
void output_token (unsigned char token) static void output_token (unsigned char token)
{ {
int i; int i;
mac_token_t mac_token[] = { mac_token_t mac_token[] = {
@ -172,7 +172,7 @@ void output_token (unsigned char token)
return; return;
} }
void output_token67 (uint16_t token) static void output_token67 (uint16_t token)
{ {
int i; int i;
mac_token2_t mac_token[] = { mac_token2_t mac_token[] = {
@ -522,7 +522,7 @@ void output_token67 (uint16_t token)
return; return;
} }
void output_token73 (uint16_t token) static void output_token73 (uint16_t token)
{ {
int i; int i;
mac_token2_t mac_token[] = { mac_token2_t mac_token[] = {
@ -773,7 +773,7 @@ void output_token73 (uint16_t token)
return; 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) { if (!hex_output) {
return; return;
@ -786,7 +786,7 @@ void print_hex_buff (unsigned char *start, unsigned char *end, int hex_output)
printf ("]\n"); 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; int i, j;
uint8_t s_length; uint8_t s_length;