Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Refactor insexpand.c to remove calls to STRLEN() - #16095

#16095
Closed
basilisk0315 wants to merge 1 commit into
vim:mastervim/vim:masterfrom
basilisk0315:masterbasilisk0315/vim:masterCopy head branch name to clipboard
Closed

Refactor insexpand.c to remove calls to STRLEN()#16095
basilisk0315 wants to merge 1 commit into
vim:mastervim/vim:masterfrom
basilisk0315:masterbasilisk0315/vim:masterCopy head branch name to clipboard

Conversation

@basilisk0315

Copy link
Copy Markdown

Use string_T to store strings.
Fix a warning in get_next_file_completion():

clang -c -I. -Iproto -DWIN32 -DWINVER=0x0A00 -D_WIN32_WINNT=0x0A00 -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -D__USE_MINGW_ANSI_STDIO -pipe -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -Wall -Wextra -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Werror -Wno-deprecated-declarations -Wno-error=missing-field-initializers -Werror=uninitialized -DEXITFREE -DFEAT_GUI_MSWIN -DFEAT_CLIPBOARD insexpand.c -o gobjx86-64/insexpand.o
insexpand.c:3576:20: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long long') [-Wsign-compare]
 3576 |             for (i = 0; i < leader_len; i++)
      |                         ~ ^ ~~~~~~~~~~
insexpand.c:3584:20: warning: comparison of integers of different signs: 'int' and 'size_t' (aka 'unsigned long long') [-Wsign-compare]
 3584 |             for (i = 0; i < leader_len; i++)
      |                         ~ ^ ~~~~~~~~~~

Add function ins_complete_leader_len() for use elsewhere in the code.

@chrisbra

Copy link
Copy Markdown
Member

Thanks. That looks reasonable.

@chrisbra chrisbra closed this in 5e6ea92 Nov 23, 2024
RestorerZ added a commit to RestorerZ/fork_vim-orig that referenced this pull request Nov 24, 2024
CI: Bump codecov/codecov-action from 4 to 5

Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4 to 5.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@v4...v5)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

closes: vim#16079

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>

patch 9.1.0870: too many strlen() calls in eval.c

Problem:  too many strlen() calls in eval.c
Solution: Refactor eval.c to remove calls to STRLEN()
          (John Marriott)

closes: vim#16066

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>

patch 9.1.0871: getcellpixels() can be further improved

Problem:  getcellpixels() can be further improved
Solution: Fix floating point exception, implement getcellpixels() in the
          UI (mikoto2000)

closes: vim#16059

Signed-off-by: mikoto2000 <mikoto2000@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>

patch 9.1.0872: No test for W23 message

Problem:  No test for W23 message
Solution: Check for W23 message when accessing the clipboard fails
          (after v9.1.0868)

closes: vim#16076

Signed-off-by: Christian Brabandt <cb@256bit.org>

patch 9.1.0873: filetype: Vivado files are not recognized

Problem:  filetype: Vivado files are not recognized
Solution: detect '*.mss' files as 'mss' filetype
          (Wu, Zhenyu)

references:
https://docs.amd.com/r/2020.2-English/ug1400-vitis-embedded/Microprocessor-Software-Specification-MSS

closes: vim#15907

Signed-off-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Signed-off-by: Christian Brabandt <cb@256bit.org>

CI: join codecov array flags, instead of accessing it directly

closes: vim#16082

Signed-off-by: rhysd <lin90162@yahoo.co.jp>
Signed-off-by: Christian Brabandt <cb@256bit.org>

patch 9.1.0874: filetype: karel files are not detected

Problem:  filetype: karel files are not detected
Solution: detect '*.kl' files as karel filetype,
          include syntax and filetype plugin
          (Kirill Morozov)

closes: vim#16075

Co-authored-by: KnoP-01 <knosowski@graeffrobotics.de>
Signed-off-by: Kirill Morozov <kirill@robotix.pro>
Signed-off-by: Christian Brabandt <cb@256bit.org>

patch 9.1.0875: filetype: hyprlang detection can be improved

Problem:  filetype: hyprlang detection can be improved
Solution: detect '/hypr/*.conf' files as hyprlang filetype,
          include basic syntax highlighting (Luca Saccarola)

fixes: vim#15875
closes: vim#16064

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>

patch 9.1.0876: filetype: openCL files are not recognized

Problem:  filetype: openCL files are not recognized
Solution: detect '*.cl' files as opencl or lisp filetype,
          include a opencl syntax and filetype plugin (Wu, Zhenyu)

closes: vim#15825

Signed-off-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Signed-off-by: Christian Brabandt <cb@256bit.org>

patch 9.1.0877: tests: missing test for termdebug + decimal signs

Problem:  tests: missing test for termdebug + decimal signs
Solution: Add a termdebug test (Ubaldo Tiberi)

closes: vim#16081

Signed-off-by: Ubaldo Tiberi <ubaldo.tiberi@volvo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>

patch 9.1.0878: termdebug: cannot enable DEBUG mode

Problem:  termdebug: cannot enable DEBUG mode
Solution: Allow to specify DEBUG mode (Ubaldo Tiberi)

closes: vim#16080

Signed-off-by: Ubaldo Tiberi <ubaldo.tiberi@volvo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>

runtime(compiler): fix escaping of arguments passed to :CompilerSet

See newly added help entry referring to option-backslash

closes: vim#16084

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>

Add clang-format config file

This is used in preparation to enable automatic code-formatting in the
following commits.  For now let's just add a clang-format config file,
formatting of source files will follow.

related: vim#16019

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>

patch 9.1.0879: source is not consistently formatted

Problem:  source is not consistently formatted
Solution: reformat sign.c and sound.c
          (Luca Saccarola)

closes: vim#16019

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>

git: ignore re-formatting commit v9.1.0879 for blame

Signed-off-by: Christian Brabandt <cb@256bit.org>

runtime(doc): add helptag for :HelpToc command

Signed-off-by: Christian Brabandt <cb@256bit.org>

patch 9.1.0880: filetype: C3 files are not recognized

Problem:  filetype: C3 files are not recognized
Solution: detect '*.c3*' files as c3 filetype (Turiiya)

closes: vim#16087

Signed-off-by: Turiiya <34311583+ttytm@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>

runtime(misc): add Italian LICENSE and (top-level) README file

related: vim#16061

Signed-off-by: Antonio Giovanni Colombo <azc100@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>

runtime(apache): Update syntax keyword definition

closes: vim#16105

Signed-off-by: nisbet-hubbard <87453615+nisbet-hubbard@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>

runtime(netrw): update netrw's decompress logic

Detect a few more default archive types, correctly handle file
extensions with digits in it.

fixes: vim#16099
closes: vim#16104

Signed-off-by: Konfekt <Konfekt@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>

patch 9.1.0881: GUI: message dialog may not get focus

Problem:  GUI: message dialog may not get focus
Solution: add window manager hint to give focus to the dialog
          (Chris White)

Tell the window manager that message dialogs should be given focus when
the user switches from another application back to Vim.  This can
happen, e.g., when the user has a file open in Vim and then edits it
in another program.

fixes: vim#172
closes: vim#16100

Signed-off-by: Chris White <christopher.white@crowdstrike.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>

patch 9.1.0882: too many strlen() calls in insexpand.c

Problem:  too many strlen() calls in insexpand.c
Solution: Refactor insexpand.c and reduce number of calls to STRLEN(),
          fix a warning get_next_filename_completion(), add new function
          ins_compl_leader_len() (John Marriott)

closes: vim#16095

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>

runtime(netrw): Fixing powershell execution issues on Windows

closes: vim#16094

Signed-off-by: GuyBrush <miguel.barro@live.com>

runtime(doc): Expand docs on :! vs. :term

fixes: vim#16071
closes: vim#16089

Signed-off-by: matveyt <matthewtarasov@yandex.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>

rename the files of the chapter one to tutor1

The numbering of lessons in the files of chapter one begins with 1

the files of chapter one
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Dec 7, 2024
Problem:  too many strlen() calls in insexpand.c
Solution: Refactor insexpand.c and reduce number of calls to STRLEN(),
          fix a warning get_next_filename_completion(), add new function
          ins_compl_leader_len() (John Marriott)

closes: vim/vim#16095

vim/vim@5e6ea92

Co-authored-by: John Marriott <basilisk@internode.on.net>
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Dec 15, 2024
Problem:  too many strlen() calls in insexpand.c
Solution: Refactor insexpand.c and reduce number of calls to STRLEN(),
          fix a warning get_next_filename_completion(), add new function
          ins_compl_leader_len() (John Marriott)

closes: vim/vim#16095

vim/vim@5e6ea92

Co-authored-by: John Marriott <basilisk@internode.on.net>
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Dec 18, 2024
Problem:  too many strlen() calls in insexpand.c
Solution: Refactor insexpand.c and reduce number of calls to STRLEN(),
          fix a warning get_next_filename_completion(), add new function
          ins_compl_leader_len() (John Marriott)

closes: vim/vim#16095

vim/vim@5e6ea92

Co-authored-by: John Marriott <basilisk@internode.on.net>
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Jan 9, 2025
Problem:  too many strlen() calls in insexpand.c
Solution: Refactor insexpand.c and reduce number of calls to STRLEN(),
          fix a warning get_next_filename_completion(), add new function
          ins_compl_leader_len() (John Marriott)

closes: vim/vim#16095

vim/vim@5e6ea92

Co-authored-by: John Marriott <basilisk@internode.on.net>
zeertzjq added a commit to zeertzjq/neovim that referenced this pull request Jan 9, 2025
Problem:  too many strlen() calls in insexpand.c
Solution: Refactor insexpand.c and reduce number of calls to STRLEN(),
          fix a warning get_next_filename_completion(), add new function
          ins_compl_leader_len() (John Marriott)

closes: vim/vim#16095

vim/vim@5e6ea92

Co-authored-by: John Marriott <basilisk@internode.on.net>
zeertzjq added a commit to neovim/neovim that referenced this pull request Jan 9, 2025
…31490)

Problem:  too many strlen() calls in insexpand.c
Solution: Refactor insexpand.c and reduce number of calls to STRLEN(),
          fix a warning get_next_filename_completion(), add new function
          ins_compl_leader_len() (John Marriott)

closes: vim/vim#16095

vim/vim@5e6ea92

Co-authored-by: John Marriott <basilisk@internode.on.net>
AbhijithKumble pushed a commit to AbhijithKumble/neovim that referenced this pull request Jan 11, 2025
…eovim#31490)

Problem:  too many strlen() calls in insexpand.c
Solution: Refactor insexpand.c and reduce number of calls to STRLEN(),
          fix a warning get_next_filename_completion(), add new function
          ins_compl_leader_len() (John Marriott)

closes: vim/vim#16095

vim/vim@5e6ea92

Co-authored-by: John Marriott <basilisk@internode.on.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.