[Issue #76] Fixed compilation errors for ICC

This commit is contained in:
Snaipe 2015-11-20 19:10:35 +01:00
parent 2fbf8e8f1d
commit 80a45b5ecc
5 changed files with 16 additions and 16 deletions

View file

@ -47,6 +47,7 @@ enum criterion_std_fd {
};
enum pipe_opt {
PIPE_NOOPT = 0,
PIPE_DUP = 1 << 0,
PIPE_CLOSE = 1 << 1,
};

View file

@ -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,
&param);
&(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);

View file

@ -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;

View file

@ -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.");
}

View file

@ -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';