Commit Graph

574 Commits

Author SHA1 Message Date
Eliseo Martínez
7dc649c906 Use portable format specifiers: Case %lld - plain - sprintf.
Fix uses of plain "%lld" within sprintf():
- Replace "%lld" with "%" PRId64.
- Cast corresponding argument to (int64_t).
2014-04-23 06:56:32 -03:00
Thiago de Arruda
8f710a4103 Fix clint.sh wrapper script and broken files
- Fixed clint.sh, it no longer ignores errors in individual files.
- Fixed two files that weren't passing the clint test
2014-04-22 21:56:06 -03:00
Thiago de Arruda
9f7426ca16 Configure travis to perform a 32-bit build
- Build targeting 32-bit with travis
- Code in `before_install`/`after_success` was moved to travis.sh since it
  provides greater flexibility for detecting the build matrix environment. This
  improves the build speed since we now install only what's necessary.
- Now clint has a dedicated travis worker
2014-04-22 21:55:59 -03:00
Thiago de Arruda
a57030d28c Use libtinfo as a fallback for curses
This will be done before running the FindCurses cmake module
2014-04-22 21:55:59 -03:00
Eliseo Martínez
a1a0c00589 Broken build on 32 bit: Fix -Wtautological-constant-out-of-range-compare.
Problem:

[ 51%] Building C object src/CMakeFiles/nvim.dir/os/rstream.c.o
/Users/eliseo/projects/os/neovim/src/os/rstream.c:237:24: error: comparison of constant
      9223372036854775807 with expression of type 'size_t' (aka 'unsigned long') is always true
      [-Werror,-Wtautological-constant-out-of-range-compare]
  assert(rstream->fpos <= INT64_MAX);
         ~~~~~~~~~~~~~ ^  ~~~~~~~~~
/usr/include/assert.h:93:25: note: expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
                        ^

Solution:

Assertion temporarily disabled.
TODO: Review types so that assertion can be used.
2014-04-22 16:03:21 -03:00
Eliseo Martínez
5f60bf4eb2 Broken build on 32 bit: Fix -Wshorten-64-to-32.
Problem:

[ 48%] Building C object src/CMakeFiles/nvim.dir/os/mem.c.o
/Users/eliseo/projects/os/neovim/src/os/mem.c:9:32: error: implicit
conversion loses integer
      precision: 'uint64_t' (aka 'unsigned long long') to 'long_u' (aka
      'unsigned long')
            [-Werror,-Wshorten-64-to-32]
              return uv_get_total_memory() >> 10;
                ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~^~~~~

Solution:

Avoid conversion. Make function return proper uint64_t.
Make users of the function accomodate the value if too big for them.
2014-04-22 16:03:21 -03:00
Stefan Hoffmann
320fade350 inline the rest of os_unixx.h into os_unix.c 2014-04-22 13:28:23 -03:00
Stefan Hoffmann
5f63287f51 cleanup os_unixx.h 2014-04-22 13:28:23 -03:00
John Schmidt
b10341ce5b Remove sizeof(int) < 4 related code 2014-04-22 08:06:06 -03:00
oni-link
0072ba9361 Remove proto as an include directory.
The proto directory was removed in 0ef90c13b7.
2014-04-21 17:31:22 -04:00
John Szakmeister
14e4e678b9 Allow USERNAME to be specified on the command line.
There are some systems that have usernames of the form DOMAIN\username,
which causes an invalid escape character to be inserted.  I was going to
add some escaping, but decided it would be best to just outright set the
value, since I don't want the DOMAIN portion in there anyways.
2014-04-21 17:29:40 -04:00
John Schmidt
302998b0c7 Remove dead code in clint.py 2014-04-21 12:19:08 -03:00
Nicolas Hillegeer
c1c335f71c fix -Wconversion warnings for rstream
I'm not sure whether to go for signed or unsigned types for the offsets, but
without a doubt size_t is a better alternative than uint32_t. Added casts
after checking bounds before and after calling external libraries (in this
case libuv).
2014-04-21 12:16:51 -03:00
John Szakmeister
57dafc70f6 Add the -Wconversion flag for some files.
This is to provide some infrastructure to help with issue #567 (Enable
-Wconversion file by file).
2014-04-21 10:46:09 -03:00
Marco Hinz
9e3181af24 Remove "h" flag of 'highlight' option
HLF_H is an obsolete flag and got replaced by HLF_E.
2014-04-21 10:41:18 -03:00
Marco Hinz
987fabe0a7 Remove 'textauto' option
For the same reason we removed 'textmode'.
2014-04-21 10:40:00 -03:00
Pavel Platto
61b7b2d81a Replace explicit uv_guest_handle(fd) == UV_TTY by os_isatty 2014-04-20 10:37:52 -03:00
Pavel Platto
aea2e2cb12 Removed mch_input_isatty 2014-04-20 10:37:52 -03:00
Pavel Platto
a848fad656 Removed mch_check_win 2014-04-20 10:37:52 -03:00
Pavel Platto
096eadbcbb Added os_isatty 2014-04-20 10:37:52 -03:00
Lowe Schmidt
b8364da582 I donated > 50 $, should be with URL
See; https://www.bountysource.com/people/24072-lsc
2014-04-20 10:35:18 -03:00
Nicolas Hillegeer
73fdf2d8e9 use fixed-width types to define u8char_T
The current approach was a bit ad-hoc.
2014-04-19 09:48:19 -03:00
oni-link
971fd3e18e vim-patch:7.4.236
Problem:    It's not that easy to check the Vim patch version.
Solution:   Make has("patch-7.4.123") work. (partly by Marc Weber)

https://code.google.com/p/vim/source/detail?r=a44087db72386d080e9da870d751daf498004be8
2014-04-19 09:40:18 -03:00
John Schmidt
63cc8b6934 Remove lalloc_clear
Use `xcalloc` instead. Change some local variables
to avoid casting.
2014-04-19 09:36:17 -03:00
Thiago de Arruda
204d3dfafc Add missing names to BACKERS.md 2014-04-18 16:28:47 -03:00
Thiago de Arruda
587f5f0aab Fix bug of job_stop not emitting JobExit
The `job_stop` function was calling `uv_read_stop` on the std{out,err} streams.
This is now responsibility of `RStream` and because of those calls `job_stop`
wasn't emitting the `JobExit` event.
2014-04-18 16:12:26 -03:00
Thiago de Arruda
7fb36ebb1d Remove unnecessary cleanup label from job_start
The argument vector is now freed in the `close_cb` function in job.c
2014-04-18 16:12:00 -03:00
Thiago de Arruda
246d92edb5 Free job data on close_cb 2014-04-18 16:12:00 -03:00
Thiago de Arruda
9979e9eac9 Stop job prepare watcher when there are no jobs
No need to check for job status when no jobs are running
2014-04-18 16:12:00 -03:00
Thiago de Arruda
d59034ea93 Refactor job.c module to use WStream
After a job has accumulated 1mb of stdin data we assume that it's stuck and kill
it.
2014-04-18 16:12:00 -03:00
Thiago de Arruda
913e92324a Extract writing boilerplate into wstream.c module 2014-04-18 16:12:00 -03:00
Thiago de Arruda
d31d3dda3d Correctly free libuv handles
This ensures memory chunks for libuv handles are only freed after the event loop
no longer has references to it.
2014-04-18 16:11:59 -03:00
Thiago de Arruda
9acb960713 Refactor job control to use RStream events
Instead of a single 'job read' callback, job control consumers need to provide
callbacks for "stdout read", "stderr read" and "exit". For vimscript, the
JobActivity autocommand is still used to handle every job event, for example:

```vim
:let srv1_id = jobstart('netcat-server-1', 'nc', ['-l', '9991'])
:let srv2_id = jobstart('netcat-server-2', 'nc', ['-l', '9991'])

function JobEvent()
  " v:job_data[0] = the job id
  " v:job_data[1] = the event type, one of "stdout", "stderr" or "exit"
  " v:job_data[2] = data read from stdout or stderr
  if v:job_data[1] == 'stdout'
    let str = 'Message from job '.v:job_data[0].': '.v:job_data[2]
  elseif v:job_data[1] == 'stderr'
    let str = 'Error message from job '.v:job_data[0].': '.v:job_data[2]
  else
    " Exit
    let str = 'Job '.v:job_data[0].' exited'
  endif

  call append(line('$'), str)
endfunction

au JobActivity netcat-server-* call JobEvent()
```

And to see messages from 'job 1', run in another terminal:

```sh
bash -c "while true; do echo 123; sleep 1; done" | nc localhost 9991
```
2014-04-18 16:11:59 -03:00
Thiago de Arruda
350144f511 Create EventType for RStream reading
RStream will be the main way Neovim receives asynchronous messages, so it is
best to have a specialized EventType for it. A new flag parameter was added to
`rstream_new` which tells the RStream instance to defer event handling for later
with KE_EVENT instead of handling it directly from libuv callback.
2014-04-18 16:11:59 -03:00
Thiago de Arruda
c40428c934 Deal with backpressure on RStream instances
Each RStream instance will now stop its libuv watcher when the buffer is full,
and automatically restart when some data is read with `rstream_read`.
2014-04-18 16:11:59 -03:00
ccvergara
9d16a6b370 update backers.md with bountysource survey responses 2014-04-18 15:49:49 -03:00
Richard Hartmann
d422b994aa Correct 'RichiH' name in BACKERS.md 2014-04-18 10:55:15 -03:00
oni-link
c142abf7e8 vim-patch:7.4.226
Problem:    Cursurline highlighting not redrawn when scrolling. (John
            Marriott)
Solution:   Check for required redraw in two places.

https://code.google.com/p/vim/source/detail?r=b650f2db8f9604124c0ddfb14af0c04bd4ae0580
2014-04-18 10:03:07 -03:00
oni-link
ca4005d759 vim-patch:7.4.245
Problem:    Crash for "vim -u NONE -N  -c '&&'".
Solution:   Check for the pattern to be NULL. (Dominique Pelle)

https://code.google.com/p/vim/source/detail?r=80421d934ebde183ce545ab8d9eb3a4c2065c169
2014-04-17 17:49:12 -03:00
Marco Hinz
85b5a75a69 Remove 'textmode' option
'textmode' is an option obsoleted for at least 10 years in favor of
'fileformat'.
2014-04-16 20:18:37 -03:00
Thiago de Arruda
a53f784738 Handle special KE_EVENT case where maxlen < 3
Possible bug reported by @oni-link [here](https://github.com/neovim/neovim/pull/485/files#r11664573).

It was handled by doing a circular walk through a key buffer and saving the
index between calls with a static variable.

Also replaced some `char_u` occurrences by `uint8_t` and removed unused
headers in input.c module.
2014-04-16 19:54:57 -03:00
Thiago de Arruda
937922271a Configure travis to use prebuilt dependencies
Dependencies are now hosted in a github repository and this brings two advantages:

- Improved build time with travis since we no longer have to build each
  dependency
- Less chance of build errors due to external servers being down since Github is
  now the single point of failure
2014-04-16 19:43:45 -03:00
Marco Hinz
43c6ec6803 Remove modelines
Removed modelines are better than modelines that differ from file to
file.
2014-04-16 14:03:19 -03:00
Thiago de Arruda
f276e97de9 Refactor input module to use RStream class 2014-04-16 09:56:45 -03:00
Thiago de Arruda
6e4e40a0f7 Refactor job control module to use RStream class 2014-04-16 09:56:45 -03:00
Thiago de Arruda
001d05541b Extract reading boilerplate into rstream.c module
The `RStream` class hides the differences between files and other types of
streams with a simpler, general-purpose API for performing non-blocking reads
with libuv. Most of the code was adapted from input.c.
2014-04-16 09:56:45 -03:00
Klemen Košir
b405a64133 Initialize a variable. 2014-04-16 09:50:27 -03:00
Marco Hinz
b94239e03c vim-patch:7.4.253
Problem:  Crash when using cpp syntax file with pattern using external
          match. (Havard Garnes)

Solution: Discard match when end column is before start column.

https://code.google.com/p/vim/source/detail?r=4901a36479f200b2e6700ad91c26911d92deb886
2014-04-16 09:48:50 -03:00
Marco Hinz
cb0adf60de vim-patch:7.4.251
Problem:  Crash when BufAdd autocommand wipes out the buffer.

Solution: Check for buffer to still be valid. Postpone freeing the
          buffer structure. (Hirohito Higashi)

https://code.google.com/p/vim/source/detail?r=29eb4c2a33ac701bfcd4d2e2bed7864eba876e0e
2014-04-16 09:46:01 -03:00
Marco Hinz
40970917dc vim-patch:7.4.240
Problem:  ":tjump" shows "\n" as "\\n".
Solution: Skip over "\" that escapes a backslash. (Gary Johnson)

https://code.google.com/p/vim/source/detail?r=8d1ba0a23588932d22ad37cbd87ae3bbd4bfeff8
2014-04-16 09:45:08 -03:00