aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xclint.py2
-rw-r--r--src/nvim/CMakeLists.txt1
-rw-r--r--src/nvim/indent.c12
3 files changed, 9 insertions, 6 deletions
diff --git a/clint.py b/clint.py
index 5e0e5a1e2b..290abd2820 100755
--- a/clint.py
+++ b/clint.py
@@ -2776,7 +2776,7 @@ def CheckLanguage(filename, clean_lines, linenum, file_extension,
# TODO(unknown): figure out if they're using default arguments in fn proto.
# Check if people are using the verboten C basic types.
- match = Search(r'\b(short|long(?! +double)|long long)\b', line)
+ match = Search(r'\b(short|long long)\b', line)
if match:
error(filename, linenum, 'runtime/int', 4,
'Use int16_t/int64_t/etc, rather than the C type %s'
diff --git a/src/nvim/CMakeLists.txt b/src/nvim/CMakeLists.txt
index 795997c052..127dd7cfb7 100644
--- a/src/nvim/CMakeLists.txt
+++ b/src/nvim/CMakeLists.txt
@@ -63,7 +63,6 @@ set(CONV_SOURCES
fold.c
getchar.c
if_cscope.c
- indent.c
keymap.c
mbyte.c
memline.c
diff --git a/src/nvim/indent.c b/src/nvim/indent.c
index 075acc6c13..5711207933 100644
--- a/src/nvim/indent.c
+++ b/src/nvim/indent.c
@@ -1,3 +1,4 @@
+#include <assert.h>
#include <inttypes.h>
#include <stdbool.h>
@@ -198,7 +199,8 @@ int set_indent(int size, int flags)
// characters and allocate accordingly. We will fill the rest with spaces
// after the if (!curbuf->b_p_et) below.
if (orig_char_len != -1) {
- newline = xmalloc(orig_char_len + size - ind_done + line_len);
+ assert(orig_char_len + size - ind_done + line_len >= 0);
+ newline = xmalloc((size_t)(orig_char_len + size - ind_done + line_len));
todo = size - ind_done;
// Set total length of indent in characters, which may have been
@@ -219,7 +221,8 @@ int set_indent(int size, int flags)
}
} else {
todo = size;
- newline = xmalloc(ind_len + line_len);
+ assert(ind_len + line_len >= 0);
+ newline = xmalloc((size_t)(ind_len + line_len));
s = newline;
}
@@ -384,7 +387,8 @@ int copy_indent(int size, char_u *src)
// Allocate memory for the result: the copied indent, new indent
// and the rest of the line.
line_len = (int)STRLEN(get_cursor_line_ptr()) + 1;
- line = xmalloc(ind_len + line_len);
+ assert(ind_len + line_len >= 0);
+ line = xmalloc((size_t)(ind_len + line_len));
p = line;
}
}
@@ -449,7 +453,7 @@ int get_number_indent(linenr_T lnum)
*/
int get_breakindent_win(win_T *wp, char_u *line) {
static int prev_indent = 0; /* cached indent value */
- static int prev_ts = 0L; /* cached tabstop value */
+ static long prev_ts = 0; /* cached tabstop value */
static char_u *prev_line = NULL; /* cached pointer to line */
static int prev_tick = 0; // changedtick of cached value
int bri = 0;