aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/diff.c
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-08-19 12:26:08 -0600
committerJosh Rahm <rahm@google.com>2022-08-19 13:06:41 -0600
commita7237662f96933efe29eed8212464571e3778cd0 (patch)
tree27930202726b4251437c8cfa53069f65b4db90dc /src/nvim/diff.c
parent02292344929069ea63c0bb872cc22d552d86b67f (diff)
parentb2f979b30beac67906b2dd717fcb6a34f46f5e54 (diff)
downloadrneovim-tmp.tar.gz
rneovim-tmp.tar.bz2
rneovim-tmp.zip
Merge branch 'master' of https://github.com/neovim/neovim into rahmtmp
Diffstat (limited to 'src/nvim/diff.c')
-rw-r--r--src/nvim/diff.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index 849204f789..c1fdbc1b9a 100644
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -14,11 +14,13 @@
#include <stdbool.h>
#include "nvim/ascii.h"
+#include "nvim/autocmd.h"
#include "nvim/buffer.h"
#include "nvim/change.h"
#include "nvim/charset.h"
#include "nvim/cursor.h"
#include "nvim/diff.h"
+#include "nvim/drawscreen.h"
#include "nvim/eval.h"
#include "nvim/ex_cmds.h"
#include "nvim/ex_docmd.h"
@@ -35,7 +37,6 @@
#include "nvim/os/os.h"
#include "nvim/os/shell.h"
#include "nvim/path.h"
-#include "nvim/screen.h"
#include "nvim/strings.h"
#include "nvim/ui.h"
#include "nvim/undo.h"
@@ -956,13 +957,13 @@ void ex_diffupdate(exarg_T *eap)
// Only use the internal method if it did not fail for one of the buffers.
diffio_T diffio;
- memset(&diffio, 0, sizeof(diffio));
+ CLEAR_FIELD(diffio);
diffio.dio_internal = diff_internal() && !diff_internal_failed();
diff_try_update(&diffio, idx_orig, eap);
if (diffio.dio_internal && diff_internal_failed()) {
// Internal diff failed, use external diff instead.
- memset(&diffio, 0, sizeof(diffio));
+ CLEAR_FIELD(diffio);
diff_try_update(&diffio, idx_orig, eap);
}
@@ -1075,9 +1076,9 @@ static int diff_file_internal(diffio_T *diffio)
xdemitconf_t emit_cfg;
xdemitcb_t emit_cb;
- memset(&param, 0, sizeof(param));
- memset(&emit_cfg, 0, sizeof(emit_cfg));
- memset(&emit_cb, 0, sizeof(emit_cb));
+ CLEAR_FIELD(param);
+ CLEAR_FIELD(emit_cfg);
+ CLEAR_FIELD(emit_cb);
param.flags = (unsigned long)diff_algorithm;
@@ -2143,14 +2144,14 @@ int diffopt_changed(void)
long diff_algorithm_new = 0;
long diff_indent_heuristic = 0;
- char_u *p = p_dip;
+ char *p = (char *)p_dip;
while (*p != NUL) {
if (STRNCMP(p, "filler", 6) == 0) {
p += 6;
diff_flags_new |= DIFF_FILLER;
} else if ((STRNCMP(p, "context:", 8) == 0) && ascii_isdigit(p[8])) {
p += 8;
- diff_context_new = getdigits_int((char **)&p, false, diff_context_new);
+ diff_context_new = getdigits_int(&p, false, diff_context_new);
} else if (STRNCMP(p, "iblank", 6) == 0) {
p += 6;
diff_flags_new |= DIFF_IBLANK;
@@ -2174,7 +2175,7 @@ int diffopt_changed(void)
diff_flags_new |= DIFF_VERTICAL;
} else if ((STRNCMP(p, "foldcolumn:", 11) == 0) && ascii_isdigit(p[11])) {
p += 11;
- diff_foldcolumn_new = getdigits_int((char **)&p, false, diff_foldcolumn_new);
+ diff_foldcolumn_new = getdigits_int(&p, false, diff_foldcolumn_new);
} else if (STRNCMP(p, "hiddenoff", 9) == 0) {
p += 9;
diff_flags_new |= DIFF_HIDDEN_OFF;