[Devel] [PATCH] vzctl: Deal with compilation warnings

Dmitry V. Levin ldv at altlinux.org
Thu Jun 22 00:34:24 PDT 2006


Deal with compilation warnings.

include/modules.h: Add "const" qualifier to argument 2 of mod_info->get_opt().
include/modules.h: Add is_mod_action() declaration.
include/res.h: Make struct vps_res named.
include/validate.h: Add forward declaration of struct vps_res.
include/validate.h: Add validate() declaration.
src/lib/modules.c: Add "const" qualifier to argument 2 of is_mod_action().
src/vzlist.c: In parse_var(), change types of automatic variables from "unsigned char *" to "char *".

Signed-off-by: Dmitry V. Levin <ldv at altlinux.org>


---

 include/modules.h  |    3 ++-
 include/res.h      |    2 +-
 include/validate.h |    2 ++
 src/lib/modules.c  |    2 +-
 src/vzlist.c       |    2 +-
 5 files changed, 7 insertions(+), 4 deletions(-)

75c9fb7bfe0224d44a2ab56ac4acc2fe8f62d92c
diff --git a/include/modules.h b/include/modules.h
index 7e362ac..03cff7c 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -62,7 +62,7 @@ struct mod_info {
 	int (*cleanup)(vps_handler *h, envid_t veid, data_param *data,
 		vps_param *param);
 	void (*free_data)(data_param *data);
-	struct option *(*get_opt)(data_param *data, char *action);
+	struct option *(*get_opt)(data_param *data, const char *action);
 	const char *(*get_usage)();
 };
 
@@ -87,6 +87,7 @@ int mod_setup(vps_handler *h, envid_t ve
 	struct mod_action *action, vps_param *param);
 int mod_cleanup(vps_handler *h, envid_t veid, struct mod_action *action,
 	vps_param *param);
+int is_mod_action(struct mod_info *info, const char *name);
 void mod_print_usage(struct mod_action *action);
 
 #endif	/* _MODULES_H_ */
diff --git a/include/res.h b/include/res.h
index 0a54725..39c02ce 100644
--- a/include/res.h
+++ b/include/res.h
@@ -47,7 +47,7 @@ struct mod_action;
 
 /** Data structure for VPS resources.
  */
-typedef struct {
+typedef struct vps_res {
 	fs_param fs;		/**< file system parameters. */
 	tmpl_param tmpl;	/**< template parameters. */
 	env_param env;		/**< environment parameters. */
diff --git a/include/validate.h b/include/validate.h
index c3da0b5..126374a 100644
--- a/include/validate.h
+++ b/include/validate.h
@@ -55,7 +55,9 @@ struct mem_struct {
 };
 
 struct ub_struct;
+struct vps_res;
 
+int validate(struct vps_res *param, int recover, int ask);
 int calc_ve_utilization(struct ub_struct *param, struct CRusage *rusage,
 	struct mem_struct *mem, int numerator);
 int calc_ve_commitment(struct ub_struct *param, struct CRusage *rusage,
diff --git a/src/lib/modules.c b/src/lib/modules.c
index f7eec24..6cb5fbd 100644
--- a/src/lib/modules.c
+++ b/src/lib/modules.c
@@ -159,7 +159,7 @@ int mod_cleanup(vps_handler *h, envid_t 
 	return 0;
 }
 
-int is_mod_action(struct mod_info *info, char *name)
+int is_mod_action(struct mod_info *info, const char *name)
 {
 	char **p;
 
diff --git a/src/vzlist.c b/src/vzlist.c
index bd4ffcc..e9f0b7c 100644
--- a/src/vzlist.c
+++ b/src/vzlist.c
@@ -747,7 +747,7 @@ void update_la(int veid, struct Cla *la)
 
 char *parse_var(char *var)
 {
-	unsigned char *sp, *ep;
+	char *sp, *ep;
 
 	if (var == NULL)
 		return NULL;


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://lists.openvz.org/pipermail/devel/attachments/20060622/b2e0842d/attachment-0001.sig>


More information about the Devel mailing list