Commit Graph

29954 Commits

Author SHA1 Message Date
Hinidu
39932212d8 Added clint check for TRUE/FALSE 2014-04-07 12:15:28 -03:00
Hinidu
8a2ffb2b01 Use stdbool in os module 2014-04-07 12:15:28 -03:00
Felipe Oliveira Carvalho
c3cea30cb7 Turn Event into a tagged union
If we ever need arbitrary data or more than very few bytes on `Events` we just
have to add a `void *` field in the `data` union.
2014-04-07 00:22:01 -03:00
Felipe Oliveira Carvalho
967fb1aca6 Reimplement the event queue in event.c using klist.h
- Add a new macro to klist.h: kl_empty()

   The whole point of abstract data structures is to avoid reimplementing
   common actions. The emptiness test seems to be such an action.

 - Add a new function attribute to func_attr.h: FUNC_ATTR_UNUSED

   Some of the many functions created by the macros in klist.h may end up not
   being used. Unused functions cause compilation errors as we compile with
   -Werror. To mark those functions as possibly unused we can use the
   FUNC_ATTR_UNUSED now.

 - Pass `Event` by value

   `Event` is such a small struct that I don't think we should allocate heap space
   and pass it by reference. Let's use the stack and memory cache in our favor
   passing it by value.
2014-04-07 00:22:01 -03:00
Felipe Oliveira Carvalho
fac85c1724 Implement xcalloc and use it in klist.h (use xrealloc as well)
Bonus: implement lalloc_clear and alloc_clear using xcalloc
2014-04-07 00:22:01 -03:00
Felipe Oliveira Carvalho
fa02ada732 Add klib.h to src/lib
As decided on #434 [1].

[1] https://github.com/neovim/neovim/issues/434#issuecomment-39111868
[2] https://github.com/attractivechaos/klib
2014-04-07 00:22:01 -03:00
Felipe Oliveira Carvalho
13848aadbf Remove simpler cases of OOM error handling (after *alloc calls)
By simpler cases I mean cases where the OOM error is not expected to be handled
by the caller of the function that calls `alloc`, `lalloc`, `xrealloc`,
`xmalloc`, `alloc_clear`, and `lalloc_clear`.

These are the functions that:

 - Do not return an allocated buffer
 - Have OOM as the only error condition

I took note of the functions that expect the caller to handle the OOM error and
will go through them to check all the callers that may be handling OOM error in
future commits.

I'm ignoring eval.c and ex_.c in this series of commits. eval.c will soon be
obsolete and I will deal with ex_.c in later PRs.
2014-04-06 22:54:59 -03:00
Felipe Oliveira Carvalho
6bbffee0a5 Simplify tricky preprocessor tests in ff_check_visited() 2014-04-06 22:54:59 -03:00
Thiago de Arruda
3843fd3469 Remove unneeded variable in_os_delay
This variable only existed for the old SIGQUIT handler. Now it's no longer
necessary, especially when Neovim stops being a terminal program.
2014-04-06 11:43:23 -03:00
Thiago de Arruda
0b826ef43e Add comments and fix os_microdelay call 2014-04-06 11:43:23 -03:00
Thiago de Arruda
dfb7d826ac Remove RealWaitForChar and mch_new_shellsize
The last occurrence of `RealWaitForChar` was replaced by the `os_microdelay`
function. `mch_new_shellsize` had an empty body, so there seems to be no reason
for keeping it around
2014-04-06 11:43:23 -03:00
Thiago de Arruda
f8970e1c7c Implement os_microdelay and os_delay on top of it 2014-04-06 11:43:23 -03:00
Thiago de Arruda
b6d458e137 Replace strdup calls by xstrdup 2014-04-06 11:32:47 -03:00
Thiago de Arruda
fdec1d126f Implement xstrdup and xstrndup
Utility functions for copying strings to newly-allocated chunks. They either
succeed or exit the program.
2014-04-06 11:32:47 -03:00
oni-link
461b939b01 vim-patch:7.4.178
Problem:    The J command does not update '[ and '] marks. (William Gardner)
Solution:   Set the marks. (Christian Brabandt)

https://code.google.com/p/vim/source/detail?r=647e6bb15aa3f864eaf447fe77e3e3ae7e37b134
2014-04-06 11:31:12 -03:00
Thiago de Arruda
a02bcc0d2f Use early return for rejecting_deadly in signal_cb 2014-04-06 07:24:46 -03:00
oni-link
74f54d78d9 vim-patch:7.4.173
Problem:    When using scrollbind the cursor can end up below the last line.
            (mvxxc)
Solution:   Reset w_botfill when scrolling up. (Christian Brabandt)

https://code.google.com/p/vim/source/detail?r=233ad7b960d0fbeb224b383918113b25c74ebe35
2014-04-06 06:56:13 -03:00
Stefan Hoffmann
e76249c813 Moved mch_get_host_name and renamed it to os_get_hostanme 2014-04-05 20:19:38 -03:00
Stefan Hoffmann
a8013f2bb1 Moved mch_get_pid and renamed it to os_get_pid 2014-04-05 20:19:38 -03:00
oni-link
f545afaed0 vim-patch:7.4.171
Problem:    Redo does not set v:count and v:count1.
Solution:   Use a separate buffer for redo, so that we can set the counts when
            performing redo.

https://code.google.com/p/vim/source/detail?r=beb037a6c2708f539d50840637f70eed0811d93c
2014-04-05 20:17:32 -03:00
Thiago de Arruda
57cd2d6614 Remove the old mch_call_shell implementation 2014-04-05 11:05:31 -03:00
Thiago de Arruda
2dcae28328 Rewrite mch_call_shell on top of libuv
- Rename to `os_call_shell`
- Use another entry point for libuv default event loop
- Fix the `call_shell` reference in misc2.c
2014-04-05 11:05:31 -03:00
Thiago de Arruda
796b79db8c Stop queueing events when signals are rejected
The only exception is SIGINT, which will set `got_int` directly. This will be
necessary for the new implementation of `mch_call_shell`
2014-04-05 11:05:31 -03:00
Thiago de Arruda
cb9afe0dc0 Add helpers for debugging with valgrind
The environment variable USE_VALGRIND can be set to run tests with valgrind. If
VALGRIND_GDB is set, valgrind will start it's own gdbserver for remote
debugging with `target remote | vgdb`. USE_GDB can still be used, but it will
be ignored if USE_VALGRIND is set.
2014-04-05 11:05:31 -03:00
oni-link
ade0c127e5 vim-patch:7.4.172
Problem:    The blowfish code mentions output feedback, but the code is
	        actually doing cipher feedback.
Solution:   Adjust names and comments.

https://code.google.com/p/vim/source/detail?r=391e10afccf6879dcfab8b28cb1587a13eb835c0
2014-04-05 10:10:08 -03:00
John Schmidt
26206d4cfd Remove mblen() check 2014-04-05 10:01:22 -03:00
John Schmidt
5ff29e00a5 Remove xterm_save 2014-04-05 10:01:22 -03:00
John Schmidt
866584542b Remove xpm 2014-04-05 10:01:22 -03:00
John Schmidt
8731d44996 Remove tcl 2014-04-05 10:01:22 -03:00
John Schmidt
f226a4c2cd Remove ole 2014-04-05 10:01:22 -03:00
John Schmidt
84b06b77bd Remove mzscheme 2014-04-05 10:01:22 -03:00
John Schmidt
8074945788 Remove python, perl, lua, ruby 2014-04-05 10:01:22 -03:00
John Schmidt
acf5757831 Remove Xim 2014-04-05 10:01:22 -03:00
John Schmidt
d568548aa1 Remove clientserver 2014-04-05 10:01:22 -03:00
John Schmidt
5ae8094fb4 Remove BalloonEval 2014-04-05 10:01:22 -03:00
John Schmidt
fe7160b1d7 Remove HPUX and Vim 5.x compatible digraphs 2014-04-05 10:01:21 -03:00
John Schmidt
44a6f194b4 Remove SniFF 2014-04-05 10:01:21 -03:00
John Schmidt
8a0043130f Remove Amiga stuff 2014-04-05 10:01:21 -03:00
John Schmidt
2fe018ab88 Remove netbeans and sun workshop 2014-04-05 10:01:21 -03:00
aph
23dc43919e remove reference to BROKEN_TOUPPER 2014-04-04 21:44:58 -03:00
aph
0954e608ce remove pchar from macros.h 2014-04-04 21:44:58 -03:00
aph
4c4880b69f remove MB_{IS,TO}{UPPER,LOWER} 2014-04-04 21:44:58 -03:00
aph
535c450c72 remove DO_AUTOCHDIR 2014-04-04 21:44:58 -03:00
Markus Breitenberger
94013a73f7 Remove unused define 2014-04-04 21:22:00 -03:00
Stefan Hoffmann
092bdcac90 Removed not defined prototypes in os_unix.h
* reset_signals, vim_handle_signal:
    signal handling was rewritten, not defined anywhere

  * related to x clipboard handling, not defined anywhere:
    * {setup,start,stop,clear}_xterm_clip
    * stop_xterm_trace
    * clip_xterm_{own_selection,lose_selection,request_selection,set_selection}

  * related to XSMP (x session management protocol):
    * xsmp_{handle_requests,init,close}
2014-04-04 19:09:01 -03:00
oni-link
04cdcfa604 vim-patch:7.4.170
Problem:    Some help tags don't work with ":help". (Tim Chase)
Solution:   Add exceptions.

https://code.google.com/p/vim/source/detail?r=8122eab8fcdbbdaac62dfbf7c6458cb3e6f46b04
2014-04-04 19:08:21 -03:00
Wilberto Morales
0f9ca8d7fa Possible string literals that have to be replaced 2014-04-04 16:39:49 -03:00
Wilberto Morales
8943a13d9b Try to find all other instances of vimrc and gvimrc and prefix them with n 2014-04-04 16:39:49 -03:00
John Schmidt
6f53cb1cc3 Extract memory.c from misc2.c 2014-04-04 16:33:12 -03:00
Keerthan Jaic
3fe0580a8e vim-patch:7.4.169
Problem:    ":sleep" puts cursor in the wrong column. (Liang Li)
Solution:   Add the window offset. (Christian Brabandt)

https://code.google.com/p/vim/source/detail?r=4e3a9dd25d428e7c08ed401afc244972e27e08e6
2014-04-04 16:05:12 -03:00