From: compudj Date: Mon, 2 Jun 2003 14:01:57 +0000 (+0000) Subject: const to args X-Git-Tag: v0.12.20~3410 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f68ad60df1c702e550a78244984abd5cffec16d0;p=lttv.git const to args git-svn-id: http://ltt.polymtl.ca/svn@79 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/ltt/branches/poly/lttv/option.c b/ltt/branches/poly/lttv/option.c index c5180ef2..0ab381f7 100644 --- a/ltt/branches/poly/lttv/option.c +++ b/ltt/branches/poly/lttv/option.c @@ -63,6 +63,16 @@ void lttv_option_init(int argc, char **argv) { void lttv_option_destroy() { + struct poptOption *poption; + + for(i=0; ilen,i++) { + poption = &g_array_index (lttv_options_command_popt, struct poptOption, i); + + g_free(poption.longName); + g_free(poption.shortName); + g_free(poption.descrip); + g_free(poption.argDescrip); + } g_array_free(lttv_options_command_popt,TRUE) ; g_array_free(lttv_options_command,TRUE) ; @@ -83,18 +93,19 @@ static int poptToLTT[] = { }; -void lttv_option_add(char *long_name, char char_name, char *description, - char *argDescription, lttv_option_type t, void *p, - lttv_option_hook h, void *hook_data) +void lttv_option_add(const char *long_name, const char char_name, + const char *description, const char *argDescription, + const lttv_option_type t, const void *p, + const lttv_option_hook h, void *hook_data) { struct poptOption poption; lttv_option option; - poption.longName = long_name; + poption.longName = (char *)g_strdup(long_name); poption.shortName = char_name; - poption.descrip = description; - poption.argDescrip = argDescription; + poption.descrip = (char *)g_strdup(description); + poption.argDescrip = (char *)g_strdup(argDescription); poption.argInfo = poptToLTT[t]; poption.arg = p; poption.val = lttv_options_command->len + 1; diff --git a/ltt/branches/poly/lttv/option.h b/ltt/branches/poly/lttv/option.h index 73563d3d..bcc086a3 100644 --- a/ltt/branches/poly/lttv/option.h +++ b/ltt/branches/poly/lttv/option.h @@ -19,9 +19,10 @@ lttv_option_type; typedef void (*lttv_option_hook)(void *hook_data); -void lttv_option_add(char *long_name, char char_name, char *description, - char *argDescription, lttv_option_type t, void *p, - lttv_option_hook h, void *hook_data); +void lttv_option_add(const char *long_name, const char char_name, + const char *description, const char *argDescription, + lttv_option_type t, void *p, lttv_option_hook h, + void *hook_data);