Skip to content

Instantly share code, notes, and snippets.

@kylo252
Created September 15, 2021 14:29
Show Gist options
  • Save kylo252/d8dc2fa7e000558d5a578c2b69dac4ec to your computer and use it in GitHub Desktop.
Save kylo252/d8dc2fa7e000558d5a578c2b69dac4ec to your computer and use it in GitHub Desktop.
clint-errors parser for neovim core

Error parser for the legacy errors list generated by clint.py in Neovim core.

You can also grep for non-style errors using the following:

curl -LSs https://raw.githubusercontent.com/neovim/doc/gh-pages/reports/clint/errors.json \
  | grep -v 'readability' | grep -v 'whitespace' > errors.json
#!/usr/bin/env lua
local uv = vim.loop
local function write_file_sync(path, data)
local fd = assert(uv.fs_open(path, "w", 438))
assert(uv.fs_write(fd, data))
assert(uv.fs_close(fd))
end
local function parse(input_file)
local formatted_list = {}
for line in io.lines(input_file) do
local entry = vim.fn.json_decode(line)
local file = entry[1]
formatted_list[file] = formatted_list[file] or {}
local entry_fmt = { message = entry[2], category = entry[3] }
table.insert(formatted_list[file], entry_fmt)
end
return formatted_list
end
local input = "errors.json"
local errors_list = parse(input)
local json_string = vim.fn.json_encode(errors_list)
local outfile = "fmt_" .. input
write_file_sync(outfile, json_string)
print("outfile: ", outfile)
{
"src/nvim/eval.c": [
{
"message": [
" if (eap->force_bin == FORCE_BIN)",
" sprintf((char *)newval, \" ++bin\");",
" else if (eap->force_bin == FORCE_NOBIN)"
],
"category": "runtime/printf"
},
{
"message": [
" else if (eap->force_bin == FORCE_NOBIN)",
" sprintf((char *)newval, \" ++nobin\");",
" else"
],
"category": "runtime/printf"
}
],
"src/nvim/ops.c": [
{
"message": [
" if (amount == 1) {",
" sprintf((char *)IObuff, _(\"1 line %sed 1 time\"), s);",
" } else {"
],
"category": "runtime/printf"
},
{
"message": [
" } else {",
" sprintf((char *)IObuff, _(\"1 line %sed %d times\"), s, amount);",
" }"
],
"category": "runtime/printf"
},
{
"message": [
" if (amount == 1) {",
" sprintf((char *)IObuff, _(\"%\" PRId64 \" lines %sed 1 time\"),",
" (int64_t)oap->line_count, s);"
],
"category": "runtime/printf"
},
{
"message": [
" } else {",
" sprintf((char *)IObuff, _(\"%\" PRId64 \" lines %sed %d times\"),",
" (int64_t)oap->line_count, s, amount);"
],
"category": "runtime/printf"
}
],
"src/nvim/screen.c": [
{
"message": [
" memset(p, ' ', n_extra);",
" STRNCPY(p, p_extra + 1, STRLEN(p_extra) - 1);",
" p[n_extra] = NUL;"
],
"category": "runtime/printf"
}
],
"src/nvim/syntax.c": [
{
"message": [
" for (int i = 0; i < 9; i++) {",
" sprintf((char *)userhl, \"User%d\", i + 1);",
" id = syn_name2id(userhl);"
],
"category": "runtime/printf"
}
],
"src/nvim/search.c": [
{
"message": [
" assert(len <= INT_MAX);",
" sprintf((char *)pat, whole ? \"\\\\<%.*s\\\\>\" : \"%.*s\", (int)len, ptr);",
" // ignore case according to p_ic, p_scs and pat"
],
"category": "runtime/printf"
},
{
"message": [
" // IOSIZE > compl_length, so the STRNCPY works",
" STRNCPY(IObuff, aux, i);",
""
],
"category": "runtime/printf"
},
{
"message": [
" }",
" STRNCPY(IObuff + i, aux, p - aux);",
" i += (int)(p - aux);"
],
"category": "runtime/printf"
}
],
"src/nvim/fileio.c": [
{
"message": [
" if (conv_error != 0) {",
" sprintf((char *)IObuff + STRLEN(IObuff),",
" _(\"[CONVERSION ERROR in line %\" PRId64 \"]\"), (int64_t)conv_error);"
],
"category": "runtime/printf"
},
{
"message": [
" } else if (illegal_byte > 0) {",
" sprintf((char *)IObuff + STRLEN(IObuff),",
" _(\"[ILLEGAL BYTE in line %\" PRId64 \"]\"), (int64_t)illegal_byte);"
],
"category": "runtime/printf"
},
{
"message": [
" for (i = 4913;; i += 123) {",
" sprintf((char *)path_tail(IObuff), \"%d\", i);",
" if (!os_fileinfo_link((char *)IObuff, &file_info)) {"
],
"category": "runtime/printf"
},
{
"message": [
" SET_ERRMSG(xmalloc(300));",
" vim_snprintf(errmsg, 300,",
" _(\"E513: write error, conversion failed in line %\" PRIdLINENR"
],
"category": "runtime/printf"
},
{
"message": [
" if (shortmess(SHM_LINES)) {",
" sprintf((char *)p, \"%\" PRId64 \"L, %\" PRId64 \"C\",",
" (int64_t)lnum, (int64_t)nchars);"
],
"category": "runtime/printf"
},
{
"message": [
" } else {",
" sprintf((char *)p, _(\"%\" PRId64 \" lines, \"), (int64_t)lnum);",
" }"
],
"category": "runtime/printf"
},
{
"message": [
" } else {",
" sprintf((char *)p, _(\"%\" PRId64 \" characters\"), (int64_t)nchars);",
" }"
],
"category": "runtime/printf"
},
{
"message": [
" retval = xmalloc(fnamelen + extlen + 3);",
" strcpy(retval, fname);",
" }"
],
"category": "runtime/printf"
},
{
"message": [
" // ext can start with '.' and cannot exceed 3 more characters.",
" strcpy(s, ext);",
""
],
"category": "runtime/printf"
}
],
"src/nvim/undo.c": [
{
"message": [
" // a pointer corresponding to the header with that sequence number.",
" short old_idx = -1, new_idx = -1, cur_idx = -1;",
" for (int i = 0; i < num_head; i++) {"
],
"category": "runtime/int"
},
{
"message": [
" assert(i <= SHRT_MAX);",
" old_idx = (short)i;",
" SET_FLAG(i);"
],
"category": "runtime/int"
},
{
"message": [
" assert(i <= SHRT_MAX);",
" new_idx = (short)i;",
" SET_FLAG(i);"
],
"category": "runtime/int"
},
{
"message": [
" assert(i <= SHRT_MAX);",
" cur_idx = (short)i;",
" SET_FLAG(i);"
],
"category": "runtime/int"
}
],
"src/nvim/os/fs.c": [
{
"message": [
" if (result == kLibuvSuccess) {",
" STRNCPY(path, request.path, TEMP_FILE_PATH_MAXLEN);",
" }"
],
"category": "runtime/printf"
}
],
"src/nvim/eval/userfunc.c": [
{
"message": [
"#include \"nvim/ex_getln.h\"",
"#include \"nvim/ex_getln.h\"",
"#include \"nvim/fileio.h\""
],
"category": "build/include"
},
{
"message": [
" xfree(name);",
" sprintf(numbuf, \"%d\", ++func_nr);",
" name = vim_strsave((char_u *)numbuf);"
],
"category": "runtime/printf"
}
],
"src/nvim/vim.h": [
{
"message": [
"#define STRLEN(s) strlen((char *)(s))",
"#define STRCPY(d, s) strcpy((char *)(d), (char *)(s))",
"#define STRNCPY(d, s, n) strncpy((char *)(d), (char *)(s), (size_t)(n))"
],
"category": "runtime/printf"
},
{
"message": [
"#define STRCPY(d, s) strcpy((char *)(d), (char *)(s))",
"#define STRNCPY(d, s, n) strncpy((char *)(d), (char *)(s), (size_t)(n))",
"#define STRLCPY(d, s, n) xstrlcpy((char *)(d), (char *)(s), (size_t)(n))"
],
"category": "runtime/printf"
},
{
"message": [
"",
"#define STRCAT(d, s) strcat((char *)(d), (char *)(s))",
"#define STRNCAT(d, s, n) strncat((char *)(d), (char *)(s), (size_t)(n))"
],
"category": "runtime/printf"
},
{
"message": [
"#define STRCAT(d, s) strcat((char *)(d), (char *)(s))",
"#define STRNCAT(d, s, n) strncat((char *)(d), (char *)(s), (size_t)(n))",
"#define STRLCAT(d, s, n) xstrlcat((char *)(d), (char *)(s), (size_t)(n))"
],
"category": "runtime/printf"
}
],
"src/nvim/spell_defs.h": [
{
"message": [
" idx_T ts_arridx; // index in tree array, start of node",
" short ts_curi; // index in list of child nodes",
" char_u ts_fidx; // index in fword[], case-folded bad word"
],
"category": "runtime/int"
}
],
"src/nvim/regexp.c": [
{
"message": [
" */",
"static short class_tab[256];",
""
],
"category": "runtime/int"
},
{
"message": [
" if (peekchr() == Magic('*'))",
" sprintf((char *)IObuff, _(\"E61: Nested %s*\"),",
" reg_magic >= MAGIC_ON ? \"\" : \"\\\\\");"
],
"category": "runtime/printf"
},
{
"message": [
" else",
" sprintf((char *)IObuff, _(\"E62: Nested %s%c\"),",
" reg_magic == MAGIC_ALL ? \"\" : \"\\\\\", no_Magic(peekchr()));"
],
"category": "runtime/printf"
},
{
"message": [
" c = no_Magic(c);",
" sprintf((char *)IObuff, _(\"E64: %s%c follows nothing\"),",
" (c == '*' ? reg_magic >= MAGIC_ON : reg_magic == MAGIC_ALL)"
],
"category": "runtime/printf"
},
{
"message": [
" if (*regparse != '}') {",
" sprintf((char *)IObuff, _(\"E554: Syntax error in %s{...}\"),",
" reg_magic == MAGIC_ALL ? \"\" : \"\\\\\");"
],
"category": "runtime/printf"
},
{
"message": [
" case MOPEN + 9:",
" sprintf(buf + STRLEN(buf), \"MOPEN%d\", OP(op) - MOPEN);",
" p = NULL;"
],
"category": "runtime/printf"
},
{
"message": [
" case MCLOSE + 9:",
" sprintf(buf + STRLEN(buf), \"MCLOSE%d\", OP(op) - MCLOSE);",
" p = NULL;"
],
"category": "runtime/printf"
},
{
"message": [
" case BACKREF + 9:",
" sprintf(buf + STRLEN(buf), \"BACKREF%d\", OP(op) - BACKREF);",
" p = NULL;"
],
"category": "runtime/printf"
},
{
"message": [
" case ZOPEN + 9:",
" sprintf(buf + STRLEN(buf), \"ZOPEN%d\", OP(op) - ZOPEN);",
" p = NULL;"
],
"category": "runtime/printf"
},
{
"message": [
" case ZCLOSE + 9:",
" sprintf(buf + STRLEN(buf), \"ZCLOSE%d\", OP(op) - ZCLOSE);",
" p = NULL;"
],
"category": "runtime/printf"
},
{
"message": [
" case ZREF + 9:",
" sprintf(buf + STRLEN(buf), \"ZREF%d\", OP(op) - ZREF);",
" p = NULL;"
],
"category": "runtime/printf"
},
{
"message": [
" case BRACE_COMPLEX + 9:",
" sprintf(buf + STRLEN(buf), \"BRACE_COMPLEX%d\", OP(op) - BRACE_COMPLEX);",
" p = NULL;"
],
"category": "runtime/printf"
},
{
"message": [
" default:",
" sprintf(buf + STRLEN(buf), \"corrupt %d\", OP(op));",
" p = NULL;"
],
"category": "runtime/printf"
},
{
"message": [
" if (round == 2) {",
" STRNCPY(retval + len, reg_getline_submatch(lnum),",
" rsm.sm_mmatch->endpos[no].col);"
],
"category": "runtime/printf"
}
],
"src/nvim/undo_defs.h": [
{
"message": [
"",
"#endif // NVIM_UNDO_DEFS_H",
""
],
"category": "build/header_guard"
}
],
"src/nvim/ex_docmd.c": [
{
"message": [
"",
" sprintf(num_buf, \"%\" PRId64, (int64_t)num);",
" num_len = STRLEN(num_buf);"
],
"category": "runtime/printf"
}
],
"src/nvim/tag.c": [
{
"message": [
" STRCPY(p + len + 1, help_lang);",
" snprintf((char *)p + len + 1 + ML_EXTRA, 10, \"%06d\",",
" help_heuristic(tagp.tagname,"
],
"category": "runtime/printf"
}
],
"src/nvim/syntax_defs.h": [
{
"message": [
"",
"#endif // NVIM_SYNTAX_DEFS_H",
""
],
"category": "build/header_guard"
}
],
"src/nvim/lib/klist.h": [
{
"message": [
"",
"#ifndef _AC_KLIST_H",
"#define _AC_KLIST_H"
],
"category": "build/header_guard"
},
{
"message": [
"",
"#endif",
""
],
"category": "build/header_guard"
}
],
"src/nvim/option_defs.h": [
{
"message": [
"",
"#endif // NVIM_OPTION_DEFS_H",
""
],
"category": "build/header_guard"
}
],
"src/nvim/path.h": [
{
"message": [
"#endif",
"#endif",
""
],
"category": "build/header_guard"
}
],
"src/nvim/memline_defs.h": [
{
"message": [
"",
"#endif // NVIM_MEMLINE_DEFS_H",
""
],
"category": "build/header_guard"
}
],
"src/nvim/window.c": [
{
"message": [
" char_u prev_idx[NUMBUFLEN];",
" sprintf((char *)prev_idx, \"%i\", tabpage_index(prev_curtab));",
""
],
"category": "runtime/printf"
}
],
"src/nvim/mark.c": [
{
"message": [
" }",
" sprintf((char *)IObuff, \"%c %2d %5ld %4d \",",
" i == curwin->w_jumplistidx ? '>' : ' ',"
],
"category": "runtime/printf"
},
{
"message": [
" break;",
" sprintf((char *)IObuff, \"%c %3d %5ld %4d \",",
" i == curwin->w_changelistidx ? '>' : ' ',"
],
"category": "runtime/printf"
}
],
"src/nvim/lib/khash.h": [
{
"message": [
"#else",
"typedef unsigned long long khint64_t;",
"#endif"
],
"category": "runtime/int"
}
],
"src/nvim/hardcopy.c": [
{
"message": [
" assert(prtpos.bytes_printed <= SIZE_MAX / 100);",
" sprintf((char *)IObuff, _(\"Printing page %d (%zu%%)\"),",
" page_count + 1 + side,"
],
"category": "runtime/printf"
},
{
"message": [
" if (settings.n_collated_copies > 1)",
" sprintf((char *)IObuff + STRLEN(IObuff),",
" _(\" Copy %d of %d\"),"
],
"category": "runtime/printf"
},
{
"message": [
" if (got_int || settings.user_abort) {",
" sprintf((char *)IObuff, \"%s\", _(\"Printing aborted\"));",
" prt_message(IObuff);"
],
"category": "runtime/printf"
},
{
"message": [
"{",
" sprintf((char *)prt_line_buffer, \"%d \", i);",
" prt_write_file(prt_line_buffer);"
],
"category": "runtime/printf"
},
{
"message": [
"{",
" sprintf((char *)prt_line_buffer, \"%s \", (b ? \"T\" : \"F\"));",
" prt_write_file(prt_line_buffer);"
],
"category": "runtime/printf"
},
{
"message": [
" if (prt_out_mbyte)",
" sprintf((char *)prt_line_buffer, \"/%s %d %f /_%s sffs\\n\",",
" new_name, height, 500./prt_ps_courier_font.wx, new_name);"
],
"category": "runtime/printf"
},
{
"message": [
" }",
" sprintf((char *)prt_line_buffer, \" \");",
" prt_write_file(prt_line_buffer);"
],
"category": "runtime/printf"
},
{
"message": [
" prt_write_real(value, prec);",
" sprintf((char *)prt_line_buffer, \"d\\n\");",
" prt_write_file(prt_line_buffer);"
],
"category": "runtime/printf"
},
{
"message": [
" for (i = 0; i < count; i++) {",
" sprintf((char *)prt_line_buffer, \" %d\", ints[i]);",
" prt_write_file(prt_line_buffer);"
],
"category": "runtime/printf"
},
{
"message": [
"",
" sprintf((char *)prt_line_buffer, \"%%%%Requirements:\");",
" prt_write_file(prt_line_buffer);"
],
"category": "runtime/printf"
},
{
"message": [
" default:",
" sprintf((char *)ch_buff, \"%03o\", (unsigned int)ch);",
" ga_append(&prt_ps_buffer, (char)ch_buff[0]);"
],
"category": "runtime/printf"
}
],
"src/nvim/mark_defs.h": [
{
"message": [
"",
"#endif // NVIM_MARK_DEFS_H",
""
],
"category": "build/header_guard"
}
],
"src/nvim/option.c": [
{
"message": [
" p = options[0].fullname;",
" for (short int i = 1; (s = options[i].fullname) != NULL; i++) {",
" if (s[0] != p[0]) {"
],
"category": "runtime/int"
}
],
"src/nvim/quickfix.c": [
{
"message": [
"",
" sprintf((char *)buf, \"%s %3d\", (char *)p, nr);",
" return buf;"
],
"category": "runtime/printf"
},
{
"message": [
" STRCPY(name, p_mef);",
" sprintf((char *)name + (p - p_mef), \"%d%d\", start, off);",
" STRCAT(name, p + 2);"
],
"category": "runtime/printf"
}
],
"src/nvim/mbyte.c": [
{
"message": [
" }",
" sprintf((char *)IObuff + rlen, \"%02x \",",
" (line[i] == NL) ? NUL : line[i]); // NUL is stored as NL"
],
"category": "runtime/printf"
}
],
"src/nvim/strings.c": [
{
"message": [
"#include \"nvim/fold.h\"",
"#include \"nvim/func_attr.h\"",
"#include \"nvim/getchar.h\""
],
"category": "build/include"
},
{
"message": [
" // and expect the remainder to be zeroed out.",
" return (char_u *)strncpy(xmallocz(len), (char *)string, len);",
"}"
],
"category": "runtime/printf"
}
],
"src/nvim/eval/typval.h": [
{
"message": [
" uint8_t di_flags; /* Flags. */ \\",
" char_u di_key[__VA_ARGS__]; /* Key value. */ \\",
" }"
],
"category": "runtime/arrays"
}
],
"src/nvim/diff.c": [
{
"message": [
" } else {",
" vim_snprintf(buf, 30, \"%zu\", count);",
" ea.arg = (char_u *)buf;"
],
"category": "runtime/printf"
}
],
"src/nvim/buffer_defs.h": [
{
"message": [
"",
"#endif // NVIM_BUFFER_DEFS_H",
""
],
"category": "build/header_guard"
}
],
"src/nvim/spell.c": [
{
"message": [
"typedef struct {",
" short sft_score; // lowest score used",
" char_u sft_word[1]; // soundfolded word, actually longer"
],
"category": "runtime/int"
},
{
"message": [
" frompat = xmalloc(STRLEN(repl_from) + 7);",
" sprintf((char *)frompat, \"\\\\V\\\\<%s\\\\>\", repl_from);",
" p_ws = false;"
],
"category": "runtime/printf"
},
{
"message": [
"#ifdef DEBUG_TRIEWALK",
" sprintf(changename[depth], \"prefix\");",
"#endif"
],
"category": "runtime/printf"
},
{
"message": [
" if (!try_compound && !fword_ends)",
" sprintf(changename[depth], \"%.*s-%s: split\",",
" sp->ts_twordlen, tword, fword + sp->ts_fidx);"
],
"category": "runtime/printf"
},
{
"message": [
" else",
" sprintf(changename[depth], \"%.*s-%s: compound\",",
" sp->ts_twordlen, tword, fword + sp->ts_fidx);"
],
"category": "runtime/printf"
},
{
"message": [
" if (newscore > 0)",
" sprintf(changename[depth], \"%.*s-%s: subst %c to %c\",",
" sp->ts_twordlen, tword, fword + sp->ts_fidx,"
],
"category": "runtime/printf"
},
{
"message": [
" else",
" sprintf(changename[depth], \"%.*s-%s: accept %c\",",
" sp->ts_twordlen, tword, fword + sp->ts_fidx,"
],
"category": "runtime/printf"
},
{
"message": [
"#ifdef DEBUG_TRIEWALK",
" sprintf(changename[depth], \"%.*s-%s: delete %c\",",
" sp->ts_twordlen, tword, fword + sp->ts_fidx,"
],
"category": "runtime/printf"
},
{
"message": [
"#ifdef DEBUG_TRIEWALK",
" sprintf(changename[depth], \"%.*s-%s: insert %c\",",
" sp->ts_twordlen, tword, fword + sp->ts_fidx,"
],
"category": "runtime/printf"
},
{
"message": [
"#ifdef DEBUG_TRIEWALK",
" sprintf(changename[depth], \"%.*s-%s: swap3 %c and %c\",",
" sp->ts_twordlen, tword, fword + sp->ts_fidx,"
],
"category": "runtime/printf"
},
{
"message": [
" p = fword + sp->ts_fidx;",
" sprintf(changename[depth], \"%.*s-%s: rotate left %c%c%c\",",
" sp->ts_twordlen, tword, fword + sp->ts_fidx,"
],
"category": "runtime/printf"
},
{
"message": [
" p = fword + sp->ts_fidx;",
" sprintf(changename[depth], \"%.*s-%s: rotate right %c%c%c\",",
" sp->ts_twordlen, tword, fword + sp->ts_fidx,"
],
"category": "runtime/printf"
},
{
"message": [
"#ifdef DEBUG_TRIEWALK",
" sprintf(changename[depth], \"%.*s-%s: replace %s with %s\",",
" sp->ts_twordlen, tword, fword + sp->ts_fidx,"
],
"category": "runtime/printf"
},
{
"message": [
" if (round[depth] == 1) {",
" STRNCPY(kword + kwordlen[depth], fword + fwordidx[depth],",
" flen);"
],
"category": "runtime/printf"
},
{
"message": [
" } else {",
" STRNCPY(kword + kwordlen[depth], uword + uwordidx[depth],",
" ulen);"
],
"category": "runtime/printf"
}
],
"src/nvim/file_search.c": [
{
"message": [
" len = (int)(p - search_ctx->ffsc_fix_path) - 1;",
" STRNCAT(ff_expand_buffer, search_ctx->ffsc_fix_path, len);",
" add_pathsep((char *)ff_expand_buffer);"
],
"category": "runtime/printf"
}
],
"src/nvim/if_cscope.c": [
{
"message": [
"",
"#include <sys/types.h>",
"#include <sys/stat.h>"
],
"category": "build/include_order"
},
{
"message": [
"#include <sys/types.h>",
"#include <sys/stat.h>",
"#if defined(UNIX)"
],
"category": "build/include_order"
},
{
"message": [
"#if defined(UNIX)",
"# include <sys/wait.h>",
"#endif"
],
"category": "build/include_order"
},
{
"message": [
"",
" if ((fname = strtok((char *)NULL, (const char *)\" \")) == NULL) {",
" cs_usage_msg(Add);"
],
"category": "runtime/threadsafe_fn"
},
{
"message": [
" }",
" if ((ppath = strtok((char *)NULL, (const char *)\" \")) != NULL)",
" flags = strtok((char *)NULL, (const char *)\" \");"
],
"category": "runtime/threadsafe_fn"
},
{
"message": [
" if ((ppath = strtok((char *)NULL, (const char *)\" \")) != NULL)",
" flags = strtok((char *)NULL, (const char *)\" \");",
""
],
"category": "runtime/threadsafe_fn"
},
{
"message": [
"",
" (void)sprintf(buf, stat_emsg, fname, errno);",
" (void)EMSG(buf);"
],
"category": "runtime/printf"
},
{
"message": [
" if (fname[0] == '\\0')",
" (void)sprintf(fname2, \"/%s\", CSCOPE_DBFILE);",
" else"
],
"category": "runtime/printf"
},
{
"message": [
" else",
" (void)sprintf(fname2, \"%s/%s\", fname, CSCOPE_DBFILE);",
""
],
"category": "runtime/printf"
},
{
"message": [
" }",
" if ((stok = strtok(buf, (const char *)\" \")) == NULL) {",
" continue;"
],
"category": "runtime/threadsafe_fn"
},
{
"message": [
"",
" if ((stok = strtok(NULL, (const char *)\" \")) == NULL)",
" continue;"
],
"category": "runtime/threadsafe_fn"
},
{
"message": [
"",
" if ((stok = strtok(NULL, (const char *)\" \")) == NULL)",
" continue;"
],
"category": "runtime/threadsafe_fn"
},
{
"message": [
" char *cmd;",
" short search;",
" char *pat;"
],
"category": "runtime/int"
},
{
"message": [
"",
" (void)sprintf(cmd, \"%d%s\", search, pat);",
""
],
"category": "runtime/printf"
},
{
"message": [
" if (csinfo[i].ppath != NULL) {",
" (void)strcat(cmd, \" -P\");",
" (void)strcat(cmd, csinfo[i].ppath);"
],
"category": "runtime/printf"
},
{
"message": [
" (void)strcat(cmd, \" -P\");",
" (void)strcat(cmd, csinfo[i].ppath);",
" }"
],
"category": "runtime/printf"
},
{
"message": [
" if (csinfo[i].flags != NULL) {",
" (void)strcat(cmd, \" \");",
" (void)strcat(cmd, csinfo[i].flags);"
],
"category": "runtime/printf"
},
{
"message": [
" (void)strcat(cmd, \" \");",
" (void)strcat(cmd, csinfo[i].flags);",
" }"
],
"category": "runtime/printf"
},
{
"message": [
"",
" if ((opt = strtok((char *)NULL, (const char *)\" \")) == NULL) {",
" cs_usage_msg(Find);"
],
"category": "runtime/threadsafe_fn"
},
{
"message": [
"",
" sprintf(buf, nf, *qfpos, *(qfpos-1));",
" (void)EMSG(buf);"
],
"category": "runtime/printf"
},
{
"message": [
" buf = xmalloc(strlen(opt) + strlen(pat) + strlen(nf));",
" sprintf(buf, nf, opt, pat);",
" (void)EMSG(buf);"
],
"category": "runtime/printf"
},
{
"message": [
"",
" (void)strcpy(csinfo[i].fname, (const char *)fname);",
""
],
"category": "runtime/printf"
},
{
"message": [
" csinfo[i].ppath = xmalloc(strlen(ppath) + 1);",
" (void)strcpy(csinfo[i].ppath, (const char *)ppath);",
" } else"
],
"category": "runtime/printf"
},
{
"message": [
" csinfo[i].flags = xmalloc(strlen(flags) + 1);",
" (void)strcpy(csinfo[i].flags, (const char *)flags);",
" } else"
],
"category": "runtime/printf"
},
{
"message": [
"",
" if ((stok = strtok((char *)(eap->arg), (const char *)\" \")) == NULL)",
" return NULL;"
],
"category": "runtime/threadsafe_fn"
},
{
"message": [
"",
" if ((stok = strtok((char *)NULL, (const char *)\" \")) == NULL) {",
" cs_usage_msg(Kill);"
],
"category": "runtime/threadsafe_fn"
},
{
"message": [
"",
" (void)sprintf(buf, \"%s\\t%s\\t%s;\\\"\\t%s\", tagstr, fname, slno, search);",
" } else {"
],
"category": "runtime/printf"
},
{
"message": [
"",
" (void)sprintf(buf, \"%s\\t%s\\t%s;\\\"\", tagstr, fname, slno);",
" }"
],
"category": "runtime/printf"
},
{
"message": [
" */",
" if ((name = strtok((char *)buf, (const char *)\" \")) == NULL)",
" return NULL;"
],
"category": "runtime/threadsafe_fn"
},
{
"message": [
" return NULL;",
" if ((*context = strtok(NULL, (const char *)\" \")) == NULL)",
" return NULL;"
],
"category": "runtime/threadsafe_fn"
},
{
"message": [
" return NULL;",
" if ((*linenumber = strtok(NULL, (const char *)\" \")) == NULL)",
" return NULL;"
],
"category": "runtime/threadsafe_fn"
},
{
"message": [
" if (strcmp(cntx, \"<global>\")==0)",
" strcpy(context, \"<<global>>\");",
" else"
],
"category": "runtime/printf"
},
{
"message": [
" else",
" sprintf(context, \"<<%s>>\", cntx);",
""
],
"category": "runtime/printf"
},
{
"message": [
" fullname = xmalloc(len);",
" (void)sprintf(fullname, \"%s/%s\", csinfo[i].ppath, name);",
" } else if (csdir != NULL && csinfo[i].fname != NULL && *csdir != NUL) {"
],
"category": "runtime/printf"
}
],
"src/nvim/ex_eval.c": [
{
"message": [
" p[-2] = NUL;",
" sprintf((char *)(val + STRLEN(p)), \" (%s)\", &mesg[1]);",
" p[-2] = '\"';"
],
"category": "runtime/printf"
}
],
"src/nvim/spellfile.c": [
{
"message": [
"#ifndef UNIX // it's in os/unix_defs.h for Unix",
"# include <time.h> // for time_t",
"#endif"
],
"category": "build/include_order"
},
{
"message": [
" uint16_t wn_flags; // WF_ flags",
" short wn_region; // region mask",
""
],
"category": "runtime/int"
},
{
"message": [
" if (*items[0] == 'P')",
" sprintf((char *)buf, \"^%s\", items[4]);",
" else"
],
"category": "runtime/printf"
},
{
"message": [
" else",
" sprintf((char *)buf, \"%s$\", items[4]);",
" aff_entry->ae_prog = vim_regcomp(buf,"
],
"category": "runtime/printf"
},
{
"message": [
" if (aff_entry->ae_cond != NULL) {",
" sprintf((char *)buf, \"^%s\",",
" aff_entry->ae_cond);"
],
"category": "runtime/printf"
}
],
"src/nvim/edit.c": [
{
"message": [
" // compl_length, so the next STRNCPY always works -- Acevedo",
" STRNCPY(IObuff, ptr, len);",
" ptr = ml_get_buf(ins_buf, pos->lnum + 1, false);"
],
"category": "runtime/printf"
}
],
"src/nvim/sign_defs.h": [
{
"message": [
"",
"#endif // NVIM_SIGN_DEFS_H",
""
],
"category": "build/header_guard"
}
],
"src/nvim/eval/funcs.c": [
{
"message": [
" + STRLEN(s)); // concatenated",
" sprintf((char *)r, txt, dashes, count);",
" len = (int)STRLEN(r);"
],
"category": "runtime/printf"
}
],
"src/nvim/normal.c": [
{
"message": [
" uint16_t cmd_flags; // NV_ flags",
" short cmd_arg; // value for ca.arg",
"} nv_cmds[] ="
],
"category": "runtime/int"
},
{
"message": [
"// Sorted index of commands in nv_cmds[].",
"static short nv_cmd_idx[NV_CMDS_SIZE];",
""
],
"category": "runtime/int"
},
{
"message": [
" // The commands are sorted on absolute value.",
" c1 = nv_cmds[*(const short *)s1].cmd_char;",
" c2 = nv_cmds[*(const short *)s2].cmd_char;"
],
"category": "runtime/int"
},
{
"message": [
" c1 = nv_cmds[*(const short *)s1].cmd_char;",
" c2 = nv_cmds[*(const short *)s2].cmd_char;",
" if (c1 < 0) {"
],
"category": "runtime/int"
},
{
"message": [
" // Fill the index table with a one to one relation.",
" for (short int i = 0; i < (short int)NV_CMDS_SIZE; ++i) {",
" nv_cmd_idx[i] = i;"
],
"category": "runtime/int"
},
{
"message": [
" // Sort the commands by the command character.",
" qsort(&nv_cmd_idx, NV_CMDS_SIZE, sizeof(short), nv_compare);",
""
],
"category": "runtime/int"
},
{
"message": [
" // Find the first entry that can't be indexed by the command character.",
" short int i;",
" for (i = 0; i < (short int)NV_CMDS_SIZE; ++i) {"
],
"category": "runtime/int"
},
{
"message": [
" short int i;",
" for (i = 0; i < (short int)NV_CMDS_SIZE; ++i) {",
" if (i != nv_cmds[nv_cmd_idx[i]].cmd_char) {"
],
"category": "runtime/int"
},
{
"message": [
" if (bytes == chars) {",
" sprintf((char *)showcmd_buf, \"%d\", chars);",
" } else {"
],
"category": "runtime/printf"
},
{
"message": [
" } else {",
" sprintf((char *)showcmd_buf, \"%d-%d\", chars, bytes);",
" }"
],
"category": "runtime/printf"
},
{
"message": [
" assert(len <= INT_MAX);",
" sprintf((char *)pat, vim_iswordp(ptr) ? \"\\\\V\\\\<%.*s\\\\>\" : \"\\\\V%.*s\",",
" (int)len, ptr);"
],
"category": "runtime/printf"
}
],
"src/nvim/ex_cmds.c": [
{
"message": [
" s = xmalloc(18 + STRLEN(tagfname));",
" sprintf((char *)s, \"help-tags\\t%s\\t1\\n\", tagfname);",
" GA_APPEND(char_u *, &ga, s);"
],
"category": "runtime/printf"
},
{
"message": [
" GA_APPEND(char_u *, &ga, s);",
" sprintf((char *)s, \"%s\\t%s\", p1, fname);",
""
],
"category": "runtime/printf"
}
],
"src/nvim/memline.c": [
{
"message": [
"#ifndef UNIX /* it's in os/unix_defs.h for Unix */",
"# include <time.h>",
"#endif"
],
"category": "build/include_order"
},
{
"message": [
" int b0_magic_int; /* check for byte order of int */",
" short b0_magic_short; /* check for byte order of short */",
" char_u b0_magic_char; /* check for last char */"
],
"category": "runtime/int"
},
{
"message": [
" b0p->b0_magic_int = (int)B0_MAGIC_INT;",
" b0p->b0_magic_short = (short)B0_MAGIC_SHORT;",
" b0p->b0_magic_char = B0_MAGIC_CHAR;"
],
"category": "runtime/int"
},
{
"message": [
" || b0p->b0_magic_int != (int)B0_MAGIC_INT",
" || b0p->b0_magic_short != (short)B0_MAGIC_SHORT",
" || b0p->b0_magic_char != B0_MAGIC_CHAR;"
],
"category": "runtime/int"
}
],
"src/nvim/regexp_nfa.c": [
{
"message": [
"",
" STRNCPY(save, &p[last], 2);",
" STRNCPY(&p[last], \"+-\", 2);"
],
"category": "runtime/printf"
},
{
"message": [
" STRNCPY(save, &p[last], 2);",
" STRNCPY(&p[last], \"+-\", 2);",
" fprintf(debugf, \" %s\", p);"
],
"category": "runtime/printf"
},
{
"message": [
" fprintf(debugf, \" %s\", p);",
" STRNCPY(&p[last], save, 2);",
" } else"
],
"category": "runtime/printf"
}
],
"src/nvim/garray.c": [
{
"message": [
" }",
" strcpy(s, strings[nelem - 1]);",
""
],
"category": "runtime/printf"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment