diff options
Diffstat (limited to 'src/nvim/lua/xdiff.c')
-rw-r--r-- | src/nvim/lua/xdiff.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/nvim/lua/xdiff.c b/src/nvim/lua/xdiff.c index dc2675a1fe..7eda9b6270 100644 --- a/src/nvim/lua/xdiff.c +++ b/src/nvim/lua/xdiff.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include <errno.h> #include <lauxlib.h> #include <lua.h> @@ -50,8 +53,8 @@ static int write_string(void *priv, mmbuffer_t *mb, int nbuf) static int hunk_locations_cb(long start_a, long count_a, long start_b, long count_b, void *cb_data) { // Mimic extra offsets done by xdiff, see: - // src/nvim/xdiff/xemit.c:284 - // src/nvim/xdiff/xutils.c:(356,368) + // src/xdiff/xemit.c:284 + // src/xdiff/xutils.c:(356,368) if (count_a > 0) { start_a += 1; } @@ -59,7 +62,7 @@ static int hunk_locations_cb(long start_a, long count_a, long start_b, long coun start_b += 1; } - lua_State * lstate = (lua_State *)cb_data; + lua_State *lstate = (lua_State *)cb_data; lua_createtable(lstate, 0, 0); lua_pushinteger(lstate, start_a); @@ -80,8 +83,8 @@ static int hunk_locations_cb(long start_a, long count_a, long start_b, long coun static int call_on_hunk_cb(long start_a, long count_a, long start_b, long count_b, void *cb_data) { // Mimic extra offsets done by xdiff, see: - // src/nvim/xdiff/xemit.c:284 - // src/nvim/xdiff/xutils.c:(356,368) + // src/xdiff/xemit.c:284 + // src/xdiff/xutils.c:(356,368) if (count_a > 0) { start_a += 1; } @@ -90,7 +93,7 @@ static int call_on_hunk_cb(long start_a, long count_a, long start_b, long count_ } hunkpriv_t *priv = (hunkpriv_t *)cb_data; - lua_State * lstate = priv->lstate; + lua_State *lstate = priv->lstate; Error *err = priv->err; const int fidx = lua_gettop(lstate); lua_pushvalue(lstate, fidx); @@ -130,7 +133,7 @@ static mmfile_t get_string_arg(lua_State *lstate, int idx) static bool check_xdiff_opt(ObjectType actType, ObjectType expType, const char *name, Error *err) { if (actType != expType) { - const char * type_str = + const char *type_str = expType == kObjectTypeString ? "string" : expType == kObjectTypeInteger ? "integer" : expType == kObjectTypeBoolean ? "boolean" : @@ -262,8 +265,8 @@ int nlua_xdl_diff(lua_State *lstate) Error err = ERROR_INIT; xdemitconf_t cfg; - xpparam_t params; - xdemitcb_t ecb; + xpparam_t params; + xdemitcb_t ecb; memset(&cfg, 0, sizeof(cfg)); memset(¶ms, 0, sizeof(params)); |