summaryrefslogtreecommitdiffstatshomepage
path: root/src/nvim/eval/encode.c
AgeCommit message (Collapse)AuthorFiles
2026-02-22vim-patch:9.2.0031: Inefficient use of ga_concat()zeertzjq1
Problem: Inefficient use of ga_concat() Solution: Use ga_concat_len() when the length is already known to avoid use of strlen() (John Marriott). closes: vim/vim#19422 https://github.com/vim/vim/commit/ed202035b1904c84d92adb76d7e1a95b7540e048 Co-authored-by: John Marriott <basilisk@internode.on.net> Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2026-01-03vim-patch:partial:9.1.2044: Inefficient use of ga_concat() (#37209)zeertzjq1
Problem: Inefficient use of ga_concat() Solution: Use ga_concat_len() when the length is already known to avoid use of strlen() (John Marriott). Additionally the following changes are done: os_unix.c: - in function `socket_server_list_sockets()` use a `string_T` for the strings `buf` and `path` for use in `ga_concat_len()` and drop un-needed variable `dir`. quickfix.c: - in function `qf_jump_print_msg()` use a `string_T` for the string `IObuff` for use in `ga_concat_len()`. - in function `qf_range_text()` use a `string_T` for the string `buf` for use in `ga_concat_len()`. register.c: - simplify function `execreg_line_continuation()`. terminal.c: - in function `read_dump_file()` use a `string_T` for the string `prev_char` for use in `ga_concat_len()`. tuple.c: - in function `tuple_join_inner()` use a `string_T` for the string `s` for use in `ga_concat_len()`. Also, change local struct `join_T` to use `string_T`. vim9type.c: - in functions `type_name_tuple()` and `type_name_func()` use a `string_T` for the string `arg_type` for use in `ga_concat_len()`. closes: vim/vim#19038 https://github.com/vim/vim/commit/a7e671fbb9fa2af9ad6c4ba9a7a881df431cd02b Skip tuple. Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-12-29vim-patch:9.1.2030: inefficient use of ga_concat() (#37151)zeertzjq1
Problem: inefficient use of ga_concat() Solution: Use ga_concat_len() when length is known. (John Marriott) closes: vim/vim#19027 https://github.com/vim/vim/commit/32b801abc35b03e6f88021b29c24dd2411f7a065 Co-authored-by: John Marriott <basilisk@internode.on.net>
2025-12-20vim-patch:8.2.3766: converting a funcref to a string leaves out "g:"zeertzjq1
Problem: Converting a funcref to a string leaves out "g:", causing the meaning of the name depending on the context. Solution: Prepend "g:" for a global function. https://github.com/vim/vim/commit/c4ec338fb80ebfb5d631f0718fdd1a1c04d9ed82 Co-authored-by: Bram Moolenaar <Bram@vim.org> Co-authored-by: Jan Edmund Lazo <jan.lazo@mail.utoronto.ca>
2025-08-14refactor(build): remove INCLUDE_GENERATED_DECLARATIONS guardsbfredl1
These are not needed after #35129 but making uncrustify still play nice with them was a bit tricky. Unfortunately `uncrustify --update-config-with-doc` breaks strings with backslashes. This issue has been reported upstream, and in the meanwhile auto-update on every single run has been disabled.
2024-08-05refactor(shada): rework msgpack decoding without msgpack-cbfredl1
This also makes shada reading slightly faster due to avoiding some copying and allocation. Use keysets to drive decoding of msgpack maps for shada entries.
2024-06-27refactor(shada): don't use msgpack_packer for shadabfredl1
Now msgpack-c is never used for packing. The real fun part will be replacing it for unpacking.
2024-06-27refactor(typval)!: remove distinction of binary and nonbinary stringsbfredl1
This is a breaking change which will make refactor of typval and shada code a lot easier. In particular, code that would use or check for v:msgpack_types.binary in the wild would be broken. This appears to be rarely used in existing plugins. Also some cases where v:msgpack_type.string would be used to represent a binary string of "string" type, we use a BLOB instead, which is vimscripts native type for binary blobs, and already was used for BIN formats when necessary. msgpackdump(msgpackparse(data)) no longer preserves the distinction of BIN and STR strings. This is very common behavior for language-specific msgpack bindings. Nvim uses msgpack as a tool to serialize its data. Nvim is not a tool to bit-perfectly manipulate arbitrary msgpack data out in the wild. The changed tests should indicate how behavior changes in various edge cases.
2024-06-24refactor(typval): don't use msgpack_packer for msgpackdump()bfredl1
Step towords completely eliminating msgpack_packer.
2024-06-04fixup: apply the change on more filesJames Tirta Halim1
2024-01-11refactor(IWYU): fix headersdundargoc1
Remove `export` pramgas from defs headers as it causes IWYU to believe that the definitions from the defs headers comes from main header, which is not what we really want.
2023-11-30refactor(IWYU): move typedefs out of globals.h (#26322)zeertzjq1
2023-11-28refactor: fix headers with IWYUdundargoc1
2023-11-27refactor: rename types.h to types_defs.hdundargoc1
2023-11-12build: remove PVSdundargoc1
We already have an extensive suite of static analysis tools we use, which causes a fair bit of redundancy as we get duplicate warnings. PVS is also prone to give false warnings which creates a lot of work to identify and disable.
2023-10-09refactor: the long goodbyedundargoc1
long is 32 bits on windows, while it is 64 bits on other architectures. This makes the type suboptimal for a codebase meant to be cross-platform. Replace it with more appropriate integer types.
2023-06-22fix(messages): use "Vimscript" instead of "VimL" #24111Justin M. Keyes1
followup to #24109 fix #16150
2023-04-26refactor: uncrustifydundargoc1
Notable changes: replace all infinite loops to `while(true)` and remove `int` from `unsigned int`.
2023-04-07refactor: remove redundant const char * castsii141
2023-01-21refactor: use uint8_t for blobs and ga_append() (#21916)zeertzjq1
A blob is used as a sequence of bytes and usually accessed individually, not as as a NUL-terminuated string, so uint8_t should be better. Not sure about ga_append(), but using uint8_t leads to fewer casts.
2023-01-09refactor: replace char_u with char 18 (#21237)dundargoc1
refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459
2022-11-26refactor: replace char_u with charDundar Göc1
Work on https://github.com/neovim/neovim/issues/459
2022-11-15build: allow IWYU to fix includes for all .c filesdundargoc1
Allow Include What You Use to remove unnecessary includes and only include what is necessary. This helps with reducing compilation times and makes it easier to visualise which dependencies are actually required. Work on https://github.com/neovim/neovim/issues/549, but doesn't close it since this only works fully for .c files and not headers.
2022-10-12refactor: clint (#20600)Lewis Russell1
2022-09-25refactor: move klib out of src/nvim/ #20341dundargoc1
It's confusing to mix vendored dependencies with neovim source code. A clean separation is simpler to keep track of and simpler to document.
2022-09-11refactor: replace char_u with charDundar Göc1
Work on https://github.com/neovim/neovim/issues/459
2022-08-13vim-patch:7.4.1168 (#19645)zeertzjq1
Problem: This doesn't give the right result: eval(string(v:true)). (Nikolay Pavlov) Solution: Make the string "v:true" instead of "true". https://github.com/vim/vim/commit/f48aa160fdd7b8caa7678e1a2139244dd2bdc547
2022-05-26refactor: missing parenthesis may cause unexpected problems (#17443)kylo2521
related vim-8.2.{4402,4639}
2022-05-07refactor: replace char_u variables and functions with charDundar Goc1
Work on https://github.com/neovim/neovim/issues/459
2022-05-05refactor: replace char_u variables and functions with charDundar Goc1
Work on https://github.com/neovim/neovim/issues/459
2022-04-24refactor: convert macros to all-caps (#17895)dundargoc1
Closes https://github.com/neovim/neovim/issues/6297
2021-11-23refactor: upgrade uncrustify config version to 0.74.0Dundar Göc1
Disable formatting for assert.h since there's a bug that results in a segmentation fault in uncrustify.
2021-11-16refactor: reduce number of explicit char casts (#16077)dundargoc1
* refactor: reduce number of explicit char casts
2021-11-01vim-patch:8.1.0743: giving error messages is not flexibleJames McCoy1
Problem: Giving error messages is not flexible. Solution: Add semsg(). Change argument from "char_u *" to "char *", also for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes vim/vim#3302) Also make emsg() accept a "char *" argument. Get rid of an enormous number of type casts. https://github.com/vim/vim/commit/f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d
2021-10-29refactor: uncrustify #16090dundargoc1
2021-10-12refactor: reduce number of unique char casts (#15995)dundargoc1
2021-10-04refactor: remove redundant char casts #15888dundargoc1
2021-09-18refactor: format #15702dundargoc1
2021-09-16feat(f_msgpackdump): support dumping to BlobSean Dewar1
2021-09-15vim-patch:8.1.0765: string format of a Blob can't be parsed backSean Dewar1
Problem: String format of a Blob can't be parsed back. Solution: Use 0z format. https://github.com/vim/vim/commit/4131fd5509b283e978e8c6161f09643b64719787
2021-09-15feat(msgpack): convert Blobs to BIN stringsSean Dewar1
2021-09-15feat(json): convert Blobs to array of byte valuesSean Dewar1
Similiar to how Vim does it, but to be consistent with how Nvim encodes lists, add a space after every comma.
2021-09-15vim-patch:8.1.0735: cannot handle binary dataSean Dewar1
Problem: Cannot handle binary data. Solution: Add the Blob type. (Yasuhiro Matsumoto, closes vim/vim#3638) https://github.com/vim/vim/commit/6e5ea8d2a995b32bbc5972edc4f827b959f2702f Nvim-specific Blob conversions are implemented in future commits. Refactor write_blob() to use a FileDescriptor, as f_writefile() was refactored to use one (does not apply to read_blob()). Use var_check_lock() in f_add() for Blobs from v8.1.0897. Add a modeline to test_blob.vim and fix some doc typos. Include if_perl.txt's VIM::Blob() documentation. Interestingly, this function already worked before this port, as it just returns a Blob string literal, not an actual Blob object. N/A patches for version.c: vim-patch:8.1.0741: viminfo with Blob is not tested Problem: Viminfo with Blob is not tested. Solution: Extend the viminfo test. Fix reading a blob. Fixed storing a special variable value. https://github.com/vim/vim/commit/8c8b8bb56c724cc1bfc3d8520eec33f2d399697c vim-patch:8.1.1022: may use NULL pointer when out of memory Problem: May use NULL pointer when out of memory. (Coverity) Solution: Check for blob_alloc() returning NULL. https://github.com/vim/vim/commit/e142a9467a7f6845a426d8db6efedf246d3c13ac
2021-01-31Use abort() instead of assert(false) for things that should never happenJames McCoy1
assert() is compiled out for release builds, but we don't want to continue running in these impossible situations. This also resolves the "implicit fallthrough" warnings for the asserts in switch cases.
2020-11-08gcc/analyzer: fix false positives for NULL (#13248)Jan Edmund Lazo1
Close https://github.com/neovim/neovim/issues/13158
2020-06-06vim-patch:8.2.0111: VAR_SPECIAL is also used for booleansBilly Su1
Problem: VAR_SPECIAL is also used for booleans. Solution: Add VAR_BOOL for better type checking. https://github.com/vim/vim/commit/9b4a15d5dba354d2e1e02871470bad103f34769a
2020-01-30doc: fix typos [ci skip] #11787Hye Sung Jung1
2019-01-21build: Fix -Wconversion warnings for fpclassify et alJustin M. Keyes1
closes #8274 The parent commit tries a different approach, but that fails on Apple Clang version: Apple LLVM version 10.0.0 (clang-1000.11.45.5) Target: x86_64-apple-darwin17.7.0 which somehow compiles the check_c_source_compiles() check, but then complains during later compilation that __fpclassify is not defined (regardless of "#include <math.h>").
2019-01-20build: Fix -Wconversion warnings for fpclassify et alJustin M. Keyes1
closes #8274 - Instead of #undef and re-#define, define "xfoo" wrappers to avoid include-order sensitivity. - The warnings are bogus, caused by bad interaction between glibc and clang 6+. - https://bugs.llvm.org/show_bug.cgi?id=35268 - https://bugs.llvm.org/show_bug.cgi?id=39738 - https://bugzilla.redhat.com/show_bug.cgi?id=1472437
2019-01-02build: enable -WshadowJustin M. Keyes1
Note about shada.c: - shada_read_next_item_start was intentionally shadowing `unpacked` and `i` because many of the macros (e.g. ADDITIONAL_KEY) implicitly depended on those variable names. - Macros were changed to parameterize `unpacked` (but not `i`). Macros like CLEAR_GA_AND_ERROR_OUT do control-flow (goto), so any other approach is messy.