Commit Graph

1305 Commits

Author SHA1 Message Date
Pavel Platto
f9710fba52 Remove HAVE_MKDTEMP
For now we provide simple `mkdtemp` for Windows, in the future we will
use libuv for that.
2014-07-14 21:14:39 +02:00
Pavel Platto
8b91ba929b Temporary os_mkdtemp implementation. Use it instead of mkdtemp. 2014-07-14 21:14:39 +02:00
Pavel Platto
47084ea765 Use strict function prototypes #945
`-Wstrict-prototypes` warn if a function is declared or defined without
specifying the argument types.

This warning disallow function prototypes with empty parameter list.
In C, a function declared with an empty parameter list accepts an
arbitrary number of arguments when being called. This is for historic
reasons; originally, C functions didn't have prototypes, as C evolved
from B, a typeless language. When prototypes were added, the original
typeless declarations were left in the language for backwards
compatibility.
Instead we should provide `void` in argument list to state
that function doesn't have arguments.

Also this warning disallow declaring type of the parameters after the
parentheses because Neovim header generator produce no declarations for
old-stlyle prototypes: it expects to find `{` after prototype.
2014-07-14 20:28:40 +02:00
Pavel Platto
2dc69700ec Use default busted pattern for unittests #943
- Unittest should contain substring '_spec' in filename.
- This is the simplest way to use both lua and moonscript tests.
- This prevents running of non-test scripts from test folder.
2014-07-14 20:08:39 +02:00
Justin M. Keyes
f693b4043d Merge #846 'impl mch_open with libuv' 2014-07-14 09:06:36 -04:00
Justin M. Keyes
0ceebc2c91 os_open: add unit tests 2014-07-14 09:05:52 -04:00
Justin M. Keyes
180c84ed37 os_open: impl mch_open with libuv. ref #133
- use return value instead of open_req.result
- libuv uv_fs_open() returns `-errno` instead of always -1
- libuv always sets open_req.result to the return value, _except_ for OOM
  where it only sets the return value. So always use the return value.
- replace calls to mch_open macro.
- update call sites expecting -1 error
2014-07-14 09:04:54 -04:00
Nicolas Hillegeer
bf6b0e3c0a Merge #874 'fix TCP connection (issue #870)' 2014-07-13 14:20:46 +02:00
André Twupack
f44e908c11 os/server: Fix possible port overflow
- add documentation about port being optional
- parse port into long and check for valid value
2014-07-13 14:20:18 +02:00
André Twupack
fa5615022c os/server: Fix TCP connection
- remove unused errno
- remove unused port_end
- correct calculation of addr_len
- use correct string length during IP copy
2014-07-13 14:20:18 +02:00
André Twupack
7c473dc0a2 os/server: Fix indentation 2014-07-13 14:20:18 +02:00
Nicolas Hillegeer
5d53c51fae Merge #837 'Move defines from vim.h - phase2' 2014-07-12 14:28:58 +02:00
Brandon Coleman
a32df5e734 move defines from vim.h
buffer.h:
   buflist_getfile() flags
   buflist_new() flags
   buf_freeall() flags
   do_buffer() flags

charset.h:
   chartab[] flags

edit.h:
   in_cinkeys() flags
   change_indent() flags
   beginline() flags
   insertchar() flags
   nv_mousescroll() flags

eval.c
   AUTOLOAD_CHAR

eval.h:
   enum for vimvars[]

ex_cmds.h:
   do_ecmd
   read_viminfo flags

ex_cmds2.h:
   check_changed() flags
   do_source() flags

ex_cmds_defs.h:
   BAD_* flags

ex_docmd.h:
   VALID_PATH VALID_HEAD
   EXMODE_*
   do_cmdline() flags
added include

ex_getln.c
   *_ESC_CHARS definitions

ex_getln.h:
   history table flags - used by add_to_history()

fileio.h:
   readfile() flags
   event_T definition

getchar.h:
   ins_typebuf() flags
   KEYLEN_*

globals.h:
   NO_SCREEN
   NO_BUFFERS
   SEA_* defines
   current_SID flags
   hlf_T enum
   HL_FLAGS
   do_profiling() flags
   schar_T
   sattr_T

indent.h:
   set_indent() flags

macros.h:
   BINARY_FILE_IO flags

mbyte.h:
   MB_BYTE2LEN*
   ENC_*

memfile.h:
   mf_sync() flags

misc1.h:
   open_line() flags

message.h:
   do_dialog() flags
   vim_dialogyesno() flags
   DLG_BUTTON_*

normal.h:
   find_ident_under_cursor() flags

ops.h:
   do_put() flags
   operator ID's

option.h:
   buf_copy_options() flags
   OPT_* flags

os_unix.h:
   mch_nodetype() flags

quickfix.h:
   skip_vimgrep_pat() flags

regexp.h:
   vim_regcomp() flags
   values for reg_do_extmatch

search.h:
   do_search() flags
   search_regcomp() flags
   findmatchlimit() flags

syntax.h:
   HL_* flags
      HL_FOLD is used in buffer_defs.h but nvim
      compiles just fine with the defines in
      syntax.h

tag.h:
   do_tag() flags
   find_tags() flags

term.h:
   TBUFSZ flags
   MOUSE flags

ui.h:
   jump_to_mouse() flags

window.h:
   file_name_in_line() flags
   win_split() flags
   MIN_LINES
   MIN_COLUMNS

Remove VimClipboard which should have been removed with PR #921.
2014-07-12 14:26:55 +02:00
John Szakmeister
77db0b2bba Merge #932 'Check lua dependencies for all lua interpreters' 2014-07-11 19:29:26 -04:00
Rui Abreu Ferreira
5d44f89a8c Check dependencies for each lua interpreter.
- When USE_BUNDLED=OFF and the system has multiple lua interpreters
  (luajit AND lua) it may occur that only the later has the needed
  dependencies (lua-lpeg, lua-cmsgpack). If we pick luajit then
  finding the dependencies FAILS.
- This commit groups detection of the lua interpreter with the lua
  dependencies it tries to find them for both the interpreters and
  choses the first one that has them.

Helped-by: John Szakmeister <john@szakmeister.net>
2014-07-11 19:28:54 -04:00
Rui Abreu Ferreira
6f0d3c0e77 Refactor the lua dependency checking.
This is in preparation for the next step, which is to find a suitable
lua interpreter, rather than just erroring when an interpreter is found
but doesn't have the necessary dependencies.

Helped-by: John Szakmeister <john@szakmeister.net>
2014-07-11 19:28:54 -04:00
Justin M. Keyes
e47968537c Merge #927 'Fix stdbool.h usage' 2014-07-11 18:35:01 -04:00
Pavel Platto
add8cb784c Include stdbool.h in headers which have functions with bool in signature
Done by manual inspecting of the output of this script:
grep -r -l -w "bool" * | grep 'c$' | sed 's/.c$//' > has_bool
grep -r -l -w "stdbool.h" * | grep 'h$' | sed 's/.h$//' > has_include
grep -F -x -v -f has_include has_bool
2014-07-11 18:33:07 -04:00
Pavel Platto
1de9287a02 Remove stdbool.h from files which don't need it
Done by manual inspection of the output of this script:
grep -r -l -w "bool\|true\|false" * | grep 'c$\|h$' > has_bool
grep -r -l "stdbool.h" * | grep 'c$\|h$' > has_include
grep -F -x -v -f has_bool has_include
2014-07-11 18:33:07 -04:00
Pavel Platto
0868818d3e Include stdbool.h in some files which use it
Done by manual inspection of the output of this script:
grep -r -l -w "bool\|true\|false" * | grep 'c$\|h$' > has_bool
grep -r -l "stdbool.h" * | grep 'c$\|h$' > has_include
grep -F -x -v -f has_include has_bool
2014-07-11 18:33:07 -04:00
Justin M. Keyes
cf18687349 Merge #913 'Update Swedish (sv) translation' 2014-07-11 18:25:42 -04:00
Björn Linse
b04a2236f3 Update Swedish (sv) translation: improve translations. 2014-07-11 18:25:35 -04:00
Björn Linse
5853b79bd2 Update Swedish (sv) translation: Sync to 11653ce2d7 2014-07-11 18:25:35 -04:00
Shane Iler
d61829dd06 Enable and fix misc2.c -Wconversion warnings #907 2014-07-11 18:11:20 -04:00
Will Stamper
fa1d9301f7 vim-patch:7.4.308 #832
Problem:    When using ":diffsplit" on an empty file the cursor is displayed
            on the command line.
Solution:   Limit the value of w_topfill.

https://code.google.com/p/vim/source/detail?r=e3d2b8d83bb30c428a051f50791e454fcbc080af
2014-07-11 17:31:51 -04:00
Will Stamper
1cdd4ff7f6 vim-patch:7.4.306 #842
Problem:    getchar(0) does not return Esc.
Solution:   Do not wait for an Esc sequence to be complete.  (Yasuhiro
            Matsumoto)

https://code.google.com/p/vim/source/detail?r=05e1d8afcc5e375bf708ccc9810e2fd1a5a8a3cf
2014-07-11 16:42:45 -04:00
Will Stamper
fdeb132cad vim-patch:7.4.295 #833
Problem:    Various typos, bad white space and unclear comments.
Solution:   Fix typos.  Improve white space. Update comments.

https://code.google.com/p/vim/source/detail?r=662ae48e7e246a63d38c9f3165b15b62252edaee
2014-07-11 16:38:49 -04:00
oni-link
3e8314abaa vim-patch:7.4.291 #879
Problem:    Compiler warning for int to pointer of different size when DEBUG
            is defined.
Solution:   use smsg() instead of EMSG3().

https://code.google.com/p/vim/source/detail?r=b5972833add9de714f4651e26fd9ea63ec4a880c
2014-07-11 16:29:21 -04:00
Nicolas Hillegeer
94f488d1ca c99: remove vim_round #909
C89 did not have round(), vim emulated it with vim_round. But since we're
using C99 this is not a problem anymore.
2014-07-11 13:10:59 -04:00
Fredrik Fornwall
958b3c5ffb Default 'encoding'-option from latin to utf-8 #935
Normally the default encoding does not have much effect, since it's
overridden by the environment.

But when it's not (test with "LANG= LC_ALL= C_CTYPE= nvim" and perform
":set encoding?"), utf-8 should be the default encoding for a 21st
century editor :).
2014-07-10 12:04:48 -04:00
John Szakmeister
8f17da61c5 Merge #933 'Avoid linking with libform(w).so' 2014-07-10 08:53:13 -04:00
Fredrik Fornwall
e9ca4f002f Avoid linking with libform(w).so
If libtgent or libcurses is installed, the first one found of them
is linked to.

But if not, a find_package(Curses REQUIRED) is used and CURSES_LIBRARIES
is added to NVIM_LINK_LIBRARIES. This contains libform(w).so on many
systems, causing nvim to be linked to and depend on libform(w).so,
which may not be installed one some space-constrained systems, unnecessarily.
2014-07-10 08:53:04 -04:00
Fredrik Fornwall
308953ecbf Fix two android compile errors in fs.c #924
Replace usage of deprecated S_IEXEC with S_IXUSR.
Rename a variable named "errno" to avoid clashing with define.
2014-07-09 09:17:38 +02:00
Nicolas Hillegeer
ef70d7ccf7 Merge #921 'Remove includes vim.h' 2014-07-09 00:20:38 +02:00
Brandon Coleman
0fff487690 move errno.h include out of vim.h 2014-07-09 00:18:20 +02:00
Brandon Coleman
b94d07b046 move stdarg.h include out of vim.h 2014-07-09 00:18:19 +02:00
Brandon Coleman
e69cfa6c15 move assert.h include out of vim.h 2014-07-09 00:18:19 +02:00
Brandon Coleman
8cc8164e52 move wctype.h include out of vim.h 2014-07-09 00:18:19 +02:00
Brandon Coleman
bf219e1442 move <inttypes.h> include out of vim.h 2014-07-09 00:18:19 +02:00
Brandon Coleman
b18ca14ef8 move locale.h include out of vim.h 2014-07-09 00:18:19 +02:00
Brandon Coleman
82b71a3056 move ascii.h include out of vim.h 2014-07-09 00:18:18 +02:00
Brandon Coleman
8c9cb5f9ef move memory.h include to version.c 2014-07-09 00:18:17 +02:00
Brandon Coleman
a4f441e547 remove stdbool.h include from vim.h and globals.h 2014-07-09 00:18:17 +02:00
Brandon Coleman
e3db636546 remove proto.h include from vim.h 2014-07-09 00:18:17 +02:00
Klemen Košir
a568e8b644 Replaced most TRUE/FALSE macros in arabic, mbyte and spell. #645 2014-07-08 17:34:08 +00:00
Klemen Košir
ef34a0ab13 Replace int with bool in some files. #654 2014-07-08 17:25:48 +00:00
Nicolas Hillegeer
3cf435af36 Merge pull request #922 'Improve neovim.rb' 2014-07-08 15:44:50 +02:00
Xu Cheng
ccd3f9ce67 neovim.rb: improve dependency
1. remove unnecessary deps `md5sha1sum`
2. add `=> :build`
3. add missing deps `autoconf`
2014-07-08 15:43:04 +02:00
Xu Cheng
8046e59f05 neovim.rb: modernize the style
https://github.com/styleguide/ruby
2014-07-08 15:43:04 +02:00
John Szakmeister
447f1c7b54 Merge #910 'Remove unnecessary PATHS from cmake modules' 2014-07-08 05:06:49 -04:00