aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval
Commit message (Collapse)AuthorAge
* Merge branch 'master' into lazier-arg_errmsg-gettextZyX2017-04-21
|\
| * *: Add comment to all C filesZyX2017-04-19
| |
| * eval/typval_encode: Silence then/else equivalence warningZyX2017-04-16
| |
| * *: Silence some false positivesZyX2017-04-16
| |
| * eval/typval: Remove FUNC_ATTR_MALLOC from tv_list_alloc_retZyX2017-04-15
| | | | | | | | Same as tv_list_alloc, but additionally ret_tv receives pointer to the newly allocated list.
| * eval/typval: Remove FUNC_ATTR_MALLOC from tv_dict_allocZyX2017-04-15
| | | | | | | | | | | | Allocated dict points to previously allocated dict. Queue in allocated dict points to itself. Hashtab in allocated dict points to inside itself. Allocated dict is saved to gc_first_dict.
| * eval/typval: Remove FUNC_ATTR_MALLOC from tv_dict_item_copyZyX2017-04-15
| | | | | | Allocated storage may receive pointer to the list after tv_copy().
| * eval/typval: Remove FUNC_ATTR_MALLOC from tv_list_allocZyX2017-04-15
| | | | | | | | Allocated list points to previously allocated list. Allocated list is saved to gc_first_list.
* | eval/encode: Do translate “… argument” strings, but only in conv_errorZyX2017-04-15
| |
* | eval/typval: Do not translate tv_clear argument, this is uselessZyX2017-04-15
| |
* | unittests: Add a test for TV_CSTRINGZyX2017-04-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not using enum{} because SIZE_MAX exceeds integer and I do not really like how enum definition is described in C99: 1. Even though all values must fit into the chosen type (6.7.2.2, p 4) the type to choose is still implementation-defined. 2. 6.4.4.3 explicitly states that “an identifier declared as an enumeration constant has type `int`”. So it looks like “no matter what type was chosen for enumeration, constants will be integers”. Yet the following simple program: #include <stdint.h> #include <stdio.h> #include <stddef.h> enum { X=SIZE_MAX }; int main(int argc, char **argv) { printf("x:%zu m:%zu t:%zu v:%zu", sizeof(X), sizeof(SIZE_MAX), sizeof(size_t), (size_t)X); } yields one of the following using different compilers: - clang/gcc/pathcc: `x:8 m:8 t:8 v:18446744073709551615` - pcc/tcc: `x:4 m:8 t:8 v:1844674407370955161` If I remove the cast of X to size_t then pcc/tcc both yield `x:4 m:8 t:8 v:4294967295`, other compilers’ output does not change. All compilers were called with `$compiler -std=c99 -xc -` (feeding program from echo), except for `tcc` which has missing `-std=c99`. `pcc` seems to ignore the argument though: it is perfectly fine with `-std=c1000`.
* | eval: Add comment regarding why special values are neededZyX2017-04-14
| |
* | eval: Change the point at which arg_errmsg and its length are changedZyX2017-04-14
|/ | | | Ref #6437
* perf: tv_clear(): Cache gettext() result. (#6519)Justin M. Keyes2017-04-14
| | | Closes #6437
* *: Remove useless assertsZyX2017-04-08
|
* *: Fix linter errorsZyX2017-04-08
| | | | | | Drops comments `// for …` that do not pass linter for them being unmaintainable and fast to becoming incomplete or even incorrect. Mention @dedmass
* eval/*code,shada: Drop support for converting UTF-8 from/to p_encZyX2017-04-08
| | | | Not needed any longer since p_enc is always utf-8.
* eval/decode: Omit calling convert_setup for each stringZyX2017-04-08
| | | Uses the same trick eval/encode does.
* eval/decode,shada: Do not forget to clean up convertersZyX2017-04-08
|
* Add handling for MSGPACK_OBJECT_FLOAT{32,64}James McCoy2017-03-30
| | | | | | msgpack-c previously only had MSGPACK_OBJECT_FLOAT, which was a 64-bit value. Now, 32-bit and 64-bit floats are supported as distinct types, but we'll simply continue to treat everything as 64-bit types.
* eval/executor: Fix check-single-includesZyX2017-03-29
|
* eval/typval,api/buffer: Fix review commentsZyX2017-03-29
|
* eval/typval: Allow NULL dict as tv_dict_get_callback() argumentZyX2017-03-29
| | | Also removes NULL key input: tv_dict_find() does not allow this.
* unittests: Add tv_get number testsZyX2017-03-29
|
* unittests: Test locks sectionZyX2017-03-29
|
* unittests: Add tests for tv_clear()ZyX2017-03-29
|
* eval: Use tv_is_func in place of ==VAR_FUNC||==VAR_PARTIALZyX2017-03-29
| | | | Also fixes same error as in vim/vim#1557
* unittests: Add tv_dict_add* unit testsZyX2017-03-29
| | | | | | | | Also fixes incorrect location of `tv_dict_add` function and three bugs in other functions: 1. `tv_dict_add_list` may free list it does not own (vim/vim#1555). 2. `tv_dict_add_dict` may free dictionary it does not own (vim/vim#1555). 3. `tv_dict_add_dict` ignores `key_len` argument.
* eval/typval: Refactor errors a bit: use emsgf alwaysZyX2017-03-29
|
* eval/typval: Fix SEGV in test_alot.vim testZyX2017-03-29
|
* eval/typval: Fix -Werror=return-typeZyX2017-03-29
|
* *: Make some more things const and with lengthZyX2017-03-29
|
* eval: Make sure that v:_null_dict does not crash dictwatcher*()ZyX2017-03-29
| | | Ref #4615
* eval: Move part of dictwatcher* functions to eval/typvalZyX2017-03-29
|
* eval/typval: More `const` qualifiers in `tv_dict*` function signaturesZyX2017-03-29
|
* unittests: Add tests for tv_list_idx_of_itemZyX2017-03-29
|
* unittests: Add tests for tv_list_find*() functionsZyX2017-03-29
| | | | | | | | Additional modifications: - More `const` qualifiers in tested functions. - `tv_list_find_str()` second argument is more in-line with other `tv_list_find*()` functions.
* eval/typval: Add tv_list_equal() tests, compare NULL lists equalZyX2017-03-29
|
* eval/typval,tests: Fix extending list with itself, add testsZyX2017-03-29
| | | | | Adds unit test for tv_list_extend and regression test for extend() VimL function.
* unittests: Test tv_list_concat()ZyX2017-03-29
|
* eval/typval: Make tv_list_concat handle NULL lists correctlyZyX2017-03-29
| | | | Fixes some FIXMEs in eval/null_spec.lua.
* unittests: Test tv_list_copyZyX2017-03-29
| | | | | | | | | | | | | Also found some bugs: 1. var_item_copy() always fails to copy v:_null_list and v:_null_dict. Fixing this should mean fixing `deepcopy(v:_null_list)` which should’ve been, but was not listed in #4615. This also fixes `deepcopy(v:_null_dict)`. 2. var_item_copy() crashes when trying to copy NULL string with `conv != NULL`. 3. `conv` argument is ignored when copying list unless `deep` is true, but it was not reflected in documentation. 4. `tv_dict_item_alloc_len()` allocated more memory then needed. 5. typvalt2lua was not able to handle self-referencing containers.
* unittests: Test tv_list_item_\* functionsZyX2017-03-29
| | | | To check that memory is free()d correctly.
* eval/typval: Add missing includes, also add a script to find themZyX2017-03-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Contains unfinished attempt to integrate IWYU (ref #549). To finish it different job should be done, specifically: - Instead of feeding IWYU with modified file a mirror source tree should be created with the help of CMake which will contain modified sources. This solves the problem with IWYU thinking that `*.generated.h` headers should be included in place of `*` headers. - Build IWYU as all other third-party utilities. - Make modified sources avoid problems with `nvim/func_attr.h` includes and various related tricks. Current script may only be used for manual checks like this: ./scripts/check-includes.py \ --generated-includes-dir build/include \ --generated-includes-dir build/src/nvim/auto \ --file src/nvim/eval/typval.c \ -- -Isrc -Ibuild/include -Ibuild/src/nvim/auto \ -DINCLUDE_GENERATED_DECLARATIONS (it is also somewhat fine with `--file src/nvim/eval/typval.h`). I have no idea why (I mean, why developer think that these lines are needed, why they are suggested is pretty obvious: because there is typedef which mentions them before structs are defined), but for typval.h it reports, among other things, that it should add lines struct dictvar_S; struct listitem_S; struct listvar_S; struct listwatch_S;
* eval: Move copy_tv to eval/typvalZyX2017-03-29
|
* eval: Fix max_min functionsZyX2017-03-29
| | | | | | Found two bugs: 1. Multiple unneeded error messages, vim/vim#1039. 2. Unformatted error string, vim/vim#1040.
* eval: Move remaining get_tv_string* functions to eval/typval.cZyX2017-03-29
|
* eval: Move free_tv to eval/typval.h, remove most of its usagesZyX2017-03-29
|
* eval: Move get_tv_number[_chk] to eval/typval.cZyX2017-03-29
|
* eval: Refactor get_tv_lnum_bufZyX2017-03-29
|