diff src/proto/misc1.pro @ 33791:370543108ba1 v9.0.2114

patch 9.0.2114: overflow detection not accurate when adding digits Commit: https://github.com/vim/vim/commit/22cbc8a4e17ce61aa460c451a26e1bff2c3d2af9 Author: Christian Brabandt <cb@256bit.org> Date: Sun Nov 19 10:47:21 2023 +0100 patch 9.0.2114: overflow detection not accurate when adding digits Problem: overflow detection not accurate when adding digits Solution: Use a helper function Use a helper function to better detect overflows before adding integer digits to a long or an integer variable respectively. Signal the overflow to the caller function. closes: #13539 Signed-off-by: Christian Brabandt <cb@256bit.org> Signed-off-by: Michael Henry <vim@drmikehenry.com> Signed-off-by: Ernie Rael <errael@raelity.com>
author Christian Brabandt <cb@256bit.org>
date Sun, 19 Nov 2023 11:00:07 +0100
parents 0503955dcd34
children 4550abd680b6
line wrap: on
line diff
--- a/src/proto/misc1.pro
+++ b/src/proto/misc1.pro
@@ -53,4 +53,6 @@ int path_with_url(char_u *fname);
 dict_T *get_v_event(save_v_event_T *sve);
 void restore_v_event(dict_T *v_event, save_v_event_T *sve);
 void may_trigger_modechanged(void);
+int vim_append_digit_int(int *value, int digit);
+int vim_append_digit_long(long *value, int digit);
 /* vim: set ft=c : */