Commit Graph

30631 Commits

Author SHA1 Message Date
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
Felipe Oliveira Carvalho
07dad7acf3 Use memmove instead of mch_memmove 2014-03-26 16:28:13 -03:00
Petter Wahlman
dbc904956a Prefer enums over incremental defines 2014-03-26 16:26:56 -03:00
Felipe Oliveira Carvalho
ed3e9d51ac Use memset instead of vim_memset
Ran some commands on terminal, reviewed changes, and made some manual changes
too.

    find src | xargs perl -i -p -e "s/vim_memset/memset/g"
    git grep -l memset | egrep "\.c$" | xargs perl -i -p -e \
        's/(#include "vim\.h")/#include <string.h>\n\n\1/g'
2014-03-25 18:57:02 -03:00
Felipe Oliveira Carvalho
68bc6bce29 Do not include farsi.c in main.c
- Change CMakeLists.txt to compile farsi.c normally
 - Add const to global variables in farsi.h and define them in farsi.c (no need
   to include farsi.h with DO_INIT defined in globals.h)
 - Include farsi.h where necessary
 - Include all necessary headers in farsi.c
 - Move farsi function declarations from main.h to farsi.h
2014-03-25 18:48:45 -03:00
Felipe Oliveira Carvalho
b7f953b9e4 Move some #defines from farsi.h to farsi.c 2014-03-25 18:48:45 -03:00
John Szakmeister
f9aeb219c1 Fail RunUnittests if we get a non-zero exit code from busted. 2014-03-25 13:10:26 -04:00
Stefan Hoffmann
7d413050ba fix mch_delay() unittest 2014-03-25 15:41:15 +01:00
Thiago de Arruda
32f118a47f Implement mch_delay on top of libuv
Needed to temporarily move two static variables from os_unix.c to 'globals.h'
as those are shared by other functions still in os_unix.
2014-03-24 19:25:07 -03:00
Felipe Oliveira Carvalho
ed42c808b6 inline arabic_char() 2014-03-24 18:23:24 -03:00
Felipe Oliveira Carvalho
5c66dfea3c Reformat new function in arabic.c to comply with style guide 2014-03-24 18:23:24 -03:00
Felipe Oliveira Carvalho
8b2a5e678e Move arabic.h #defines from arabic.h to arabic.c
- Move arabic_shape() decl from main.h to arabic.h
 - Move arabic_combine() and arabic_maycombine() from mbyte.c to
   arabic.c as these functions use the #defines I moved.
 - Remove the unnecessary include of arabic.h in globals.h
 - Remove include of arabic.c (sic) in main.c (change CMakeLists.txt to compile
   arabic.c normally)
2014-03-24 18:23:24 -03:00
Felipe Oliveira Carvalho
fd6fd35eef Turn ARABIC_CHAR into a function 2014-03-24 18:23:23 -03:00
John Szakmeister
7bd4d68d93 Don't require busted.
Only provide the unittest target if busted was found.  And only build
nvim-test if the unittest target exists by excluding nvim-test from all.
Note: this means nvim-test won't be built by default, but it will be
built when you try to run unittests.
2014-03-23 05:42:18 -04:00
Thiago de Arruda
9a277a612f Update to the newest libuv version 2014-03-22 09:06:38 -03:00
John Szakmeister
66394367f7 Workaround the broken progress feedback in some versions of CMake.
Underneath the hood, CMake uses libcurl and libcurl has had a number of
issues regarding progress feedback.  In one sample run against Travis
CI, we ended up with nearly 3,000 lines of progress output for a single
download.

Unfortunately, CMake doesn't have the download and extract steps
separate, so we have some extra work that we have to do.  Much of the
content was taken from the ExternalProject.cmake and it's template for
generating the content of the download and extract CMake files.
2014-03-21 15:22:00 -04:00
John Szakmeister
1eed86883b Deal with the missing dependencies for libuv.
Since libuv.pc is broken at the moment, try to determine libuv's
dependencies ourselves.  This ports most of the checks from libuv into
our CMake build, and fixes the build on other unix platforms.
2014-03-21 15:22:00 -04:00
John Szakmeister
0b2f6a0cf4 Revamp the build system.
This achieves several goals:

 * Less reliance on scripts so we have better portability to Windows
   (though we still have a ways to go for proper Windows support).
   Luajit, luarocks, moonscript, and busted are all installed via CMake
   now.
 * Trying to make use of pkg-config to get the correct libraries.  The
   latest libuv is still broken in this regard, but we'll at least be in
   a position to use it.
 * Allow the use of Ninja or make.  The former runs faster in many
   environments, and automatically makes use of parallel builds.

This also allows for system installed dependencies--though not through
the Makefile just yet--and adds support for FreeBSD.

This also make us build libuv and luajit as static libraries only, since
we're only concerned about having static libraries for our bundled
dependencies.
2014-03-21 15:22:00 -04:00
Felipe Oliveira Carvalho
5dd0ce4263 printer_opts was left unitilized after #378 2014-03-21 14:13:27 -03:00
Marcel Krüger
7efc429276 No longer try to use standalone termcap 2014-03-19 21:15:40 +01:00
Tayler Mulligan
002f2327fe Homebrew formula builds dependencies through make
This way, if the dependencies change, and the install process needs to
change to accommodate this, the Homebrew formula won't need revising.
2014-03-19 08:00:15 -03:00
Petter Wahlman
edabc6f4c7 adapt to the style guildelines
semi-automated harvest of low hanging fruit:
change the unorthodox use of whitespace.
2014-03-19 07:53:16 -03:00
Felipe Oliveira Carvalho
59f2430a8d Delete structs.h by spliting it and moving code to other headers
Here's the list of squashed commits (for more info, see PR #378).

 - Define guicolor_T as a typedef in syntax.h
 - Move a big chunk of code from structs.h to buffer_defs.h
 - Move aco_save_T from structs.h to fileio.h
 - Move option_table_T from structs.h to hardcopy.h

	Aditionally:

	 - Move the printer_opts global to hardcopy.c
	 - Delete structs.h. Include buffer_defs.h where structs.h was included
	   before.
	 - Add header guards to option_defs.h

 - Put mark types and constants in new mark_defs.h
 - Move undo structs to undo_defs.h
 - Move memfile structs to new memfile_defs.h
 - Move expand_T and cmdmod_T to ex_cmds_defs.h
 - Move memline_T to memline_defs.h
 - Move many defs and types to ex_eval.h
 - Move syntax related types to syntax_defs.h
 - Move struct memfile to memfile_defs.h
 - struct buffblock and struct buffheader moved back to buffer_defs.h
 - Move some datatypes to hashtab.h and eval_defs.h
 - Move the buffer_defs.h include and TODOs for remaining unrelated types in buffer_defs.h
2014-03-18 20:19:19 -03:00
Tayler Mulligan
1fcd332e8e Removed testing for Homebrew installs
Fixes the luarocks/busted error.  Homebrew isn't exactly being
facilitated, so it's not an ideal solution, but it works.
2014-03-18 19:40:23 -03:00
David Z. Chen
baab238271 Issue #311 - Clean up blowfish.c/h, charset.c/h, diff.c/h, digraph.c/h, garray.c/h, hashtab.c/h, popupmnu.c/h, sha256.c/h, version.c/h. Update uncrustify to move logical operators to the beginning of the line when splitting. Also, clean up arabic.c/h and farsi.c/h 2014-03-16 12:00:41 -03:00
aph
8a6118ccac minimize readme 2014-03-16 11:59:41 -03:00
Thomas Wienecke
1949acc806 Revive vim_fname (-> os_file_exists); fix misuse of mch_getperm.
* Move vim_fname from misc1 to os/fs:os_file_exists.
* Add unit tests for os_file_exists.
* Replace misuse of mch_getperm with os_file_exists.
2014-03-15 11:50:22 -03:00
Thomas Wienecke
c83e8b4dc7 Move and refactor mch_[gs]etperm to os/fs module. 2014-03-15 11:50:22 -03:00
Thomas Wienecke
1f578ec5a1 Add unit tests for mch_[gs]etperm.
Use preprocessor trick proposed by @mahkoh to import 'defines' like
S_IRUSR.
2014-03-15 11:50:22 -03:00
John
231d4511d1 Moved more functions from misc1.c to indent.c 2014-03-15 11:42:27 -03:00
James McCoy
a86b1a129e Use include paths relative to src/
As described in Google's style guide, the basis for Neovim's

> All of a project's header files should be listed as descendants of the
> project's source directory without use of UNIX directory shortcuts .
> (the current directory) or .. (the parent directory).

Add src as an include directory to facilitate this.
2014-03-14 21:54:32 -03:00
James McCoy
046bc5f478 Adapt include guards to the style guide 2014-03-14 21:54:32 -03:00
John
7c51374a82 Extract indent_c.c from misc1.c 2014-03-14 21:19:46 -03:00
Felipe Oliveira Carvalho
d012255ee1 Remove useless sizeof(uint32_t) == 4 test 2014-03-14 21:03:28 -03:00
Felipe Oliveira Carvalho
d38b6933e2 Replace UINT32_T by uint32_t 2014-03-14 21:03:28 -03:00
Felipe Oliveira Carvalho
8b498d94d8 Include <stdint.h> in types.h 2014-03-14 21:03:28 -03:00
Julian Orth
7740bdecea add .vimrc and src/.ycm_extra_conf.py 2014-03-14 20:37:03 -03:00
Thiago de Arruda
c3a88eb8ea Remove remaining hangul-related code 2014-03-14 08:29:47 -03:00
oni-link
7f23ec398d Fix: Use an assert to make sure, an error message can be copied into buffer buf in mch_dirname().
The copied error message is NUL-terminated.
2014-03-13 17:25:22 -03:00
Stefan Hoffmann
33eb031c01 refactored part of expand_env_esc() into mch_get_user_directory() 2014-03-13 17:18:44 -03:00
Stefan Hoffmann
ad77ff53d3 removed get_user_name() and replaced calls with mch_get_user_name() 2014-03-13 17:18:44 -03:00