Commit Graph

1112 Commits

Author SHA1 Message Date
Pavel Platto
c57c3633d4 Remove OOM error handling in khash.h 2014-05-20 16:50:36 +03:00
Thiago de Arruda
0aa8b5828c Merge pull request #699 'Remove cryptography' 2014-05-20 08:31:19 -03:00
John Schmidt
85338fe1d5 Remove cryptography
As discussed in #694, vim encryption uses old,
obsolete algorithms that are poorly implemented.
Since insecure cryptography is worse than no
cryptgraphy, the community voted in favor of
removing all crypto.

Various alternatives to the old crypto is
being discussed in #701.

Closes #694.
2014-05-20 08:31:06 -03:00
Felipe Oliveira Carvalho
e303a11ebf Remove OOM checks: suggested changes in review
- Replace a vim_strsave/free pair with xrealloc
 - Use xmallocz() in some places
 - Use xrealloc() and forget about the NULL pointer case
 - Remove invalid comment
 - Remove unnecessary checks
 - Replace a complicated xmalloc/STRCPY/free code chunk code with xrealloc()
 - Replace a vim_strsave/free code chunk with xrealloc()
2014-05-19 14:50:26 -03:00
Felipe Oliveira Carvalho
7a830d945f Remove OOM checks: viminfo_filename() 2014-05-19 14:50:26 -03:00
Felipe Oliveira Carvalho
f88a2d7e1b Remove OOM checks: do_string_sub() 2014-05-19 14:50:25 -03:00
Felipe Oliveira Carvalho
1d844dda46 Remove OOM checks: expand_tag_fname() and tag_full_name() 2014-05-19 14:50:25 -03:00
Felipe Oliveira Carvalho
6ea2559f6c Remove OOM checks: u_save_line() 2014-05-19 14:50:25 -03:00
Felipe Oliveira Carvalho
1a2364f74e Remove OOM checks: ff_create_stack_element() 2014-05-19 14:50:25 -03:00
Felipe Oliveira Carvalho
8551f4f4c7 Remove OOM checks: mark_line() 2014-05-19 14:50:25 -03:00
Felipe Oliveira Carvalho
bf3d093627 truncate_line() cant't FAIL: change its return type to void 2014-05-19 14:50:25 -03:00
Felipe Oliveira Carvalho
11cae8ec58 Remove OOM checks: backslash_halve_save() 2014-05-19 14:50:25 -03:00
Felipe Oliveira Carvalho
a2f6a53b68 Remove OOM checks: save_typebuf() 2014-05-19 14:50:24 -03:00
Felipe Oliveira Carvalho
39a272c4db Remove OOM checks: alloc_typebuf() 2014-05-19 14:50:24 -03:00
Felipe Oliveira Carvalho
27f5f7b1e8 Remove OOM checks: realloc_cmdbuff()
put_on_cmdline() doesn't FAIL anymore but its return value was
never checked.
2014-05-19 14:50:24 -03:00
Felipe Oliveira Carvalho
eb636858b5 Remove OOM checks: alloc_cmdbuff() 2014-05-19 14:50:24 -03:00
Felipe Oliveira Carvalho
1ca3368ce3 Remove OOM checks: ml_new_data() 2014-05-19 14:50:24 -03:00
Felipe Oliveira Carvalho
679629649b Remove OOM checks: ml_new() 2014-05-19 14:50:24 -03:00
Felipe Oliveira Carvalho
873a137c64 Remove OOM checks: mf_alloc_bhdr() 2014-05-19 14:50:23 -03:00
Felipe Oliveira Carvalho
e5e3cbf320 Remove OOM checks: reverse_text() 2014-05-19 14:50:23 -03:00
Felipe Oliveira Carvalho
21784aeb00 Replace alloc() with xmalloc() and remove immediate OOM checks 2014-05-19 14:50:23 -03:00
Felipe Oliveira Carvalho
a80d7e86c1 Remove NULL/non-NULL tests after calls to vim_str(n)save() 2014-05-19 14:50:23 -03:00
Felipe Oliveira Carvalho
b63d2626ed Implement vim_str(n)save using xstrdup and strncpy/xmalloc 2014-05-19 14:50:22 -03:00
Justin M. Keyes
32d018b57e Merge #735 'nvim namespace fixes regarding YouCompleteMe' 2014-05-19 10:47:51 -04:00
Eliseo Martínez
1f84a4f811 Introduce vim namespace: Contrib YCM: Fix style issues.
Python-mode signaled a couple of issues here:
- Multiple imports on same line.
- Line too long.
2014-05-19 16:24:44 +02:00
Eliseo Martínez
c0e70e1fa5 Introduce vim namespace: Contrib YCM: Fix build dir calculation.
Build directory calculation had not been correctly updated in #716.
2014-05-19 16:24:44 +02:00
Thiago de Arruda
080f5dbd95 Merge pull request #732 from tarruda/map-improvements 2014-05-19 11:01:55 -03:00
Thiago de Arruda
25595d97d5 Improve map module: Refactor vim_to_object_rec
Now the map.c module is used to implement the 'lookup set' for that function
2014-05-19 10:52:15 -03:00
Thiago de Arruda
37dfe2d48f Improve map module: Refactor into a macro library
The map_* declarations and definitions are now created by a macro invocation
with a key type parameter. Also refactored server module to use the updated
version.
2014-05-19 10:52:10 -03:00
Thiago de Arruda
974eade1a6 Improve map module: Change scopes
- Move `Map` structure definition to `map_defs.h`
- Use `KHASH_DECLARE` on map_defs.h to declare khash function prototypes.
- Redefine `map_foreach` into a macro
- Refactor server.c module to use the new `map_foreach` macro.
2014-05-19 10:52:04 -03:00
Thiago de Arruda
eb7513bbd2 Improve map module: Fix implementation of map_has 2014-05-19 10:51:56 -03:00
Thiago de Arruda
b87b1a3325 Improve map module: Add to clint and CONV_SRCS 2014-05-19 10:51:47 -03:00
Justin M. Keyes
93f9023b46 Merge klib upstream.
Silence -Wstrict-prototypes and static analyser warnings

Using "(void)" provides an explicit there-are-no-arguments prototype.
Using the exact type in "malloc(...sizeof)" is clearer and silences
warnings from clang's static analyzer. (John Marshall)
2014-05-19 09:17:27 -04:00
Justin M. Keyes
4fc6e06465 Fix comment typo. 2014-05-19 08:59:24 -04:00
Nicolas Hillegeer
9eb68075d8 api/helpers: implement C string to String helper
Use it in buffers.c
2014-05-18 06:45:39 -03:00
Nicolas Hillegeer
b591447f77 clint: disregard compound literal return
This allows lines like:

return (my_struct_type) {
  .my_int = 5,
  .my_str = ""
};

Thanks to @watk for finding and fixing it!
2014-05-18 06:45:39 -03:00
Thiago de Arruda
96a9b5eaee Fixed outdated comment in option.c 2014-05-17 08:14:54 -03:00
Thiago de Arruda
1f8534684e Removed lalloc prototype(again)
It was re-added by accident when resolving merge conflicts
2014-05-17 08:07:58 -03:00
Thiago de Arruda
83b59e3815 Fix xmemdup function signature 2014-05-17 08:05:44 -03:00
Thiago de Arruda
9920599e5d Replace unnecessary xcalloc call by xmalloc 2014-05-17 08:05:44 -03:00
Thiago de Arruda
45e5a18f3a Enable -Wconversion for API files and fix errors 2014-05-17 08:05:44 -03:00
Thiago de Arruda
76a2fb5667 Use more descriptive names for API primitive types
Instead of exposing native C types to a public API that can be consumed by other
platforms, we are now using the following translation:

int64_t -> Integer
double  -> Float
bool    -> Boolean
2014-05-17 08:05:44 -03:00
Thiago de Arruda
a8b0c9e576 Refactor API to use one integer type: int64_t
This should make the API simpler, and int64_t is enough to represent any integer
value we might need.

Range checks should be done inside the API functions, that way we can modify the
types of the actual fields/variables modified by the API without changes to the
API prototypes.
2014-05-17 08:05:44 -03:00
Thiago de Arruda
b7108002bb Use uintptr_t as the hashtable type in helpers.c 2014-05-17 08:05:44 -03:00
Thiago de Arruda
32b6122460 Remove hardcoded type names from msgpack-gen.lua
Except for the `Error *` type, all parameter types are valid identifiers, so
reuse that LPeg rule.
2014-05-17 08:05:44 -03:00
Felipe Oliveira Carvalho
bd2ab0d8a5 Replace if (ga->ga_len) with if (!GA_EMPTY(ga))
Used Coccinelle to perform the changes

```diff
@@
expression E;
statement S;
@@

(
- if (E.ga_len) S
+ if (!GA_EMPTY(&E)) S
|
- if (E->ga_len) S
+ if (!GA_EMPTY(E)) S
)
```
2014-05-17 07:02:44 -03:00
Felipe Oliveira Carvalho
5209d2271b Replace ga->ga_len == 0 checks with GA_EMPTY(ga)
Used Coccinelle to perform the changes

@@
expression E;
@@

<...
(
// E.ga_len == 0 is isomorphic to !E.ga_len
- E.ga_len == 0
+ GA_EMPTY(&E)
|
- E->ga_len == 0
+ GA_EMPTY(E)
)
...>
2014-05-17 07:02:44 -03:00
Felipe Oliveira Carvalho
b4efff6523 Replace ga->ga_len > 0 checks with !GA_EMPTY(ga)
Used Coccinelle to perform the changes

```diff
@@
expression E;
@@

<...
(
- E.ga_len > 0
+ !GA_EMPTY(&E)
|
- E->ga_len > 0
+ !GA_EMPTY(E)
)
...>
```

`spatch --in-place --sp-file ga_empty.cocci <C_FILE>`
2014-05-17 07:02:44 -03:00
Felipe Oliveira Carvalho
659cd0e99a s/GA_EMPTY/GA_EMPTY_INIT_VALUE/
I'm about to implement a `GA_EMPTY` macro that checks if the GA is empty or not.
2014-05-17 07:02:44 -03:00
Eliseo Martínez
5f795225dc Introduce nvim namespace: Fix define guards.
Change define guards from NEOVIM_XXX_H to NVIM_XXX_H:
- Change header files.
- Change clint correct guard name calculation.
2014-05-15 20:46:02 +02:00