From: Pawel Szewczyk Date: Tue, 12 Aug 2014 07:32:28 +0000 (+0200) Subject: gt: Removed const from main arguments type X-Git-Tag: accepted/tizen/3.0/common/20161114.110810~117 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b6daadce3db40e5aa571731e213a148fa95573d4;p=platform%2Fupstream%2Fgt.git gt: Removed const from main arguments type Argument passed to getopt should not be const char ** Change-Id: I0097802cd90d75a93a1e55efb40b75dac9e898f1 Signed-off-by: Pawel Szewczyk --- diff --git a/source/base/include/command.h b/source/base/include/command.h index 04f52be..66d4e7b 100644 --- a/source/base/include/command.h +++ b/source/base/include/command.h @@ -26,7 +26,7 @@ struct command; -typedef void (*ParseFunc)(const struct command *cmd, int, const char **, +typedef void (*ParseFunc)(const struct command *cmd, int, char **, ExecutableCommand *, void *); typedef const struct command *(*GetChildrenFunc)(const struct command *cmd); @@ -74,7 +74,7 @@ typedef struct command * @param[out] exec structure to be filled in with suitable command * @param[in] data additional data */ -void command_parse(const Command *cmd, int argc, const char **argv, +void command_parse(const Command *cmd, int argc, char **argv, ExecutableCommand *exec, void *data); #endif //__GADGET_TOOL_COMMAND_H__ diff --git a/source/base/include/parser.h b/source/base/include/parser.h index 4573880..65af5cb 100644 --- a/source/base/include/parser.h +++ b/source/base/include/parser.h @@ -31,6 +31,6 @@ * @param[out] exec which will be set with suitable values for parsed command * execution */ -void gt_parse_commands(int argc, const char **argv, ExecutableCommand *exec); +void gt_parse_commands(int argc, char **argv, ExecutableCommand *exec); #endif //__GADGET_TOOL_PARSER_H__ diff --git a/source/base/src/command.c b/source/base/src/command.c index 456e0c3..c56124d 100644 --- a/source/base/src/command.c +++ b/source/base/src/command.c @@ -34,7 +34,7 @@ static inline bool name_matches(const char *candidate, const char *pattern) || (!candidate); } -void command_parse(const Command *cmd, int argc, const char **argv, +void command_parse(const Command *cmd, int argc, char **argv, ExecutableCommand *exec, void *data) { const Command *next = cmd->getChildren(cmd); diff --git a/source/base/src/parser.c b/source/base/src/parser.c index 41f57b6..3c50a25 100644 --- a/source/base/src/parser.c +++ b/source/base/src/parser.c @@ -58,7 +58,7 @@ static inline const Command *gt_get_command_root(const Command *cmd) return tool_names; } -void gt_parse_commands(int argc, const char **argv, ExecutableCommand *exec) +void gt_parse_commands(int argc, char **argv, ExecutableCommand *exec) { static Command command_pre_root = { NULL, AGAIN, command_parse, gt_get_command_root, gt_global_help diff --git a/source/main.c b/source/main.c index f791142..d8cbc2c 100644 --- a/source/main.c +++ b/source/main.c @@ -28,9 +28,8 @@ #include "parser.h" #include "executable_command.h" -int main(int argc, const char **av) +int main(int argc, char **argv) { - const char **argv = av; int ret; ExecutableCommand cmd; diff --git a/source/udc/include/udc.h b/source/udc/include/udc.h index 26e9a5f..44bb3a1 100644 --- a/source/udc/include/udc.h +++ b/source/udc/include/udc.h @@ -35,7 +35,7 @@ int udc_help_func(void *data); * where the last element is invalid structure filled * with NULLs. */ -void udc_parse(const Command *cmd, int argc, const char **argv, +void udc_parse(const Command *cmd, int argc, char **argv, ExecutableCommand *exec, void * data); #endif //__GADGET_TOOL_UDC_UDC_PARSE_H__ diff --git a/source/udc/src/udc.c b/source/udc/src/udc.c index 52cebac..05d5956 100644 --- a/source/udc/src/udc.c +++ b/source/udc/src/udc.c @@ -30,7 +30,7 @@ int udc_help_func(void *data) return -1; } -void udc_parse(const Command *cmd, int argc, const char **argv, +void udc_parse(const Command *cmd, int argc, char **argv, ExecutableCommand *exec, void * data) { if(argc == 0)