Browse code

fix 'const' declarations (closes bug#69)

git-svn: trunk@2454

Tomasz Kojm authored on 2006/10/29 23:11:55
Showing 5 changed files
... ...
@@ -1,9 +1,15 @@
1
+Sun Oct 29 14:55:20 CET 2006 (tk)
2
+---------------------------------
3
+  * shared/options.[ch]: fix 'const' declarations (closes bug#69)
4
+			 Thanks to Mark Pizzolato
5
+
1 6
 Sun Oct 29 13:54:38 GMT 2006 (njh)
2 7
 ----------------------------------
3 8
   * libclamav/mbox.c:	Honour maxarchivelevel when scanning email messages.
4 9
 			It would be better to have a separate limit for that
5 10
 			Bugzilla 104
6 11
 
12
+>>>>>>> 1.1568
7 13
 Sun Oct 29 14:40:14 CET 2006 (tk)
8 14
 ---------------------------------
9 15
   * clamd/session.c: NAME_MAX was not defined (closes bug#60)
... ...
@@ -314,7 +314,7 @@ int scanmanager(const struct optstruct *opt)
314 314
 int scanfile(const char *filename, struct cl_node *root, const struct passwd *user, const struct optstruct *opt, const struct cl_limits *limits, int options)
315 315
 {
316 316
 	int ret, included, printclean = 1;
317
-	struct optnode *optnode;
317
+	const struct optnode *optnode;
318 318
 	char *argument;
319 319
 #ifdef C_LINUX
320 320
 	struct stat sb;
... ...
@@ -50,7 +50,7 @@ int treewalk(const char *dirname, struct cl_node *root, const struct passwd *use
50 50
 	char *fname;
51 51
 	int scanret = 0, included;
52 52
 	unsigned int maxdepth;
53
-	struct optnode *optnode;
53
+	const struct optnode *optnode;
54 54
 	char *argument;
55 55
 
56 56
 
... ...
@@ -33,7 +33,7 @@
33 33
 #include "output.h"
34 34
 
35 35
 
36
-static int register_option(struct optstruct *opt, const char *optlong, char optshort, const struct option *options_long, const char **accepted_long)
36
+static int register_option(struct optstruct *opt, const char *optlong, char optshort, const struct option *options_long, const char * const *accepted_long)
37 37
 {
38 38
 	struct optnode *newnode;
39 39
 	int i, found = 0;
... ...
@@ -123,7 +123,7 @@ void opt_free(struct optstruct *opt)
123 123
     free(opt);
124 124
 }
125 125
 
126
-struct optstruct *opt_parse(int argc, char * const *argv, const char *getopt_short, const struct option *options_long, const char **accepted_long)
126
+struct optstruct *opt_parse(int argc, char * const *argv, const char *getopt_short, const struct option *options_long, const char * const *accepted_long)
127 127
 {
128 128
 	int ret, opt_index, i, len;
129 129
 	struct optstruct *opt;
... ...
@@ -240,7 +240,7 @@ char *opt_arg(const struct optstruct *opt, char *optlong)
240 240
 
241 241
 char *opt_firstarg(const struct optstruct *opt, const char *optlong, const struct optnode **optnode)
242 242
 {
243
-	struct optnode *handler;
243
+	const struct optnode *handler;
244 244
 
245 245
     if(!opt) {
246 246
 	mprintf("!opt_firstarg: opt == NULL\n");
... ...
@@ -37,7 +37,7 @@ struct optstruct {
37 37
 
38 38
 void opt_free(struct optstruct *opt);
39 39
 
40
-struct optstruct *opt_parse(int argc, char * const *argv, const char *getopt_short, const struct option *options_long, const char **accepted_long);
40
+struct optstruct *opt_parse(int argc, char * const *argv, const char *getopt_short, const struct option *options_long, const char * const *accepted_long);
41 41
 
42 42
 int opt_check(const struct optstruct *opt, char *optlong);
43 43