aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/charset.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/charset.c')
-rw-r--r--src/nvim/charset.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/nvim/charset.c b/src/nvim/charset.c
index b3d0949722..86d6acc60b 100644
--- a/src/nvim/charset.c
+++ b/src/nvim/charset.c
@@ -791,15 +791,17 @@ int linetabsize_col(int startcol, char_u *s)
/// @param len
///
/// @return Number of characters the string will take on the screen.
-int win_linetabsize(win_T *wp, char_u *line, colnr_T len)
+unsigned int win_linetabsize(win_T *wp, char_u *line, colnr_T len)
{
colnr_T col = 0;
- char_u *s;
- for (s = line; *s != NUL && (len == MAXCOL || s < line + len); mb_ptr_adv(s)) {
+ for (char_u *s = line;
+ *s != NUL && (len == MAXCOL || s < line + len);
+ mb_ptr_adv(s)) {
col += win_lbr_chartabsize(wp, line, s, col, NULL);
}
- return (int)col;
+
+ return (unsigned int)col;
}
/// Return TRUE if 'c' is a normal identifier character:
@@ -1695,7 +1697,9 @@ intmax_t getdigits(char_u **pp)
int getdigits_int(char_u **pp)
{
intmax_t number = getdigits(pp);
+#if SIZEOF_INTMAX_T > SIZEOF_INT
assert(number >= INT_MIN && number <= INT_MAX);
+#endif
return (int)number;
}
@@ -1705,7 +1709,9 @@ int getdigits_int(char_u **pp)
long getdigits_long(char_u **pp)
{
intmax_t number = getdigits(pp);
+#if SIZEOF_INTMAX_T > SIZEOF_LONG
assert(number >= LONG_MIN && number <= LONG_MAX);
+#endif
return (long)number;
}