aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/hashtab.c
Commit message (Collapse)AuthorAge
* vim-patch:8.0.0074Michael Schupikov2017-12-15
| | | | | | | | | | Problem: Cannot make Vim fail on an internal error. Solution: Add IEMSG() and IEMSG2(). (Domenique Pelle) Avoid reporting an internal error without mentioning where. https://github.com/vim/vim/commit/95f096030ed1a8afea028f2ea295d6f6a70f466f Signed-off-by: Michael Schupikov <michael@schupikov.de>
* *: Add comment to all C filesZyX2017-04-19
|
* *: Move some dictionary functions to typval.h and use char*ZyX2017-03-29
| | | | Also fixes buffer reusage in setmatches() and complete().
* *: Partial string handling refactoringZyX2017-02-15
| | | | | | | | Main points: - Replace `char_u` with `char` in some cases. - Remove `str[len] = NUL` hack in some cases when `str` may be considered `const`.
* unittest: Add dict_items functionZyX2017-01-07
|
* vim-patch:7.4.1707Michael Ennen2016-11-25
| | | | | | | Problem: Cannot use empty dictionary key, even though it can be useful. Solution: Allow using an empty dictionary key. https://github.com/vim/vim/commit/0921ecff1c5a74541bad6c073e8ade32247403d8
* 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
* 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.
* Reduce indentation level by early returning or continuing loopFelipe Oliveira Carvalho2014-12-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace code like this ```c func() { if (cond) { ... ... ... } return ret; } ``` ```c for (...) { if (cond) { ... ... ... } } ``` with ```c func() { if (!cond) { return ret; } ... ... ... } ``` ```c for (...) { if (!cond) { continue; } ... ... ... } ```
* move assert.h include out of vim.hBrandon Coleman2014-07-09
|
* move <inttypes.h> include out of vim.hBrandon Coleman2014-07-09
|
* move ascii.h include out of vim.hBrandon Coleman2014-07-09
|
* No OOM in hash_may_resize() and hash_add_item()Felipe Oliveira Carvalho2014-06-16
| | | | hash_add() can still return FAIL if the key already exists.
* Add automatic generation of headersZyX2014-06-02
| | | | | | | | | | | | | | | | | - The 'stripdecls.py' script replaces declarations in all headers by includes to generated headers. `ag '#\s*if(?!ndef NEOVIM_).*((?!#\s*endif).*\n)*#ifdef INCLUDE_GENERATED'` was used for this. - Add and integrate gendeclarations.lua into the build system to generate the required includes. - Add -Wno-unused-function - Made a bunch of old-style definitions ANSI This adds a requirement: all type and structure definitions must be present before INCLUDE_GENERATED_DECLARATIONS-protected include. Warning: mch_expandpath (path.h.generated.h) was moved manually. So far it is the only exception.
* Remove long_u: hashtab: Enable clint: Add to clint.Eliseo Martínez2014-05-24
| | | | | - Add hashtab.[ch] to clint file. - Fix clint errors.
* Remove long_u: hashtab: Refactor other types.Eliseo Martínez2014-05-24
| | | | | | | | Current type of some other parameters/variables can be improved: - hashtab_T : ht_error : int -> bool. - hash_clear_all() : off : int -> unsigned int. - hash_clear_all() : todo : long -> size_t. - hash_may_resize() : todo : int -> size_t.
* Remove long_u: hashtab: Refactor long_u type.Eliseo Martínez2014-05-24
| | | | | | | | | | | | | | | | | | | | | | | | hashtab.h: - hash_T: long_u -> size_t. In principle, a hash value could thought of as just an unsigned number without size semantics (uint32_t or uint64_t). But it is used as index at some places, and so, size_t is also eligible. Therea re some places where assignments occur between hash_T and size_t variables, in both directions. Therefore, if we define hash_T to be of a type having a different width than that of size_t, we will have an incorrect assignment somewhere that will require an assert/guard. So the most sensible option here seems to do hast_T to be size_t too. - hashtab_T.ht_mask: long_u -> hash_T. Masks are used to be combined with hash_T values, so they should be of the same type. hashtab.c: - hash_may_resize(): oldsize: long_u -> size_t. - hash_may_resize(): newsize: long_u -> size_t. - hash_may_resize(): newmask: long_u -> hash_T.
* Remove long_u: hashtab: Enable -Wconversion.Eliseo Martínez2014-05-24
| | | | | | | | | - Add hashtab.c to converted files list. - Fix conversion issues: * hash_lookup() : idx : unsigned -> hash_T. * hash_may_resize() : minitems : int -> size_t. * hash_may_resize() : newi : unsigned -> hash_T. * hash_may_resize() : minsize : long_u -> size_t.
* Remove long_u: hashtab: Cleanup: Others.Eliseo Martínez2014-05-24
| | | | | | | | | | | | | | | | | hashtab.h: - Add missing includes. - Move hash_T to the top and use it to define hashtab_T. - Move hash_removed related definitions to the top, as they are used in the definition of hashtab_T. - Reformat multiline expression (start continuation with operator). - Reformat function declaration into one single line. hashtab.c: - Use C99 style variable declarations (move declarations as near to first-usage point as possible). - Simplify oldarray/newarray computation. - Simplify unneeded else branch. - Remove redundant casts.
* Remove long_u: hashtab: Cleanup: Comments.Eliseo Martínez2014-05-24
| | | | | - Restyle comments (/// when appropiate, // otherwise). - Improve comments (add new comments, augment/clarify existing ones).
* Replace alloc() with xmalloc() and remove immediate OOM checksFelipe Oliveira Carvalho2014-05-19
|
* Introduce nvim namespace: Fix project-local includes.Eliseo Martínez2014-05-15
| | | | Prepend 'nvim/' in all project-local (non-system) includes.
* Introduce nvim namespace: Move files.Eliseo Martínez2014-05-15
Move files from src/ to src/nvim/. - src/nvim/ becomes the new root dir for nvim executable sources. - src/libnvim/ is planned to become root dir of the neovim library.