From d45d96cd06c742aec04ef51b17bc8b92c2439302 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sun, 14 Apr 2024 21:59:22 +0900 Subject: Fix FTBFS caused by invalid cast. This resolves issue #38. Signed-off-by: Michele Calgaro --- kpat/freecell-solver/cmd_line.c | 15 ++++++++------- kpat/freecell-solver/fcs_cl.h | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'kpat') diff --git a/kpat/freecell-solver/cmd_line.c b/kpat/freecell-solver/cmd_line.c index 63fbf6c9..2eaf524c 100644 --- a/kpat/freecell-solver/cmd_line.c +++ b/kpat/freecell-solver/cmd_line.c @@ -518,7 +518,7 @@ int freecell_solver_user_cmd_line_parse_args_with_file_nesting_count( { int a; const char * start_num; - char * end_num; + const char * end_num; char * num_copy; start_num = argv[arg]; for(a=0;a<5;a++) @@ -642,7 +642,7 @@ int freecell_solver_user_cmd_line_parse_args_with_file_nesting_count( *last_arg = arg-1; return FCS_CMD_LINE_PARAM_WITH_NO_ARG; } - freecell_solver_user_set_soft_thread_name(instance, argv[arg]); + freecell_solver_user_set_soft_thread_name(instance, (char*)argv[arg]); } else if ((!strcmp(argv[arg], "--prelude"))) { @@ -652,7 +652,7 @@ int freecell_solver_user_cmd_line_parse_args_with_file_nesting_count( *last_arg = arg-1; return FCS_CMD_LINE_PARAM_WITH_NO_ARG; } - freecell_solver_user_set_hard_thread_prelude(instance, argv[arg]); + freecell_solver_user_set_hard_thread_prelude(instance, (char*)argv[arg]); } else if ((!strcmp(argv[arg], "-opt-to")) || (!strcmp(argv[arg], "--optimization-tests-order"))) { @@ -746,7 +746,8 @@ int freecell_solver_user_cmd_line_parse_args_with_file_nesting_count( else { int num_to_skip = 0; - char * s, * buffer; + const char * s; + char * buffer; FILE * f; long file_len; int ret; @@ -842,7 +843,7 @@ int freecell_solver_user_cmd_line_parse_args_with_file_nesting_count( ret = freecell_solver_user_cmd_line_parse_args_with_file_nesting_count( instance, args_man->argc - num_to_skip, - args_man->argv + num_to_skip, + (const char **)(args_man->argv + num_to_skip), 0, known_parameters, callback, @@ -879,7 +880,7 @@ int freecell_solver_user_cmd_line_parse_args_with_file_nesting_count( args_man_t * preset_args = 0; char * dir = NULL; - status = read_preset(argv[arg], &preset_args, &dir, NULL); + status = read_preset((char*)argv[arg], &preset_args, &dir, NULL); if (status != 0) { char * err_str; @@ -896,7 +897,7 @@ int freecell_solver_user_cmd_line_parse_args_with_file_nesting_count( ret = freecell_solver_user_cmd_line_parse_args_with_file_nesting_count( instance, preset_args->argc, - preset_args->argv, + (const char**)preset_args->argv, 0, known_parameters, callback, diff --git a/kpat/freecell-solver/fcs_cl.h b/kpat/freecell-solver/fcs_cl.h index e739c98e..6dafaec6 100644 --- a/kpat/freecell-solver/fcs_cl.h +++ b/kpat/freecell-solver/fcs_cl.h @@ -12,7 +12,7 @@ typedef int (*freecell_solver_user_cmd_line_known_commands_callback_t) ( void * instance, int argc, - char * argv[], + const char * argv[], int arg_index, int * num_to_skip, int * ret, -- cgit v1.2.1