aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/strings.c
Commit message (Collapse)AuthorAge
* refactor: change pre-decrement/increment to post (#19799)Lewis Russell2022-08-16
| | | Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* refactor: replace char_u with charDundar Goc2022-08-12
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: replace_makeprg (#19570)Lewis Russell2022-08-01
|
* refactor: replace char_u with charDundar Goc2022-07-31
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: missing parenthesis may cause unexpected problems (#17443)kylo2522022-05-26
| | | related vim-8.2.{4402,4639}
* refactor(uncrustify): set maximum number of consecutive newlines to 2 (#18695)dundargoc2022-05-25
|
* Merge pull request #18648 from jamessan/coverity-fixesJames McCoy2022-05-20
|\
| * fix(cid/352782): assert str->items is non-NULL to hint static analyzersJames McCoy2022-05-20
| | | | | | | | | | | | | | The earlier vsnprintf() call checks whether str->items is NULL, sets of the "possible NULL" spidey sense. kv_ensure_space() guarantees str->items is non-NULL but since it doesn't use NULL checks to decide whether to alloc, static analyzers can't tell this code path is safe.
* | refactor: move reverse_text to strings.c as it's a string operationDundar Goc2022-05-20
|/ | | | | | Also add tests for reverse_text. Co-authored-by: Kalle Ranki <kalle.ranki@gmail.com>
* fix(PVS/V568): correct placement of ignore directiveDundar Goc2022-05-17
|
* refactor: replace char_u variables and functions with charDundar Goc2022-05-16
| | | | Work on https://github.com/neovim/neovim/issues/459
* fix PVS warnings (#18459)dundargoc2022-05-15
| | | | | | | | | | | | | * fix(PVS/V547): remove ifs that are always true or false * fix(PVS/V560): remove partial conditions that are always true * fix(PVS/V1044): suppress warning about loop break conditions * fix(PVS/V1063): suppress "modulo by 1 operation is meaningless" * fix(PVS/V568): suppress "operator evaluates the size of a pointer" Also mark vim-patch:8.2.4958 as ported.
* refactor(api/nvim_cmd): use `kvec_t` for constructing cmdline stringFamiu Haque2022-05-14
| | | | Co-authored-by: Björn Linse <bjorn.linse@gmail.com>
* refactor: replace char_u variables and functions with charDundar Goc2022-05-09
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: replace char_u variables and functions with charDundar Goc2022-05-07
| | | | Work on https://github.com/neovim/neovim/issues/459
* refactor: enable -Wconversion warning for edit.cDundar Goc2022-05-06
| | | | Work on https://github.com/neovim/neovim/issues/567
* refactor: add function xstrnsaveDundar Goc2022-04-16
| | | | | | | xstrnsave is a clone of vim_strnsave that uses char* instead of char_u*. Its purpose short-term is to help reduce the number of casts and for long-term to replace vim_strnsave as the need to use char_u is eliminated.
* refactor: fix clang-tidy bugprone-signed-char-misuse warningsDundar Göc2022-03-04
| | | | | Prefer to declare variables with correct type instead of explicit casts wherever possible.
* vim-patch:8.2.3663: using %S in printf() does not work correctlyzeertzjq2022-01-16
| | | | | | Problem: Using %S in printf() does not work correctly. Solution: Fix the problem and add more tests. (closes vim/vim#9208) https://github.com/vim/vim/commit/1f2453fec6f8f0f315f00ca7b562a02090cb1e37
* vim-patch:8.2.3630: printf() with %S does not handle multi-byte correctlyzeertzjq2022-01-16
| | | | | | Problem: Printf() with %S does not handle multi-byte correctly. Solution: Count cells instead of bytes. (closes vim/vim#9169, closes vim/vim#7486) https://github.com/vim/vim/commit/d85fccdfed58108c4e0958d0b17c64690b5f073f
* refactor(misc1): move out high-level input functions to a new file: input.cBjörn Linse2021-12-10
| | | | | Possibly dialog code is messages.c could be moved here as well. misc1.c is now empty, so delete it.
* fix: add STRNLEN compatability macroClaes Nästén2021-12-06
| | | | | Older SunOS systems come without strnlen, add STRNLEN macro in line with the other str* compat macros.
* refactor: saner options for uncrustify (#16204)dundargoc2021-11-19
| | | | | | | | | | | | | | | | | | | | | | | | * sp_enum_after_assign = force * sp_brace_typedef = force * nl_do_brace = remove * sp_do_brace_open = force * sp_brace_close_while = force * sp_before_semi = remove * sp_before_semi_for = remove * sp_before_semi_for_empty = remove * sp_between_semi_for_empty = remove * sp_after_semi_for_empty = remove * sp_before_square = remove * sp_before_squares = remove * sp_inside_square = remove * sp_inside_fparens = remove * sp_inside_fparen = remove * sp_inside_tparen = remove * sp_after_tparen_close = remove * sp_return_paren = force * pos_bool = lead * sp_pp_concat = remove * sp_pp_stringify = remove * fixup: disable formatting for the INIT section
* refactor(macroman): get rid of MB_COPY_CHAR macroBjörn Linse2021-11-14
| | | | clean up docs for MB_PTR_ADV and MB_PTR_BACK
* refactor(multibyte): eliminate mb_ptr2len alias for utfc_ptr2lenBjörn Linse2021-11-14
|
* vim-patch:8.1.0743: giving error messages is not flexibleJames McCoy2021-11-01
| | | | | | | | | 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
* refactor: saner options for uncrustify #16196dundargoc2021-10-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * refactor: general good option changes sp_deref = remove sp_not = remove sp_inv = remove sp_inside_paren_cast = remove mod_remove_duplicate_include = true sp_after_semi = add sp_after_semi_for = force sp_sizeof_paren = remove nl_return_expr = remove nl_else_brace = remove nl_else_if = remove * refactor: mod_remove_extra_semicolon = true * refactor: nl_max = 3 * refactor: sp_bool = force * refactor: sp_compare = force * refactor: sp_inside_paren = remove * refactor: sp_paren_paren = remove * refactor: sp_inside_sparen = remove * refactor: sp_before_sparen = force * refactor: sp_sign = remove * refactor: sp_addr = remove * refactor: sp_member = remove * refactor: nl_struct_brace = remove * refactor: nl_before_if_closing_paren = remove * refactor: nl_fdef_brace = force * refactor: sp_paren_comma = force * refactor: mod_full_brace_do = add
* refactor: format with uncrustify #15842dundargoc2021-10-02
| | | | * refactor: format with uncrustify * refactor: convert function comments to doxygen
* vim-patch:8.2.3393: escaping for fish shell is skipping some charactersJason Cox2021-09-02
| | | | | | | Problem: Escaping for fish shell is skipping some characters. Solution: Escape character after backslash if needed. (Jason Cox, closes vim/vim#8827) https://github.com/vim/vim/commit/6631597452d4644f485a09e4036d117e5f91de70
* vim-patch:8.2.3385: escaping for fish shell does not work properlyJason Cox2021-09-02
| | | | | | Problem: Escaping for fish shell does not work properly. Solution: Insert a backslash before a backslash. (Jason Cox, closes vim/vim#8810) https://github.com/vim/vim/commit/6e82351130ddb8d13cf3748b47f07cae77886fc7
* clang/'Dead nested assignment': don't assign unused value to precision #15012dundargoc2021-07-07
|
* vim-patch:8.2.0271: the "num64" feature is available everywhereJan Edmund Lazo2020-11-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The "num64" feature is available everywhere and building without it causes problems. Solution: Graduage the "num64" feature. (James McCoy, closes vim/vim#5650) https://github.com/vim/vim/commit/82f654e092ac5b86316bc1b30c0b07a849813186 Restore Test_printf_spec_b() from patch 7.4.2221.. N/A patches for version.c: vim-patch:8.2.0594: MS-Windows: cannot build with WINVER set to 0x0501 Problem: MS-Windows: cannot build with WINVER set to 0x0501. Solution: Only use inet_ntop() when available. (Ozaki Kiichi, closes vim/vim#5946) https://github.com/vim/vim/commit/b6fb0516ec862a18fdffe06c9400d507a7193835 vim-patch:8.2.0965: has_funcundefined() is not used Problem: Has_funcundefined() is not used. Solution: Delete the function. (Dominique Pellé, closes vim/vim#6242) https://github.com/vim/vim/commit/5055c56cfbedc6326c607d40c7a1241682f7675e vim-patch:8.2.1370: MS-Windows: warning for using fstat() with stat_T Problem: MS-Windows: warning for using fstat() with stat_T. Solution: use _fstat64() if available. (Naruhiko Nishino, closes vim/vim#6625) https://github.com/vim/vim/commit/c753478b82613df37b145764e27f5514542edb97 vim-patch:8.2.2056: configure fails when building with implicit-function-declaration Problem: Configure fails when building with the "implicit-function-declaration" error enabled, specifically on Mac. Solution: Declear the functions like in the source code. (suggestion by Clemens Lang, closes vim/vim#7380) https://github.com/vim/vim/commit/ce7be3a0e6f19bc85990bb8fcfe5e208944777b4
* vim-patch:8.1.0806: too many #ifdefsJan Edmund Lazo2020-11-12
| | | | | | Problem: Too many #ifdefs. Solution: Graduate FEAT_MBYTE, part 2. https://github.com/vim/vim/commit/fc3abf47fbe1e426f2b676c316c81ee9ff607075
* vim-patch:8.1.2083: multi-byte chars do not work properly with "%.*S" in ↵Daniel Hahler2019-09-28
| | | | | | | printf() (#11106) Problem: Multi-byte chars do not work properly with "%.*S" in printf(). Solution: Use mb_ptr2cells(). Daniel Hahler, closes vim/vim#4989) https://github.com/vim/vim/commit/ce0fac28977af31f1dec411d3535b4de2c3169b3
* vim-patch:8.0.0709: libvterm cannot use vsnprintf()Jan Edmund Lazo2019-04-04
| | | | | | Problem: Libvterm cannot use vsnprintf(), it does not exist in C90. Solution: Use vim_vsnprintf() instead. https://github.com/vim/vim/commit/8327d1df1754b33d8a93b3411f30692f0042f4ce
* build: Fix -Wconversion warnings for fpclassify et alJustin M. Keyes2019-01-21
| | | | | | | | | | | | 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>").
* build: Fix -Wconversion warnings for fpclassify et alJustin M. Keyes2019-01-20
| | | | | | | | | | | | 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
* strings: make vim_snprintf handle %d correctly againBjörn Linse2018-12-24
| | | | This was broken in #9369 (4680ca2)
* strings: use (u)int16_t for %h printf formatJan Edmund Lazo2018-12-16
|
* add func_attr_printf in :MichaHoffmann2018-09-24
| | | | | | | | | | | | | | | | | | | | | | log.c message.c strings.c fixed some printf warnings in: src/nvim/undo.c src/nvim/eval.c src/nvim/eval/encode.c src/nvim/eval/typval.c src/nvim/ex_getln.c src/nvim/fileio.c src/nvim/lua/executor.c src/nvim/main.c src/nvim/regexp_nfa.c src/nvim/shada.c src/nvim/spellfile.c src/nvim/tui/terminfo.c src/nvim/garray.h
* vim-patch:8.0.1468: illegal memory access in del_bytes()Jan Edmund Lazo2018-08-24
| | | | | | Problem: Illegal memory access in del_bytes(). Solution: Check for negative byte count. (Christian Brabandt, closes vim/vim#2466) https://github.com/vim/vim/commit/191f18bad0b5c48afa05c3e8a00f3ced993f6a38
* Merge #8833 from janlazo/vim-8.0.1004Justin M. Keyes2018-08-12
|\
| * vim-patch:8.0.1421: accessing invalid memory with overlong byte sequenceJan Edmund Lazo2018-08-09
| | | | | | | | | | | | Problem: Accessing invalid memory with overlong byte sequence. Solution: Check for NUL character. (test by Dominique Pelle, closes vim/vim#2485) https://github.com/vim/vim/commit/e6640ad44e2186bd3642b972115496d347cd1fdd
* | refactor: Replace vim_strrchr() with strrchar() (#8718)ZviRackover2018-08-11
|/ | | | ref #1474
* vim-patch:8.0.0451: some macros are in lower caseJan Edmund Lazo2018-06-12
| | | | | | | Problem: Some macros are in lower case. Solution: Make a few more macros upper case. Avoid lower case macros use an argument twice. https://github.com/vim/vim/commit/91acfffc1e6c0d8c2abfb186a0e79a5bf19c3f3f
* strings.c: Fix PVS/V781: value of 'l + 1' is checked after it was usedJustin M. Keyes2018-05-20
|
* strings: Fix PVS/V547: condition already checked by surrounding ifZyX2018-04-22
|
* strings: Fix PVS/V779: wrong assert() positionZyX2018-04-22
|
* Fix for lintGeorge Zhao2018-01-19
|
* Fix warning about math functions, include isnan, isinf, fpclassify.George Zhao2018-01-18
|