From 71daf4c9813145587e68d18293e8043193b00915 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Thu, 21 Feb 2013 18:01:23 +0100 Subject: [PATCH] Try to fix const madness. See http://c-faq.com/ansi/constmismatch.html for a related FAQ. --- include/xbt/replay.h | 4 ++-- src/xbt/xbt_replay.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/xbt/replay.h b/include/xbt/replay.h index 63fc9e87d2..2f15374e7b 100644 --- a/include/xbt/replay.h +++ b/include/xbt/replay.h @@ -22,9 +22,9 @@ XBT_PUBLIC_DATA(xbt_dict_t) action_queues; XBT_PUBLIC_DATA(FILE *) action_fp; XBT_PUBLIC(xbt_replay_reader_t) xbt_replay_reader_new(const char*filename); -XBT_PUBLIC(const char) **xbt_replay_reader_get(xbt_replay_reader_t reader); +XBT_PUBLIC(const char **) xbt_replay_reader_get(xbt_replay_reader_t reader); XBT_PUBLIC(void) xbt_replay_reader_free(xbt_replay_reader_t *reader); -XBT_PUBLIC(const char) *xbt_replay_reader_position(xbt_replay_reader_t reader); +XBT_PUBLIC(const char *) xbt_replay_reader_position(xbt_replay_reader_t reader); XBT_PUBLIC(int) xbt_replay_action_runner(int argc, char *argv[]); diff --git a/src/xbt/xbt_replay.c b/src/xbt/xbt_replay.c index d4937e8d1b..dd5bda1bd5 100644 --- a/src/xbt/xbt_replay.c +++ b/src/xbt/xbt_replay.c @@ -29,7 +29,7 @@ xbt_dict_t action_queues; static char *action_line = NULL; static size_t action_len = 0; -static const char **action_get_action(char *name); +static char **action_get_action(char *name); xbt_replay_reader_t xbt_replay_reader_new(const char *filename) { @@ -131,19 +131,19 @@ void _xbt_replay_action_exit(void) */ int xbt_replay_action_runner(int argc, char *argv[]) { - const char **evt; int i; if (action_fp) { // A unique trace file - + char **evt; while ((evt = action_get_action(argv[0]))) { action_fun function = (action_fun)xbt_dict_get(action_funs, evt[1]); - function(evt); + function((const char **)evt); for (i=0;evt[i]!= NULL;i++) - free((char*)evt[i]); + free(evt[i]); free(evt); } } else { // Should have got my trace file in argument + const char **evt; xbt_assert(argc >= 2, "No '%s' agent function provided, no simulation-wide trace file provided, " "and no process-wide trace file provided in deployment file. Aborting.", @@ -166,7 +166,7 @@ int xbt_replay_action_runner(int argc, char *argv[]) } -static const char **action_get_action(char *name) +static char **action_get_action(char *name) { xbt_dynar_t evt = NULL; char *evtname = NULL; -- 2.20.1