aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/if_cscope.c
Commit message (Collapse)AuthorAge
* lintJames McCoy2016-10-09
|
* if_cscope: Fix conversion warnings when char defaults to unsignedJames McCoy2016-10-09
| | | | | | | | | | | | | | | | | | | | | | | ../src/nvim/if_cscope.c: In function 'cs_read_prompt': ../src/nvim/if_cscope.c:1771:47: warning: comparison is always true due to limited range of data type [-Wtype-limits] while ((ch = (char)getc(csinfo[i].fr_fp)) != EOF && ch != CSCOPE_PROMPT[0]) ^~ ../src/nvim/if_cscope.c:1804:14: warning: comparison is always false due to limited range of data type [-Wtype-limits] if (ch == EOF) { ^~ ../src/nvim/if_cscope.c:1816:14: warning: negative integer implicitly converted to unsigned type [-Wsign-conversion] ch = EOF; ^~~ ../src/nvim/if_cscope.c:1821:12: warning: comparison is always false due to limited range of data type [-Wtype-limits] if (ch == EOF) ^~ Since EOF is -1, it will be converted to a large unsigned value to compare with unsigned char and never match. Use an int to store the return from getc so we can safely compare it and, once known to be valid, cast it to char when storing it into buf. Signed-off-by: James McCoy <jamessan@jamessan.com>
* Merge #5254 from KillTheMule/vim-7.4.1952Justin M. Keyes2016-09-18
|\ | | | | vim-patch:7.4.{1952, 1990, 2033, 2284}
| * LintKillTheMule2016-08-26
| |
| * vim-patch:7.4.1990KillTheMule2016-08-26
| | | | | | | | | | | | | | | | | | Problem: Cscope items are not sorted. Solution: Put the new "a" command first. (Ken Takata) https://github.com/vim/vim/commit/80632db65e8f5f775dadbbc10c5ba6c173ebb24f All changes applied manually.
| * vim-patch:7.4.1952KillTheMule2016-08-26
| | | | | | | | | | | | | | | | | | Problem: Cscope interface does not support finding assignments. Solution: Add the "a" command. (ppettina, closes vim/vim#882) https://github.com/vim/vim/commit/b12e7ef956e0b0344778b7ef93d41f4b4ed2a670 All changes applied manually.
* | refactor: eliminate misc2.cJustin M. Keyes2016-09-13
|/ | | | | | | | | | move `call_shell` to misc1.c Move some fns to state.c Move some fns to option.c Move some fns to memline.c Move `vim_chdir*` fns to file_search.c Move some fns to new module, bytes.c Move some fns to fileio.c
* os/fs: Rename os_file_exists to os_path_exists (#4973)Daniel Xu2016-07-06
| | | | Because the old name did not indicate that the function would return true on directories as well.
* Linting.KillTheMule2016-04-23
|
* vim-patch:7.4.822KillTheMule2016-04-23
| | | | | | | | | | Problem: More problems reported by coverity. Solution: Avoid the warnings. (Christian Brabandt) https://github.com/vim/vim/commit/cde885473099296c4837de261833f48b24caf87c Applied manually. Files that do not exst anymore: gui.c gui_w16.c gui_w32.c if_xcmdsrv.c os_unix.c
* Merge tempfile.c back into fileio.cJurica Bradaric2016-04-20
|
* cscope: Fix mismatched types in ':cscope show' outputMike Wadsten2016-04-10
| | | | | | | | Type long on 32-bit systems is typically 32 bits, but PRId64 is 64 bits. This mismatch leads to bad output or segfaults on :cs show. Fixes #4537
* cs_print_tags_priv: Clean up function.oni-link2016-01-21
| | | | | | * Style changes * Variable removal * Comment update
* cs_print_tags_priv: Clear first output line to screen endoni-link2016-01-21
| | | | | | | | | Using `:cscope find s <cword>` with the cursor on a very short word like `key` does not output the first line on the screen correctly: Output is `Cscope tag: keyrd>` instead of `Cscope tag: key`. To fix this, clear the screen line after the first line was printed.
* coverity/133892: Resource leakoni-link2016-01-21
| | | | | | | Variable tbuf going out of scope leaks the storage it points to. We don't have to use the copy tbuf of a match. Because matches are always in ctags style, we can operate on them directly.
* coverity/133858: Out-of-bounds accessoni-link2016-01-21
| | | | | | Allocating insufficient memory for the terminating NUL of the string. False positive, we allocating more memory than we need.
* coverity/13753: Dereference null return valueoni-link2016-01-21
| | | | | | | | Dereferencing a pointer that might be null(ptag) when calling strlen(). False positive. A match always contains a tab, so ptag is never null. Because matches are always in ctags style, we can rewrite the code to not use strtok().
* Windows: Include <fcntl.h> for file constants.Seth Jackson2016-01-17
| | | | | | This header is required by POSIX for the constants (O_RDONLY, etc.) but we were only including it on Unix systems as a side effect of including <unistd.h>.
* misc: UNIX => Unix #4022Seth Jackson2016-01-16
| | | | | | | | | | Although UNIX is a registered trademark of The Open Group, it doesn't really matter whether we refer to these systems as UNIX, Unix, or Unix-like. So, for consistency, refer to them collectively as Unix. Related: http://www.greens.org/about/unix.html http://www.unixica.com/html/unixunix.html
* Windows: Bring back code branch for if_cscope.Rui Abreu Ferreira2016-01-01
| | | | | The Vim code for windows in if_cscope.c/.h was removed during the refactor, added missing code for error_closing().
* Merge pull request #3879 from sethjackson/open-osfhandleJustin M. Keyes2015-12-26
|\ | | | | Windows: Fix cast in if_cscope.c
| * Windows: Fix cast in if_cscope.c.Seth Jackson2015-12-21
| |
* | Windows: Remove unused function #3878Seth Jackson2015-12-22
|/ | | | The only call site was removed in 902ad8d.
* src/*: Remove `VIM - Vi improved ...` headerMichael Reed2015-11-27
| | | | | | | | | | | | | | | | | | | Regarding the individual items in the header: `Vim - Vi improved by Bram Moolenar` Bram Moolenar is already mentioned throughout the documentation, as well as the intro screen. `:help uganda` It's already shown to all users who don't use `shortmess+=I` upon starting nvim, and is already placed prominently in help.txt, i.e., `:help` run with no arguments. `:help credits` Already mentioned near the top of help.txt. `README.md` Already mentioned in develop.txt.
* src: README.txt -> README.mdMichael Reed2015-11-23
| | | | | The former no longer exists in this repo; see the top of src/nvim/README.md.
* Enable -Wconversion: if_cscope.c #3068cztchoice2015-09-23
| | | | | Helped-by: Gustaf Lindstedt <gustaflindstedt@gmail.com> Helped-by: Wander Nauta <info@wandernauta.nl>
* os/os_defs.h cleanup: Remaining signal stuffMichael Reed2015-08-27
| | | | | | | | | | | | RETSIGTYPE, SIGRETURN, and SIGDEFARG are always defined the same, so inline them for simplicity; SIGDUMMYARG, however, is unused, so remove it. Even if these things don't work on windows, the signal handler in if_cscope.c is already wrapped with '#idef UNIX', as is its only call site. Reviewed-by: Justin M. Keyes <justinkz@gmail.com>
* rstream/wstream: Unify structures and simplify APIThiago de Arruda2015-07-17
| | | | | | | | | | | | | - Simplify RStream/WStream API and make it more consistent with libuv. - Move into the event loop layer(event subdirectory) - Remove uv_helpers module. - Simplify job/process internal modules/API. - Unify RStream and WStream into a single structure. This is necessary because libuv streams can be readable and writable at the same time(and because the uv_helpers.c hack to associate multiple streams with libuv handle was removed) - Make struct definition public, allowing more flexible/simple memory management by users of the module. - Adapt channel/job modules to cope with the changes.
* input: stream_set_blocking(): libuv implJustin M. Keyes2015-05-27
| | | | | | | | | - Create a private libuv loop instead of re-using uv_default_loop(), to avoid conflict[1] with existing watcher(s) on the fd. - Expose the global "input" fd as a getter instead of a mutable global. [1] .deps/build/src/libuv/src/unix/core.c:833: uv__io_stop: Assertion `loop->watchers[w->fd] == w' failed.
* input: set input stream to blocking on exitJustin M. Keyes2015-05-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If stdin is non-blocking, many tools (e.g. cat(1), read(1)) which assume that stdin is blocking, will break in odd ways: read: read error: 0: Resource temporarily unavailable cat: -: Resource temporarily unavailable rm: error closing file libuv puts stdin in nonblocking mode, and leaves it that way at exit (this is apparently by design). So, before this commit, this always works (because the shell clobbers O_NONBLOCK): $ nvim --cmd q $ read ...but these forms do _not_ work: $ nvim --cmd q && read $ echo foo | nvim --cmd q && read $ nvim && read After this commit, all of the above forms work. Background: https://github.com/fish-shell/fish-shell/commit/437b4397b9cf273922ce7b414bf6626845f15ad0#diff-41f4d294430cd8c36538999d62681ae2 https://github.com/fish-shell/fish-shell/issues/176#issuecomment-15800155 - bash (and other shells: zsh, tcsh, fish), upon returning to the foreground, always sets fd 0 back to blocking mode. This practice only applies to stdin, _not_ stdout or stderr (in practice these fds may be affected anyways). - bash/zsh/tcsh/fish do _not_ restore the non-blocking status of stdin when _resuming a job_. - We do _not_ save/restore the original flags visible to fcntl(F_[SG]ETFL), because (counterintuitively) that isn't expected. Helped-by: oni-link <knil.ino@gmail.com> Closes #2086 Closes #2377 --- Note: The following implementation of stream_set_blocking() was discarded, because it resulted in a failed libuv assertion[1]: int stream_set_blocking(int fd, bool blocking) { uv_pipe_t stream; uv_pipe_init(uv_default_loop(), &stream, 0); uv_pipe_open(&stream, fd); int retval = uv_stream_set_blocking((uv_stream_t *)&stream, blocking); uv_close((uv_handle_t *)&stream, NULL); return retval; } [1] .deps/build/src/libuv/src/unix/core.c:833: uv__io_stop: Assertion `loop->watchers[w->fd] == w' failed.
* Remove char_u: message:smsg_attr()Michael Reed2015-05-13
|
* Remove char_u: message:smsg()Michael Reed2015-05-13
|
* Remove char_u: concat_fnames()Mark Bainter2015-05-06
|
* Enable -Wconversion: normal.c.Eliseo Martínez2015-04-27
| | | | | | | | | | | | | | | | | | | | | | | | Refactor summary: - extern int opcount --> extern long opcount - bool find_decl(..., int len, ...) --> bool find_decl(..., size_t len, ...) * int find_ident_under_cursor(...) --> size_t find_ident_under_cursor(...) - int find_ident_at_pos(...) --> size_t find_ident_at_pos(...) - int modify_fname(..., int *usedlen, ..., int *fnamelen) --> int modify_fname(..., size_t *usedlen, ..., size_t *fnamelen) * char_u *eval_vars(..., int *usedlen, ...) --> char_u *eval_vars(..., size_t *usedlen, ...) - int find_cmdline_var(..., int *usedlen) --> ssize_t find_cmdline_var(..., size_t *usedlen) - static char_u *repl_cmdline(..., int srclen, ...) --> static char_u *repl_cmdline(..., size_t srclen, ...) - bool get_visual_text(..., int *lenp) --> bool get_visual_text(..., size_t *lenp) * char_u *find_file_name_in_path(..., int len, ...) --> char_u *find_file_name_in_path(..., size_t len, ...) - static char_u *eval_includeexpr(..., int len) --> static char_u *eval_includeexpr(..., size_t len) - char_u *find_file_in_path(..., int len, ...) --> char_u *find_file_in_path(..., size_t len, ...) * char_u *find_file_in_path_option(..., int len, ...) --> char_u *find_file_in_path_option(..., size_t len, ...) - char_u *find_directory_in_path(..., int len, ...) --> char_u *find_directory_in_path(..., size_t len, ...) * int spell_move_to(...) --> size_t spell_move_to(...) - int spell_check(...) --> size_t spell_check(...) - static int spell_bad_len --> static size_t spell_bad_len - void find_pattern_in_path(..., int len, ...) --> void find_pattern_in_path(..., size_t len, ...) Helped-by: Justin M. Keyes <justinkz@gmail.com>
* Replace VIM_ISDIGIT() and vim_isdigit() with ascii_isdigit() defined in ascii.hFelipe Oliveira Carvalho2015-04-24
|
* Replace vim_iswhite with ascii_iswhite() defined in ascii.hFelipe Oliveira Carvalho2015-04-24
|
* memory: Add `free` wrapper and refactor project to use itThiago de Arruda2015-04-13
| | | | | | We already use wrappers for allocation, the new `xfree` function is the equivalent for deallocation and provides a way to fully replace the malloc implementation used by Neovim.
* refactor: split some more functions from misc1.cbobtwinkles2015-03-24
| | | | | | | | | | | This commit pulls the some environment-variable handling functions out of misc1.c and in to os/env.c. Previously submited as #1231, this is the start of a patch series that does that work based on a more up-to-date master branch. Major tasks accomplished: - move functions and fix includes - fix clint/clang analysis warnings - correct documentation comments
* Remove redundant castsAnton Ovchinnikov2015-03-09
|
* coverity/68610: Out-of-bounds access: FP.Eliseo Martínez2015-02-02
| | | | | | | | | | Diagnostic : False positive. Rationale : Coverity thinks we are forgetting to add more char to hold NULL, but it's not taking into account that two chars from cntxformat will no be present in the result. In fact, we can even allocate one byte less than currently done. Resolution : Add explanatory comment and allocate one less byte. Marked as "Intentional" at coverity's database.
* Remove nonnullret deadcode: xmalloc & xrealloc.Eliseo Martínez2015-01-27
|
* ui: Remove redundant ui.h includesThiago de Arruda2014-11-27
| | | | Also move read_error_exit to os/input.c
* ui: Remove ui_delay, ui_breakcheck and ui_set_shellsizeThiago de Arruda2014-11-27
| | | | | These functions only used to call another os_* function, so remove them and replace all occurences in the project.
* fileid: rename os_file_id_equal_file_infoStefan Hoffmann2014-08-31
|
* fileid: rename os_file_id_equalStefan Hoffmann2014-08-31
|
* fileinfo: rename os_file_info_get_idStefan Hoffmann2014-08-31
|
* fileinfo: rename os_get_file_info{,_link,_fd}Stefan Hoffmann2014-08-31
|
* Extract `tempfile` module from fileioPavel Platto2014-07-14
| | | | | | | Though this module is relatively small it has very clear boundaries. The last argument for extracting `tempfile` was the errors which I got when I was writing unittests for it: `cimport './src/nvim/fileio.h'` does not work for some reason.
* Refactor vim_tempnamePavel Platto2014-07-14
| | | | | | | | | - temp_count is uint32_t now instead of long because it supposed to be at most 999999999 (comment on line 5227) temporary files. The most probably it was a long for compatibility with systems where int is 16-bit. - Use "nvim" as prefix for temp folder name instead of "v" - Remove unused parameter from vim_tempname
* move errno.h include out of vim.hBrandon Coleman2014-07-09
|