From 80a45b5eccf1fdacbc823d5e7c75f41612f8203a Mon Sep 17 00:00:00 2001 From: Snaipe Date: Fri, 20 Nov 2015 19:10:35 +0100 Subject: [PATCH] [Issue #76] Fixed compilation errors for ICC --- src/compat/pipe.h | 1 + src/core/runner_coroutine.c | 17 ++++++++--------- src/entry/main.c | 4 ++-- src/io/redirect.c | 6 +++--- src/string/extmatch.c | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/compat/pipe.h b/src/compat/pipe.h index f6a607e..d0e162d 100644 --- a/src/compat/pipe.h +++ b/src/compat/pipe.h @@ -47,6 +47,7 @@ enum criterion_std_fd { }; enum pipe_opt { + PIPE_NOOPT = 0, PIPE_DUP = 1 << 0, PIPE_CLOSE = 1 << 1, }; diff --git a/src/core/runner_coroutine.c b/src/core/runner_coroutine.c index 6e557a3..50f336c 100644 --- a/src/core/runner_coroutine.c +++ b/src/core/runner_coroutine.c @@ -102,6 +102,7 @@ static int skip_disabled(struct run_next_context *ctx) { struct worker *run_next_test(struct criterion_test_set *p_set, struct criterion_global_stats *p_stats, ccrContParam) { + struct worker *worker = NULL; ccrUseNamedContext(run_next_context, ctx); @@ -122,8 +123,7 @@ struct worker *run_next_test(struct criterion_test_set *p_set, ctx->suite_stats = suite_stats_init(&ctx->suite_set->suite); - struct event ev = { .kind = PRE_SUITE }; - stat_push_event(ctx->stats, ctx->suite_stats, NULL, &ev); + stat_push_event(ctx->stats, ctx->suite_stats, NULL, &(struct event) { .kind = PRE_SUITE }); for (ctx->nt = ctx->suite_set->tests->first; ctx->nt; ctx->nt = ctx->nt->next) { ctx->test = (void*) (ctx->nt + 1); @@ -138,15 +138,14 @@ struct worker *run_next_test(struct criterion_test_set *p_set, for (ctx->i = 0; ctx->i < ctx->params.length; ++ctx->i) { ctx->test_stats = test_stats_init(ctx->test); - struct test_single_param param = { - ctx->params.size, - (char *) ctx->params.params + ctx->i * ctx->params.size - }; - struct worker *worker = run_test(ctx->stats, + worker = run_test(ctx->stats, ctx->suite_stats, ctx->test_stats, - ¶m); + &(struct test_single_param) { + ctx->params.size, + (char *) ctx->params.params + ctx->i * ctx->params.size + }); ccrReturn(cleanup_and_return_worker(ctx, worker)); } @@ -159,7 +158,7 @@ struct worker *run_next_test(struct criterion_test_set *p_set, if (skip_disabled(ctx)) continue; - struct worker *worker = run_test(ctx->stats, + worker = run_test(ctx->stats, ctx->suite_stats, ctx->test_stats, NULL); diff --git a/src/entry/main.c b/src/entry/main.c index 792ff79..1f64243 100644 --- a/src/entry/main.c +++ b/src/entry/main.c @@ -188,7 +188,7 @@ int criterion_handle_args(int argc, char *argv[], bool handle_unknown_arg) { if (env_jobs) opt->jobs = atou(env_jobs); if (env_logging_threshold) - opt->logging_threshold = atou(env_logging_threshold); + opt->logging_threshold = (enum criterion_logging_level) atou(env_logging_threshold); if (env_short_filename) opt->short_filename = !strcmp("1", env_short_filename); @@ -206,7 +206,7 @@ int criterion_handle_args(int argc, char *argv[], bool handle_unknown_arg) { bool quiet = false; for (int c; (c = getopt_long(argc, argv, "hvlfj:SqO:", opts, NULL)) != -1;) { switch (c) { - case 'b': criterion_options.logging_threshold = atou(DEF(optarg, "1")); break; + case 'b': criterion_options.logging_threshold = (enum criterion_logging_level) atou(DEF(optarg, "1")); break; case 'y': criterion_options.always_succeed = true; break; case 'z': criterion_options.no_early_exit = true; break; case 'k': criterion_options.use_ascii = true; break; diff --git a/src/io/redirect.c b/src/io/redirect.c index a9d80d0..2ee3e19 100644 --- a/src/io/redirect.c +++ b/src/io/redirect.c @@ -49,7 +49,7 @@ void cr_redirect_stdin(void) { FILE* cr_get_redirected_stdout(void) { static FILE *f; if (!f) { - f = pipe_in(stdout_redir, 0); + f = pipe_in(stdout_redir, PIPE_NOOPT); if (!f) cr_assert_fail("Could not get redirected stdout read end."); } @@ -59,7 +59,7 @@ FILE* cr_get_redirected_stdout(void) { FILE* cr_get_redirected_stderr(void) { static FILE *f; if (!f) { - f = pipe_in(stderr_redir, 0); + f = pipe_in(stderr_redir, PIPE_NOOPT); if (!f) cr_assert_fail("Could not get redirected stderr read end."); } @@ -69,7 +69,7 @@ FILE* cr_get_redirected_stderr(void) { FILE* cr_get_redirected_stdin(void) { static FILE *f; if (!f) { - f = pipe_out(stdin_redir, 0); + f = pipe_out(stdin_redir, PIPE_NOOPT); if (!f) cr_assert_fail("Could not get redirected stdin write end."); } diff --git a/src/string/extmatch.c b/src/string/extmatch.c index de63088..6e9e550 100644 --- a/src/string/extmatch.c +++ b/src/string/extmatch.c @@ -99,8 +99,8 @@ typedef struct { char *str; } handler_arg; -static int active() { return 1; } -static int inactive() { return 0; } +static int active(struct context *ctx) { return 1; } +static int inactive(struct context *ctx) { return 0; } static int is_eos(struct context *ctx) { return peek_char(ctx) == '\0';