Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use STREQ() for string comparisons, instead of incorrectly using strc…

…mp as a boolean
  • Loading branch information...
commit 114d897d40ba688740cf5ac5b23a8f06e121e643 1 parent e938612
@petdance petdance authored
Showing with 6 additions and 7 deletions.
  1. +6 −7 src/embed/api.c
View
13 src/embed/api.c
@@ -173,18 +173,17 @@ Parrot_api_set_runcore(Parrot_PMC interp_pmc, ARGIN(const char * corename),
Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "slow"));
}
else {
- if (!strcmp(corename, "slow") || !strcmp(corename, "bounds"))
+ if (STREQ(corename, "slow") || STREQ(corename, "bounds"))
Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "slow"));
- else if (!strcmp(corename, "fast") ||
- !strcmp(corename, "jit") || !strcmp(corename, "function"))
+ else if (STREQ(corename, "fast") || STREQ(corename, "jit") || STREQ(corename, "function"))
Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "fast"));
- else if (!strcmp(corename, "exec"))
+ else if (STREQ(corename, "exec"))
Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "exec"));
- else if (!strcmp(corename, "trace"))
+ else if (STREQ(corename, "trace"))
Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "slow"));
- else if (!strcmp(corename, "profiling"))
+ else if (STREQ(corename, "profiling"))
Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "profiling"));
- else if (!strcmp(corename, "gcdebug"))
+ else if (STREQ(corename, "gcdebug"))
Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "gcdebug"));
else
Parrot_ex_throw_from_c_args(interp, NULL, 1, "Invalid runcore type %s", corename);
Please sign in to comment.
Something went wrong with that request. Please try again.