Commit Graph

17821 Commits

Author SHA1 Message Date
Thiago de Arruda
8a61c27b1e Extract shell_count_argc from mch_call_shell 2014-03-31 08:07:46 -03:00
Thiago de Arruda
2d28251a6e Extract shell_skip_word from mch_call_shell 2014-03-31 08:07:46 -03:00
Thiago de Arruda
1ab6cf47bd Split code for counting and parsing arguments 2014-03-31 08:07:46 -03:00
Thomas Wienecke
54782ecfe0 Add doxygen-style comments to functions from os/fs.c. 2014-03-31 07:36:00 -03:00
Thomas Wienecke
6f681faba7 Add basic Doxyfile. 2014-03-31 07:36:00 -03:00
Felipe Oliveira Carvalho
0e998066b2 xrealloc(): similar to xmalloc()
Replaced all calls to realloc by xrealloc. All `== NULL` tests can be removed
and the code within `!= NULL` tests can be unwrapped.
2014-03-31 07:31:47 -03:00
Felipe Oliveira Carvalho
7bdd1f1898 Document xmalloc() and deprecate lalloc() 2014-03-31 07:31:47 -03:00
Felipe Oliveira Carvalho
5afc1161ca Avoid a seg fault when exiting after OOM error
I'm debugging OOM behavior using http://www.nongnu.org/failmalloc/ on Linux.

gdb environment:

```
set env LD_PRELOAD=libfailmalloc.so
set env FAILMALLOC_SPACE=0xF00000
```

SEGV was happening like this:

```
Starting program: /home/felipe/code/neovim/build/bin/nvim
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Vim: Error: Out of memory.

Program received signal SIGSEGV, Segmentation fault.
0x00000000004d3719 in getout (exitval=1) at
/home/felipe/code/neovim/src/main.c:836
836       if (*p_viminfo != NUL)
(gdb)
```

After the fix it works as expected:

```
(gdb) set environment LD_PRELOAD=libfailmalloc.so
(gdb) set environment FAILMALLOC_SPACE=0xF00000
(gdb) r
Starting program: /home/felipe/code/neovim/build/bin/nvim
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Vim: Error: Out of memory.
Vim: Finished.
[Inferior 1 (process 21505) exited with code 01]
(gdb)
```
2014-03-31 07:31:47 -03:00
Felipe Oliveira Carvalho
de1575f3ea xmalloc() that succeeds or gracefully aborts 2014-03-31 07:31:47 -03:00
Justin M. Keyes
a87b73ecb2 update readme: "progress" section; formatting 2014-03-31 07:23:34 -03:00
John Szakmeister
0f6323b8e5 Force the cmake target to re-run the CMake configuration.
This makes it more handy when files are added or removed from the source
tree.  A simple `make cmake` will re-configure and pick up the change.
2014-03-31 04:41:26 -04:00
John Szakmeister
cc9fbd9e55 Use the clang 3.4 release tarball instead of apt for clang 3.4.
It appears the llvm.org/apt/ repository isn't always reliable.  So let's
use the release tarball instead.  Also, make using 3.4 conditional, so
we can use the clang 3.3 if things still manage to go awry in the
future.  Note: using 3.3 means that we won't get leak detection.

I left the logic for using llvm.org/apt/, just in case we want try using
it again sometime.
2014-03-30 21:18:29 -04:00
Justin M. Keyes
d9f5cd6290 Re-integrate FEAT_SIGNS code, close #383
- omit FEAT_NETBEANS_INTG and FEAT_SIGN_ICONS
- omit FEAT_GUI blocks
2014-03-29 20:47:39 -03:00
Nicolas Hillegeer
28b3659955 use function attributes on allocation functions
This should allow gcc/clang/icc to generate better code and clarifies
function intent.
2014-03-29 20:10:06 +01:00
Nicolas Hillegeer
d5708b200a add func_attr.h to be able to use func attribs
Currently enables these for every gnu-like compilers, i.e.: gcc, clang and
icc.
2014-03-29 20:09:57 +01:00
John Schmidt
44e40b02cf Move remove_duplicates to garray.c 2014-03-29 13:29:53 -03:00
John Schmidt
f5154d7451 Extract path.c from misc1.c 2014-03-29 13:29:52 -03:00
John Szakmeister
86180787fa Drop the deb-src for clang.
The llvm.org/apt repo currently has an issue with the source packages,
and we don't need it on Travis anyways.
2014-03-29 10:01:18 -04:00
John Szakmeister
0efc815216 Append to CMAKE_PREFIX_PATH instead setting it outright.
Also, don't set it in the FindXxx cmake scripts--it's unnecessary, and
it resets the value.
2014-03-28 05:09:45 -04:00
Thomas Wienecke
4e29a820b6 Address clint warnings and other style issues.
* Add const.
* Fix conditions (move && from end to start of line).
* Use int32_t instead of long.
* Use //-style comments.
2014-03-27 19:57:55 -03:00
Thomas Wienecke
5762c4e528 Rename mch_* functions to os_* in os module. 2014-03-27 19:57:55 -03:00
Thiago de Arruda
3f7011ab91 Fix prepare watcher teardown in the event loop 2014-03-27 19:22:44 -03:00
Thiago de Arruda
e995b21567 Re-integrate FEAT_FILTERPIPE code
This feature was accidentally removed when doing the initial import from vim. It
makes vim use pipes instead of temporary files for filtering buffers through
shell commands.

I found that this was missing when looking for references of
SHELL_READ/SHELL_WRITE outside mch_call_shell`.

When `mch_call_shell` is reimplemented on top of libuv process management
facilities, pipes will always be used for communication with child processes so
it makes sense to enable the feature permanently.
2014-03-27 17:36:32 -03:00
Thiago de Arruda
1e8eb4e2c6 Make EventType enum private to input.c
This enum doesn't need to be public since `event_poll` is only interested in
user input(but other events may be handled by libuv callbacks).
2014-03-27 17:25:31 -03:00
John Szakmeister
e644f8c2b1 Don't use alias in travis.sh.
We don't want to clobber anyone's make alias when running travis.sh
directly.
2014-03-27 14:43:13 -04:00
Julian Orth
d1ef25728a More cleanup 2014-03-27 14:03:36 -03:00
Julian Orth
380b8048db remove leftover c++ headers 2014-03-27 14:03:36 -03:00
Julian Orth
5a2168a601 remove some leftover function calls 2014-03-27 14:03:35 -03:00
Julian Orth
323e90ee79 remove cpp headers 2014-03-27 14:03:35 -03:00
Julian Orth
f3a77cfd8c remove cpp file extensions 2014-03-27 14:03:35 -03:00
Julian Orth
2b7cd6ebbc remove CleanseRawStrings 2014-03-27 14:03:35 -03:00
Julian Orth
a8e2cab3ef remove C++ only _NestingState parts 2014-03-27 14:03:35 -03:00
Julian Orth
2aadf0daac clean up CheckForNonStandardConstruct
remove C++ stuff and add C types
2014-03-27 14:03:35 -03:00
Julian Orth
23a41ebf8f remove C++ stuff from CheckSpacingForFunctionCall 2014-03-27 14:03:35 -03:00
Julian Orth
95659707a8 remove C++ stuff from CheckSpacing 2014-03-27 14:03:35 -03:00
Julian Orth
ef23bbe6ee remove CheckSectionSpacing
irrelevant
2014-03-27 14:03:35 -03:00
Julian Orth
cb5f1fa51d remove unused function 2014-03-27 14:03:35 -03:00
Julian Orth
67dbb1afda remove some unused variables 2014-03-27 14:03:35 -03:00
Julian Orth
ccc3375d99 remove C++ only stuff from CheckLanguage
Do we want VLAs?
2014-03-27 14:03:35 -03:00
Julian Orth
4bfb03c630 remove "stream check" from CheckIncludeLine
irrelevant
2014-03-27 14:03:35 -03:00
Julian Orth
b3edf6c065 remove CheckForNonConstReference
irrelevant
2014-03-27 14:03:35 -03:00
Julian Orth
1511901467 remove CheckCStyleCast 2014-03-27 14:03:35 -03:00
Julian Orth
38eaa7ed32 remove CheckForIncludeWhatYouUse
Only checks C++ related headers
2014-03-27 14:03:35 -03:00
Julian Orth
cfa070edc5 remove CheckMakePairUsesDeduction
Irrelevant
2014-03-27 14:03:35 -03:00
John
7326894a06 Cleanup of indent.c to make it comply with style guide.
- Uncrustify indent.c
- Fix comments
- Fix whitespace
- Format get_lisp_indent (needs to be refactored completely)
- Fix endline comments
- Change to postincrement
- Fix clint.py errors
- Move static function last
- Fix blank endlines
2014-03-27 11:55:56 -03:00
Thiago de Arruda
452804638d Reimplement input functions on top of libuv
The functions `mch_inchar`, `mch_breakcheck`, `mch_char_avail` were
reimplemented on top of libuv. Here's how it works:

- When Neovim needs to wait for characters, it will transfer control to libuv
  event loop.
- When the libuv event loop gets user input, it will transfer control back to
  Neovim
- Neovim uses the `input_read` function to get the actual data read by libuv.

With this scheme its possible to keep Neovim single-threaded while enjoying the
benefits provided by libuv.

This commit leaves SIGWINCH broken for now
2014-03-26 18:30:18 -03:00
Felipe Oliveira Carvalho
f8432ef127 Use realloc instead of vim_realloc 2014-03-26 18:29:17 -03:00
Felipe Oliveira Carvalho
580ababcb5 HAVE_AVAIL_MEM is always undefined. Remove tests and dead code
Defining HAVE_AVAIL_MEM doesn't even build. The code tries to call
`mch_avail_mem` which is not defined.
2014-03-26 18:29:17 -03:00
Felipe Oliveira Carvalho
83161200c4 Remove MEM_PROFILE related code
Code around `#ifdef MEM_PROFILE` was used to profile vim's memory
comsumption. It's very likely broken as new code is using malloc() and free()
directly.

In this day and age, valgrind can solve in a much reliable way what
this code was trying to do.
2014-03-26 18:29:17 -03:00
Felipe Oliveira Carvalho
bd78282940 Use memcmp instead of vim_memcmp 2014-03-26 16:28:13 -03:00