ruby-changes:55176
From: mame <ko1@a...>
Date: Sat, 30 Mar 2019 08:26:38 +0900 (JST)
Subject: [ruby-changes:55176] mame:r67383 (trunk): mjit_worker.c: explicitly ignore the unused result of RB_DEBUG_COUNTER_INC_IF
mame 2019-03-30 08:26:31 +0900 (Sat, 30 Mar 2019) New Revision: 67383 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=67383 Log: mjit_worker.c: explicitly ignore the unused result of RB_DEBUG_COUNTER_INC_IF By adding `(void)`. This makes Coverity Scan happy. Modified files: trunk/mjit_worker.c Index: mjit_worker.c =================================================================== --- mjit_worker.c (revision 67382) +++ mjit_worker.c (revision 67383) @@ -327,9 +327,9 @@ mjit_warning(const char *format, ...) https://github.com/ruby/ruby/blob/trunk/mjit_worker.c#L327 static void add_to_list(struct rb_mjit_unit *unit, struct rb_mjit_unit_list *list) { - RB_DEBUG_COUNTER_INC_IF(mjit_length_unit_queue, list == &unit_queue); - RB_DEBUG_COUNTER_INC_IF(mjit_length_active_units, list == &active_units); - RB_DEBUG_COUNTER_INC_IF(mjit_length_compact_units, list == &compact_units); + (void)RB_DEBUG_COUNTER_INC_IF(mjit_length_unit_queue, list == &unit_queue); + (void)RB_DEBUG_COUNTER_INC_IF(mjit_length_active_units, list == &active_units); + (void)RB_DEBUG_COUNTER_INC_IF(mjit_length_compact_units, list == &compact_units); list_add_tail(&list->head, &unit->unode); list->length++; @@ -1241,7 +1241,7 @@ mjit_worker(void) https://github.com/ruby/ruby/blob/trunk/mjit_worker.c#L1241 if (unit) { // JIT compile mjit_func_t func = convert_unit_to_func(unit); - RB_DEBUG_COUNTER_INC_IF(mjit_compile_failures, func == (mjit_func_t)NOT_COMPILED_JIT_ISEQ_FUNC); + (void)RB_DEBUG_COUNTER_INC_IF(mjit_compile_failures, func == (mjit_func_t)NOT_COMPILED_JIT_ISEQ_FUNC); // `mjit_copy_cache_from_main_thread` in `mjit_compile` may wait for a long time // and worker may be stopped during the compilation. -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/