1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Simplify variable declaration by C99

This commit is contained in:
Takashi Kokubun 2019-12-01 17:32:50 -08:00
parent 103b04128f
commit de74d2c3b0
No known key found for this signature in database
GPG key ID: 6FFC433B12EE23DD

14
mjit.c
View file

@ -768,14 +768,12 @@ mjit_init(const struct mjit_options *opts)
cc_added_args = split_flags(opts->debug_flags);
xfree(opts->debug_flags);
#if MJIT_CFLAGS_PIPE
{ // eliminate a flag incompatible with `-pipe`
size_t i, j;
for (i = 0, j = 0; i < sizeof(CC_COMMON_ARGS) / sizeof(char *); i++) {
if (CC_COMMON_ARGS[i] && strncmp("-save-temps", CC_COMMON_ARGS[i], strlen("-save-temps")) == 0)
continue; // skip -save-temps flag
cc_common_args[j] = CC_COMMON_ARGS[i];
j++;
}
// eliminate a flag incompatible with `-pipe`
for (size_t i = 0, j = 0; i < sizeof(CC_COMMON_ARGS) / sizeof(char *); i++) {
if (CC_COMMON_ARGS[i] && strncmp("-save-temps", CC_COMMON_ARGS[i], strlen("-save-temps")) == 0)
continue; // skip -save-temps flag
cc_common_args[j] = CC_COMMON_ARGS[i];
j++;
}
#endif