From 6a277ac5e6178fbd55874bc2cb6763ae9a8a1531 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 4 Aug 2022 21:46:03 -0500 Subject: [PATCH] Update: Change logic to avoid potential negative numbers. Avoid using a subtraction. Instead just use a comparison. This should be more performant and also avoids potential negative numbers when dealing with unsigned numbers. --- level_0/f_fss/c/fss/named.c | 4 ++-- level_0/f_fss/c/fss/nest.c | 12 ++++++------ level_0/f_iki/c/iki/data.c | 8 ++++---- level_0/f_limit/c/limit/set.c | 8 ++++---- level_0/f_limit/c/limit/value.c | 8 ++++---- level_0/f_string/c/string/dynamic.c | 12 ++++++------ level_0/f_string/c/string/map.c | 8 ++++---- level_0/f_string/c/string/map_multi.c | 8 ++++---- level_0/f_string/c/string/quantity.c | 8 ++++---- level_0/f_string/c/string/range.c | 8 ++++---- level_0/f_string/c/string/triple.c | 8 ++++---- level_0/f_thread/c/thread/attribute.c | 4 ++-- level_0/f_thread/c/thread/barrier.c | 4 ++-- level_0/f_thread/c/thread/barrier_attribute.c | 4 ++-- level_0/f_thread/c/thread/condition.c | 4 ++-- level_0/f_thread/c/thread/condition_attribute.c | 4 ++-- level_0/f_thread/c/thread/id.c | 4 ++-- level_0/f_thread/c/thread/key.c | 4 ++-- level_0/f_thread/c/thread/lock.c | 4 ++-- level_0/f_thread/c/thread/lock_attribute.c | 4 ++-- level_0/f_thread/c/thread/mutex.c | 4 ++-- level_0/f_thread/c/thread/mutex_attribute.c | 4 ++-- level_0/f_thread/c/thread/once.c | 4 ++-- level_0/f_thread/c/thread/semaphore.c | 4 ++-- level_0/f_thread/c/thread/set.c | 4 ++-- level_0/f_thread/c/thread/spin.c | 4 ++-- level_0/f_utf/c/utf/dynamic.c | 12 ++++++------ level_0/f_utf/c/utf/map.c | 8 ++++---- level_0/f_utf/c/utf/map_multi.c | 8 ++++---- level_0/f_utf/c/utf/triple.c | 8 ++++---- 30 files changed, 94 insertions(+), 94 deletions(-) diff --git a/level_0/f_fss/c/fss/named.c b/level_0/f_fss/c/fss/named.c index c49ed4e..27dd66d 100644 --- a/level_0/f_fss/c/fss/named.c +++ b/level_0/f_fss/c/fss/named.c @@ -119,7 +119,7 @@ extern "C" { if (!amount) return F_data_not; - if (nameds->size - amount > 0) { + if (nameds->size > amount) { return private_f_fss_nameds_adjust(nameds->size - amount, nameds); } @@ -135,7 +135,7 @@ extern "C" { if (!amount) return F_data_not; - if (nameds->size - amount > 0) { + if (nameds->size > amount) { return private_f_fss_nameds_resize(nameds->size - amount, nameds); } diff --git a/level_0/f_fss/c/fss/nest.c b/level_0/f_fss/c/fss/nest.c index 34a0d65..887f3b3 100644 --- a/level_0/f_fss/c/fss/nest.c +++ b/level_0/f_fss/c/fss/nest.c @@ -23,7 +23,7 @@ extern "C" { if (!amount) return F_data_not; - if (items->size - amount > 0) { + if (items->size > amount) { return private_f_fss_items_adjust(items->size - amount, items); } @@ -39,7 +39,7 @@ extern "C" { if (!amount) return F_data_not; - if (items->size - amount > 0) { + if (items->size > amount) { return private_f_fss_items_resize(items->size - amount, items); } @@ -119,7 +119,7 @@ extern "C" { if (!amount) return F_data_not; - if (nest->size - amount > 0) { + if (nest->size > amount) { return private_f_fss_nest_adjust(nest->size - amount, nest); } @@ -135,7 +135,7 @@ extern "C" { if (!amount) return F_data_not; - if (nest->size - amount > 0) { + if (nest->size > amount) { return private_f_fss_nest_resize(nest->size - amount, nest); } @@ -215,7 +215,7 @@ extern "C" { if (!amount) return F_data_not; - if (nests->size - amount > 0) { + if (nests->size > amount) { return private_f_fss_nests_adjust(nests->size - amount, nests); } @@ -231,7 +231,7 @@ extern "C" { if (!amount) return F_data_not; - if (nests->size - amount > 0) { + if (nests->size > amount) { return private_f_fss_nests_resize(nests->size - amount, nests); } diff --git a/level_0/f_iki/c/iki/data.c b/level_0/f_iki/c/iki/data.c index 1a7d68f..babfa87 100644 --- a/level_0/f_iki/c/iki/data.c +++ b/level_0/f_iki/c/iki/data.c @@ -90,7 +90,7 @@ extern "C" { if (!amount) return F_data_not; - if (datas->size - amount > 0) { + if (datas->size > amount) { return private_f_iki_datas_adjust(datas->size - amount, datas); } @@ -106,7 +106,7 @@ extern "C" { if (!amount) return F_data_not; - if (datas->size - amount > 0) { + if (datas->size > amount) { return private_f_iki_datas_resize(datas->size - amount, datas); } @@ -239,7 +239,7 @@ extern "C" { if (!amount) return F_data_not; - if (datass->size - amount > 0) { + if (datass->size > amount) { return private_f_iki_datass_adjust(datass->size - amount, datass); } @@ -255,7 +255,7 @@ extern "C" { if (!amount) return F_data_not; - if (datass->size - amount > 0) { + if (datass->size > amount) { return private_f_iki_datass_resize(datass->size - amount, datass); } diff --git a/level_0/f_limit/c/limit/set.c b/level_0/f_limit/c/limit/set.c index 130bb13..411273b 100644 --- a/level_0/f_limit/c/limit/set.c +++ b/level_0/f_limit/c/limit/set.c @@ -46,7 +46,7 @@ extern "C" { if (!amount) return F_data_not; - if (sets->size - amount > 0) { + if (sets->size > amount) { return private_f_limit_sets_adjust(sets->size - amount, sets); } @@ -62,7 +62,7 @@ extern "C" { if (!amount) return F_data_not; - if (sets->size - amount > 0) { + if (sets->size > amount) { return private_f_limit_sets_resize(sets->size - amount, sets); } @@ -195,7 +195,7 @@ extern "C" { if (!amount) return F_data_not; - if (setss->size - amount > 0) { + if (setss->size > amount) { return private_f_limit_setss_adjust(setss->size - amount, setss); } @@ -211,7 +211,7 @@ extern "C" { if (!amount) return F_data_not; - if (setss->size - amount > 0) { + if (setss->size > amount) { return private_f_limit_setss_resize(setss->size - amount, setss); } diff --git a/level_0/f_limit/c/limit/value.c b/level_0/f_limit/c/limit/value.c index 9cdde81..c8b0f49 100644 --- a/level_0/f_limit/c/limit/value.c +++ b/level_0/f_limit/c/limit/value.c @@ -46,7 +46,7 @@ extern "C" { if (!amount) return F_data_not; - if (values->size - amount > 0) { + if (values->size > amount) { return private_f_limit_values_adjust(values->size - amount, values); } @@ -62,7 +62,7 @@ extern "C" { if (!amount) return F_data_not; - if (values->size - amount > 0) { + if (values->size > amount) { return private_f_limit_values_resize(values->size - amount, values); } @@ -195,7 +195,7 @@ extern "C" { if (!amount) return F_data_not; - if (valuess->size - amount > 0) { + if (valuess->size > amount) { return private_f_limit_valuess_adjust(valuess->size - amount, valuess); } @@ -211,7 +211,7 @@ extern "C" { if (!amount) return F_data_not; - if (valuess->size - amount > 0) { + if (valuess->size > amount) { return private_f_limit_valuess_resize(valuess->size - amount, valuess); } diff --git a/level_0/f_string/c/string/dynamic.c b/level_0/f_string/c/string/dynamic.c index b22cf30..8cdd46d 100644 --- a/level_0/f_string/c/string/dynamic.c +++ b/level_0/f_string/c/string/dynamic.c @@ -118,7 +118,7 @@ extern "C" { if (!amount) return F_data_not; - if (dynamic->size - amount > 0) { + if (dynamic->size > amount) { return private_f_string_dynamic_adjust(dynamic->size - amount, dynamic); } @@ -134,7 +134,7 @@ extern "C" { if (!amount) return F_data_not; - if (dynamic->size - amount > 0) { + if (dynamic->size > amount) { return private_f_string_dynamic_resize(dynamic->size - amount, dynamic); } @@ -827,7 +827,7 @@ extern "C" { if (!amount) return F_data_not; - if (dynamics->size - amount > 0) { + if (dynamics->size > amount) { return private_f_string_dynamics_adjust(dynamics->size - amount, dynamics); } @@ -843,7 +843,7 @@ extern "C" { if (!amount) return F_data_not; - if (dynamics->size - amount > 0) { + if (dynamics->size > amount) { return private_f_string_dynamics_resize(dynamics->size - amount, dynamics); } @@ -980,7 +980,7 @@ extern "C" { if (!amount) return F_data_not; - if (dynamicss->size - amount > 0) { + if (dynamicss->size > amount) { return private_f_string_dynamicss_adjust(dynamicss->size - amount, dynamicss); } @@ -996,7 +996,7 @@ extern "C" { if (!amount) return F_data_not; - if (dynamicss->size - amount > 0) { + if (dynamicss->size > amount) { return private_f_string_dynamicss_resize(dynamicss->size - amount, dynamicss); } diff --git a/level_0/f_string/c/string/map.c b/level_0/f_string/c/string/map.c index a3ea797..13c89f0 100644 --- a/level_0/f_string/c/string/map.c +++ b/level_0/f_string/c/string/map.c @@ -68,7 +68,7 @@ extern "C" { if (!amount) return F_data_not; - if (maps->size - amount > 0) { + if (maps->size > amount) { return private_f_string_maps_adjust(maps->size - amount, maps); } @@ -84,7 +84,7 @@ extern "C" { if (!amount) return F_data_not; - if (maps->size - amount > 0) { + if (maps->size > amount) { return private_f_string_maps_resize(maps->size - amount, maps); } @@ -221,7 +221,7 @@ extern "C" { if (!amount) return F_data_not; - if (mapss->size - amount > 0) { + if (mapss->size > amount) { return private_f_string_mapss_adjust(mapss->size - amount, mapss); } @@ -237,7 +237,7 @@ extern "C" { if (!amount) return F_data_not; - if (mapss->size - amount > 0) { + if (mapss->size > amount) { return private_f_string_mapss_resize(mapss->size - amount, mapss); } diff --git a/level_0/f_string/c/string/map_multi.c b/level_0/f_string/c/string/map_multi.c index 27faa0c..67d7de5 100644 --- a/level_0/f_string/c/string/map_multi.c +++ b/level_0/f_string/c/string/map_multi.c @@ -69,7 +69,7 @@ extern "C" { if (!amount) return F_data_not; - if (map_multis->size - amount > 0) { + if (map_multis->size > amount) { return private_f_string_map_multis_adjust(map_multis->size - amount, map_multis); } @@ -85,7 +85,7 @@ extern "C" { if (!amount) return F_data_not; - if (map_multis->size - amount > 0) { + if (map_multis->size > amount) { return private_f_string_map_multis_resize(map_multis->size - amount, map_multis); } @@ -222,7 +222,7 @@ extern "C" { if (!amount) return F_data_not; - if (map_multiss->size - amount > 0) { + if (map_multiss->size > amount) { return private_f_string_map_multiss_adjust(map_multiss->size - amount, map_multiss); } @@ -238,7 +238,7 @@ extern "C" { if (!amount) return F_data_not; - if (map_multiss->size - amount > 0) { + if (map_multiss->size > amount) { return private_f_string_map_multiss_resize(map_multiss->size - amount, map_multiss); } diff --git a/level_0/f_string/c/string/quantity.c b/level_0/f_string/c/string/quantity.c index 7a6c12d..5f94672 100644 --- a/level_0/f_string/c/string/quantity.c +++ b/level_0/f_string/c/string/quantity.c @@ -54,7 +54,7 @@ extern "C" { if (!amount) return F_data_not; - if (quantitys->size - amount > 0) { + if (quantitys->size > amount) { return private_f_string_quantitys_adjust(quantitys->size - amount, quantitys); } @@ -70,7 +70,7 @@ extern "C" { if (!amount) return F_data_not; - if (quantitys->size - amount > 0) { + if (quantitys->size > amount) { return private_f_string_quantitys_resize(quantitys->size - amount, quantitys); } @@ -207,7 +207,7 @@ extern "C" { if (!amount) return F_data_not; - if (quantityss->size - amount > 0) { + if (quantityss->size > amount) { return private_f_string_quantityss_adjust(quantityss->size - amount, quantityss); } @@ -223,7 +223,7 @@ extern "C" { if (!amount) return F_data_not; - if (quantityss->size - amount > 0) { + if (quantityss->size > amount) { return private_f_string_quantityss_resize(quantityss->size - amount, quantityss); } diff --git a/level_0/f_string/c/string/range.c b/level_0/f_string/c/string/range.c index b1caca5..688d66b 100644 --- a/level_0/f_string/c/string/range.c +++ b/level_0/f_string/c/string/range.c @@ -65,7 +65,7 @@ extern "C" { if (!amount) return F_data_not; - if (ranges->size - amount > 0) { + if (ranges->size > amount) { return private_f_string_ranges_adjust(ranges->size - amount, ranges); } @@ -81,7 +81,7 @@ extern "C" { if (!amount) return F_data_not; - if (ranges->size - amount > 0) { + if (ranges->size > amount) { return private_f_string_ranges_resize(ranges->size - amount, ranges); } @@ -218,7 +218,7 @@ extern "C" { if (!amount) return F_data_not; - if (rangess->size - amount > 0) { + if (rangess->size > amount) { return private_f_string_rangess_adjust(rangess->size - amount, rangess); } @@ -234,7 +234,7 @@ extern "C" { if (!amount) return F_data_not; - if (rangess->size - amount > 0) { + if (rangess->size > amount) { return private_f_string_rangess_resize(rangess->size - amount, rangess); } diff --git a/level_0/f_string/c/string/triple.c b/level_0/f_string/c/string/triple.c index 76aba19..fe1d9f9 100644 --- a/level_0/f_string/c/string/triple.c +++ b/level_0/f_string/c/string/triple.c @@ -101,7 +101,7 @@ extern "C" { if (!triples) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (triples->size - amount > 0) { + if (triples->size > amount) { return private_f_string_triples_adjust(triples->size - amount, triples); } @@ -117,7 +117,7 @@ extern "C" { if (!amount) return F_data_not; - if (triples->size - amount > 0) { + if (triples->size > amount) { return private_f_string_triples_resize(triples->size - amount, triples); } @@ -254,7 +254,7 @@ extern "C" { if (!amount) return F_data_not; - if (tripless->size - amount > 0) { + if (tripless->size > amount) { return private_f_string_tripless_adjust(tripless->size - amount, tripless); } @@ -270,7 +270,7 @@ extern "C" { if (!amount) return F_data_not; - if (tripless->size - amount > 0) { + if (tripless->size > amount) { return private_f_string_tripless_resize(tripless->size - amount, tripless); } diff --git a/level_0/f_thread/c/thread/attribute.c b/level_0/f_thread/c/thread/attribute.c index 837929b..f248e04 100644 --- a/level_0/f_thread/c/thread/attribute.c +++ b/level_0/f_thread/c/thread/attribute.c @@ -24,7 +24,7 @@ extern "C" { if (!amount) return F_data_not; - if (attributes->size - amount > 0) { + if (attributes->size > amount) { return private_f_thread_attributes_adjust(attributes->size - amount, attributes); } @@ -40,7 +40,7 @@ extern "C" { if (!amount) return F_data_not; - if (attributes->size - amount > 0) { + if (attributes->size > amount) { return private_f_thread_attributes_resize(attributes->size - amount, attributes); } diff --git a/level_0/f_thread/c/thread/barrier.c b/level_0/f_thread/c/thread/barrier.c index d741bbb..c31fe1a 100644 --- a/level_0/f_thread/c/thread/barrier.c +++ b/level_0/f_thread/c/thread/barrier.c @@ -24,7 +24,7 @@ extern "C" { if (!amount) return F_data_not; - if (barriers->size - amount > 0) { + if (barriers->size > amount) { return private_f_thread_barriers_adjust(barriers->size - amount, barriers); } @@ -40,7 +40,7 @@ extern "C" { if (!amount) return F_data_not; - if (barriers->size - amount > 0) { + if (barriers->size > amount) { return private_f_thread_barriers_resize(barriers->size - amount, barriers); } diff --git a/level_0/f_thread/c/thread/barrier_attribute.c b/level_0/f_thread/c/thread/barrier_attribute.c index 5ecebb6..afa4c70 100644 --- a/level_0/f_thread/c/thread/barrier_attribute.c +++ b/level_0/f_thread/c/thread/barrier_attribute.c @@ -24,7 +24,7 @@ extern "C" { if (!amount) return F_data_not; - if (attributes->size - amount > 0) { + if (attributes->size > amount) { return private_f_thread_barrier_attributes_adjust(attributes->size - amount, attributes); } @@ -40,7 +40,7 @@ extern "C" { if (!amount) return F_data_not; - if (attributes->size - amount > 0) { + if (attributes->size > amount) { return private_f_thread_barrier_attributes_resize(attributes->size - amount, attributes); } diff --git a/level_0/f_thread/c/thread/condition.c b/level_0/f_thread/c/thread/condition.c index 9c3631f..a7363ae 100644 --- a/level_0/f_thread/c/thread/condition.c +++ b/level_0/f_thread/c/thread/condition.c @@ -24,7 +24,7 @@ extern "C" { if (!amount) return F_data_not; - if (conditions->size - amount > 0) { + if (conditions->size > amount) { return private_f_thread_conditions_adjust(conditions->size - amount, conditions); } @@ -40,7 +40,7 @@ extern "C" { if (!amount) return F_data_not; - if (conditions->size - amount > 0) { + if (conditions->size > amount) { return private_f_thread_conditions_resize(conditions->size - amount, conditions); } diff --git a/level_0/f_thread/c/thread/condition_attribute.c b/level_0/f_thread/c/thread/condition_attribute.c index da8409b..3b2c412 100644 --- a/level_0/f_thread/c/thread/condition_attribute.c +++ b/level_0/f_thread/c/thread/condition_attribute.c @@ -24,7 +24,7 @@ extern "C" { if (!amount) return F_data_not; - if (attributes->size - amount > 0) { + if (attributes->size > amount) { return private_f_thread_condition_attributes_adjust(attributes->size - amount, attributes); } @@ -40,7 +40,7 @@ extern "C" { if (!amount) return F_data_not; - if (attributes->size - amount > 0) { + if (attributes->size > amount) { return private_f_thread_condition_attributes_resize(attributes->size - amount, attributes); } diff --git a/level_0/f_thread/c/thread/id.c b/level_0/f_thread/c/thread/id.c index a9442ee..1267342 100644 --- a/level_0/f_thread/c/thread/id.c +++ b/level_0/f_thread/c/thread/id.c @@ -24,7 +24,7 @@ extern "C" { if (!amount) return F_data_not; - if (ids->size - amount > 0) { + if (ids->size > amount) { return private_f_thread_ids_adjust(ids->size - amount, ids); } @@ -40,7 +40,7 @@ extern "C" { if (!amount) return F_data_not; - if (ids->size - amount > 0) { + if (ids->size > amount) { return private_f_thread_ids_resize(ids->size - amount, ids); } diff --git a/level_0/f_thread/c/thread/key.c b/level_0/f_thread/c/thread/key.c index de8134a..45d27b8 100644 --- a/level_0/f_thread/c/thread/key.c +++ b/level_0/f_thread/c/thread/key.c @@ -24,7 +24,7 @@ extern "C" { if (!amount) return F_data_not; - if (keys->size - amount > 0) { + if (keys->size > amount) { return private_f_thread_keys_adjust(keys->size - amount, keys); } @@ -40,7 +40,7 @@ extern "C" { if (!amount) return F_data_not; - if (keys->size - amount > 0) { + if (keys->size > amount) { return private_f_thread_keys_resize(keys->size - amount, keys); } diff --git a/level_0/f_thread/c/thread/lock.c b/level_0/f_thread/c/thread/lock.c index 425a2ab..ecc28bc 100644 --- a/level_0/f_thread/c/thread/lock.c +++ b/level_0/f_thread/c/thread/lock.c @@ -24,7 +24,7 @@ extern "C" { if (!amount) return F_data_not; - if (locks->size - amount > 0) { + if (locks->size > amount) { return private_f_thread_locks_adjust(locks->size - amount, locks); } @@ -40,7 +40,7 @@ extern "C" { if (!amount) return F_data_not; - if (locks->size - amount > 0) { + if (locks->size > amount) { return private_f_thread_locks_resize(locks->size - amount, locks); } diff --git a/level_0/f_thread/c/thread/lock_attribute.c b/level_0/f_thread/c/thread/lock_attribute.c index 8c15452..3794481 100644 --- a/level_0/f_thread/c/thread/lock_attribute.c +++ b/level_0/f_thread/c/thread/lock_attribute.c @@ -24,7 +24,7 @@ extern "C" { if (!amount) return F_data_not; - if (attributes->size - amount > 0) { + if (attributes->size > amount) { return private_f_thread_lock_attributes_adjust(attributes->size - amount, attributes); } @@ -40,7 +40,7 @@ extern "C" { if (!amount) return F_data_not; - if (attributes->size - amount > 0) { + if (attributes->size > amount) { return private_f_thread_lock_attributes_resize(attributes->size - amount, attributes); } diff --git a/level_0/f_thread/c/thread/mutex.c b/level_0/f_thread/c/thread/mutex.c index 8d19bce..e2478cb 100644 --- a/level_0/f_thread/c/thread/mutex.c +++ b/level_0/f_thread/c/thread/mutex.c @@ -24,7 +24,7 @@ extern "C" { if (!amount) return F_data_not; - if (mutexs->size - amount > 0) { + if (mutexs->size > amount) { return private_f_thread_mutexs_adjust(mutexs->size - amount, mutexs); } @@ -40,7 +40,7 @@ extern "C" { if (!amount) return F_data_not; - if (mutexs->size - amount > 0) { + if (mutexs->size > amount) { return private_f_thread_mutexs_resize(mutexs->size - amount, mutexs); } diff --git a/level_0/f_thread/c/thread/mutex_attribute.c b/level_0/f_thread/c/thread/mutex_attribute.c index 0ec9cc1..fa7b609 100644 --- a/level_0/f_thread/c/thread/mutex_attribute.c +++ b/level_0/f_thread/c/thread/mutex_attribute.c @@ -24,7 +24,7 @@ extern "C" { if (!amount) return F_data_not; - if (attributes->size - amount > 0) { + if (attributes->size > amount) { return private_f_thread_mutex_attributes_adjust(attributes->size - amount, attributes); } @@ -40,7 +40,7 @@ extern "C" { if (!amount) return F_data_not; - if (attributes->size - amount > 0) { + if (attributes->size > amount) { return private_f_thread_mutex_attributes_resize(attributes->size - amount, attributes); } diff --git a/level_0/f_thread/c/thread/once.c b/level_0/f_thread/c/thread/once.c index 5a63091..28a5a45 100644 --- a/level_0/f_thread/c/thread/once.c +++ b/level_0/f_thread/c/thread/once.c @@ -24,7 +24,7 @@ extern "C" { if (!amount) return F_data_not; - if (onces->size - amount > 0) { + if (onces->size > amount) { return private_f_thread_onces_adjust(onces->size - amount, onces); } @@ -40,7 +40,7 @@ extern "C" { if (!amount) return F_data_not; - if (onces->size - amount > 0) { + if (onces->size > amount) { return private_f_thread_onces_resize(onces->size - amount, onces); } diff --git a/level_0/f_thread/c/thread/semaphore.c b/level_0/f_thread/c/thread/semaphore.c index 1f5907a..9aa9569 100644 --- a/level_0/f_thread/c/thread/semaphore.c +++ b/level_0/f_thread/c/thread/semaphore.c @@ -24,7 +24,7 @@ extern "C" { if (!amount) return F_data_not; - if (semaphores->size - amount > 0) { + if (semaphores->size > amount) { return private_f_thread_semaphores_adjust(semaphores->size - amount, semaphores); } @@ -40,7 +40,7 @@ extern "C" { if (!amount) return F_data_not; - if (semaphores->size - amount > 0) { + if (semaphores->size > amount) { return private_f_thread_semaphores_resize(semaphores->size - amount, semaphores); } diff --git a/level_0/f_thread/c/thread/set.c b/level_0/f_thread/c/thread/set.c index 59eaf2b..b0228c2 100644 --- a/level_0/f_thread/c/thread/set.c +++ b/level_0/f_thread/c/thread/set.c @@ -24,7 +24,7 @@ extern "C" { if (!amount) return F_data_not; - if (sets->size - amount > 0) { + if (sets->size > amount) { return private_f_thread_sets_adjust(sets->size - amount, sets); } @@ -40,7 +40,7 @@ extern "C" { if (!amount) return F_data_not; - if (sets->size - amount > 0) { + if (sets->size > amount) { return private_f_thread_sets_resize(sets->size - amount, sets); } diff --git a/level_0/f_thread/c/thread/spin.c b/level_0/f_thread/c/thread/spin.c index b2a6c40..da7a2b2 100644 --- a/level_0/f_thread/c/thread/spin.c +++ b/level_0/f_thread/c/thread/spin.c @@ -24,7 +24,7 @@ extern "C" { if (!amount) return F_data_not; - if (spins->size - amount > 0) { + if (spins->size > amount) { return private_f_thread_spins_adjust(spins->size - amount, spins); } @@ -40,7 +40,7 @@ extern "C" { if (!amount) return F_data_not; - if (spins->size - amount > 0) { + if (spins->size > amount) { return private_f_thread_spins_resize(spins->size - amount, spins); } diff --git a/level_0/f_utf/c/utf/dynamic.c b/level_0/f_utf/c/utf/dynamic.c index 76ef4f9..c8b485c 100644 --- a/level_0/f_utf/c/utf/dynamic.c +++ b/level_0/f_utf/c/utf/dynamic.c @@ -120,7 +120,7 @@ extern "C" { if (!amount) return F_data_not; - if (dynamic->size - amount > 0) { + if (dynamic->size > amount) { return private_f_utf_string_dynamic_adjust(dynamic->size - amount, dynamic); } @@ -136,7 +136,7 @@ extern "C" { if (!amount) return F_data_not; - if (dynamic->size - amount > 0) { + if (dynamic->size > amount) { return private_f_utf_string_dynamic_resize(dynamic->size - amount, dynamic); } @@ -841,7 +841,7 @@ extern "C" { if (!amount) return F_data_not; - if (dynamics->size - amount > 0) { + if (dynamics->size > amount) { return private_f_utf_string_dynamics_adjust(dynamics->size - amount, dynamics); } @@ -857,7 +857,7 @@ extern "C" { if (!amount) return F_data_not; - if (dynamics->size - amount > 0) { + if (dynamics->size > amount) { return private_f_utf_string_dynamics_resize(dynamics->size - amount, dynamics); } @@ -994,7 +994,7 @@ extern "C" { if (!amount) return F_data_not; - if (dynamicss->size - amount > 0) { + if (dynamicss->size > amount) { return private_f_utf_string_dynamicss_adjust(dynamicss->size - amount, dynamicss); } @@ -1010,7 +1010,7 @@ extern "C" { if (!amount) return F_data_not; - if (dynamicss->size - amount > 0) { + if (dynamicss->size > amount) { return private_f_utf_string_dynamicss_resize(dynamicss->size - amount, dynamicss); } diff --git a/level_0/f_utf/c/utf/map.c b/level_0/f_utf/c/utf/map.c index 93dfa6a..6a3133d 100644 --- a/level_0/f_utf/c/utf/map.c +++ b/level_0/f_utf/c/utf/map.c @@ -69,7 +69,7 @@ extern "C" { if (!amount) return F_data_not; - if (maps->size - amount > 0) { + if (maps->size > amount) { return private_f_utf_string_maps_adjust(maps->size - amount, maps); } @@ -85,7 +85,7 @@ extern "C" { if (!amount) return F_data_not; - if (maps->size - amount > 0) { + if (maps->size > amount) { return private_f_utf_string_maps_resize(maps->size - amount, maps); } @@ -222,7 +222,7 @@ extern "C" { if (!amount) return F_data_not; - if (mapss->size - amount > 0) { + if (mapss->size > amount) { return private_f_utf_string_mapss_adjust(mapss->size - amount, mapss); } @@ -238,7 +238,7 @@ extern "C" { if (!amount) return F_data_not; - if (mapss->size - amount > 0) { + if (mapss->size > amount) { return private_f_utf_string_mapss_resize(mapss->size - amount, mapss); } diff --git a/level_0/f_utf/c/utf/map_multi.c b/level_0/f_utf/c/utf/map_multi.c index 6d5464c..03b2492 100644 --- a/level_0/f_utf/c/utf/map_multi.c +++ b/level_0/f_utf/c/utf/map_multi.c @@ -69,7 +69,7 @@ extern "C" { if (!amount) return F_data_not; - if (map_multis->size - amount > 0) { + if (map_multis->size > amount) { return private_f_utf_string_map_multis_adjust(map_multis->size - amount, map_multis); } @@ -85,7 +85,7 @@ extern "C" { if (!amount) return F_data_not; - if (map_multis->size - amount > 0) { + if (map_multis->size > amount) { return private_f_utf_string_map_multis_resize(map_multis->size - amount, map_multis); } @@ -222,7 +222,7 @@ extern "C" { if (!amount) return F_data_not; - if (map_multiss->size - amount > 0) { + if (map_multiss->size > amount) { return private_f_utf_string_map_multiss_adjust(map_multiss->size - amount, map_multiss); } @@ -238,7 +238,7 @@ extern "C" { if (!amount) return F_data_not; - if (map_multiss->size - amount > 0) { + if (map_multiss->size > amount) { return private_f_utf_string_map_multiss_resize(map_multiss->size - amount, map_multiss); } diff --git a/level_0/f_utf/c/utf/triple.c b/level_0/f_utf/c/utf/triple.c index 864f9db..0ba195d 100644 --- a/level_0/f_utf/c/utf/triple.c +++ b/level_0/f_utf/c/utf/triple.c @@ -102,7 +102,7 @@ extern "C" { if (!triples) return F_status_set_error(F_parameter); #endif // _di_level_0_parameter_checking_ - if (triples->size - amount > 0) { + if (triples->size > amount) { return private_f_utf_string_triples_adjust(triples->size - amount, triples); } @@ -118,7 +118,7 @@ extern "C" { if (!amount) return F_data_not; - if (triples->size - amount > 0) { + if (triples->size > amount) { return private_f_utf_string_triples_resize(triples->size - amount, triples); } @@ -255,7 +255,7 @@ extern "C" { if (!amount) return F_data_not; - if (tripless->size - amount > 0) { + if (tripless->size > amount) { return private_f_utf_string_tripless_adjust(tripless->size - amount, tripless); } @@ -271,7 +271,7 @@ extern "C" { if (!amount) return F_data_not; - if (tripless->size - amount > 0) { + if (tripless->size > amount) { return private_f_utf_string_tripless_resize(tripless->size - amount, tripless); } -- 1.8.3.1