From ffa5d7e611538acd4a056fee0cfd814033a55fa9 Mon Sep 17 00:00:00 2001 From: "K. Lange" Date: Thu, 9 Feb 2023 10:51:54 +0900 Subject: [PATCH] krk_long_compare can not fail, so not sure why we think we can fail krk_long_add from that --- src/obj_long.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/obj_long.c b/src/obj_long.c index d0149b6..b7b9222 100644 --- a/src/obj_long.c +++ b/src/obj_long.c @@ -397,12 +397,10 @@ static int krk_long_add(KrkLong * res, const KrkLong * a, const KrkLong * b) { krk_long_set_sign(res,-1); FINISH_OUTPUT(res); return 0; - case 0: - krk_long_clear(res); - FINISH_OUTPUT(res); - return 0; } - return 1; + krk_long_clear(res); + FINISH_OUTPUT(res); + return 0; } else if (a->width > 0 && b->width < 0) { switch (krk_long_compare_abs(a,b)) { case -1: @@ -415,13 +413,10 @@ static int krk_long_add(KrkLong * res, const KrkLong * a, const KrkLong * b) { krk_long_set_sign(res,1); FINISH_OUTPUT(res); return 0; - case 0: - krk_long_clear(res); - FINISH_OUTPUT(res); - return 0; } + krk_long_clear(res); FINISH_OUTPUT(res); - return 1; + return 0; } /* sign must match for this, so take it from whichever */