patch 9.1.0818: some global functions are only used in single files
Problem: some global functions are only used in single files
Solution: refactor code slightly and make some more functions static
(Yegappan Lakshmanan)
closes: #15951
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/misc1.c b/src/misc1.c
index 0898efb..90cf914 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -953,6 +953,17 @@
return n;
}
+// For overflow detection, add a digit safely to an int value.
+ static int
+vim_append_digit_int(int *value, int digit)
+{
+ int x = *value;
+ if (x > ((INT_MAX - digit) / 10))
+ return FAIL;
+ *value = x * 10 + digit;
+ return OK;
+}
+
/*
* Get a number from the user.
* When "mouse_used" is not NULL allow using the mouse.
@@ -2824,17 +2835,6 @@
#endif
}
-// For overflow detection, add a digit safely to an int value.
- int
-vim_append_digit_int(int *value, int digit)
-{
- int x = *value;
- if (x > ((INT_MAX - digit) / 10))
- return FAIL;
- *value = x * 10 + digit;
- return OK;
-}
-
// For overflow detection, add a digit safely to a long value.
int
vim_append_digit_long(long *value, int digit)