Commit Graph

804 Commits

Author SHA1 Message Date
Felipe Oliveira Carvalho
c4c855a129 No OOM error condition in prt_build_cid_fontname()
- Replace alloc() with xmalloc[z]() and remove unnecessary casts in hardcopy.c
 - Use xstrndup in hardcopy.c
2014-04-24 10:31:31 -03:00
Felipe Oliveira Carvalho
42f1bd9b22 No OOM error condition in ga_concat_strings(), concat_fnames(), concat_str()
- xmallocz() is not static anymore. There are many use cases for this function
	 in the codebase and we should start using it.
 - Simpler types in ga_concat_strings()
2014-04-24 10:31:31 -03:00
Felipe Oliveira Carvalho
4b6b9117b3 No OOM error condition in prep_exarg() 2014-04-24 10:31:31 -03:00
Felipe Oliveira Carvalho
15d8f702a8 (verbose_)?try_malloc() to use on buf_write()
There will be more use cases for try_malloc(): see #556.

 - Reimplemented xmalloc() using try_malloc().
 - verbose_try_malloc() is just like try_malloc() but shows an out-of-memory
	 error message before returning NULL.
 - Let the compiler generate size>>1 assembly for signed types. We're not using
	 old compilers here.
 - Add proper function attributes to the new functions in memory.h
2014-04-24 10:31:31 -03:00
Felipe Oliveira Carvalho
1befc49414 Use xmalloc() and xmemdupz() in file_pat_to_reg_pat()
Unfortunately there's still a case where NULL can be returned from
file_pat_to_reg_pat().

xmemdupz() and xmallocz() aren't static anymore. There are many use cases for
these function.
2014-04-24 10:31:31 -03:00
oni-link
471da2de81 vim-patch:7.4.237
Problem:    When some patches was not included has("patch-7.4.123") may return
            true falsely.
Solution:   Check for the specific patch number.

https://code.google.com/p/vim/source/detail?r=71b165a378ad580818f6d497ecf0f8ad054a9683
2014-04-24 10:30:36 -03:00
John Szakmeister
8c5f3aebc8 Install the libncurses5-dev:i386 package to get the correct symlinks. 2014-04-23 10:45:31 -03:00
John Szakmeister
f9885f0b6a Allow a single unittest file to be run.
With this, you can now run a single unit test file using:

    TEST_FILE=/path/to/file make unittest

For example, to just run the path unit tests, you can do:

    TEST_FILE=test/unit/path.moon make unittest
2014-04-23 07:11:59 -04:00
John Szakmeister
247984d132 Make it easy to get a verbose build of Neovim.
This allows you to do

    make VERBOSE=1

from the top-level and see the actual compile lines.
2014-04-23 07:08:12 -04:00
Eliseo Martínez
557e41b119 Use portable format specifiers: Clint advice & other.
- Modify Clint advice to reflect preference for fixed sized macros.
- Cleanup comment to eliminate referecen to "%ld".
2014-04-23 06:56:34 -03:00
Eliseo Martínez
12c8094dae Use portable format specifiers: Case %l[uoxX] - *.po files.
Fix uses of plain "%lu", "%lo", "%lx" and "%lX"  within *.po files:
- Replace "%l<whatever>" with "%" PRI<whatever>64.
2014-04-23 06:56:34 -03:00
Eliseo Martínez
2dd98267f0 Use portable format specifiers: Remove dead code. 2014-04-23 06:56:33 -03:00
Eliseo Martínez
30b062e7d8 Use portable format specifiers: Case %lu - localized - EMSGN.
Fix uses of plain "%lu" within EMSGN():
- Replace "%lu" with "%" PRIu64.
- No argument cast needed. EMSGN() will take care of that.
2014-04-23 06:56:33 -03:00
Eliseo Martínez
357f54f331 Use portable format specifiers: Case %l[uoxX] - plain - sprintf.
Fix uses of plain "%lu", "%lo", "%lx" and "%lX" within sprintf():
- Replace "%l<whatever>" with "%" PRI<whatever>64.
- Cast corresponding argument to (uint64_t).
2014-04-23 06:56:33 -03:00
Eliseo Martínez
b9c550ebd5 Use portable format specifiers: Support 'll' in vim_snprintf.
Add support for 'll' length specifier in vim_snprintf/vim_vsnprintf.
2014-04-23 06:56:33 -03:00
Eliseo Martínez
20fdaaaa94 Use portable format specifiers: Case %ld - *.po files.
Fix uses of plain "%ld" within *.po files:
- Replace "%ld" with "%<PRId64>".
2014-04-23 06:56:33 -03:00
Eliseo Martínez
28bac30c19 Use portable format specifiers: Case %ld - localized - N_.
Fix uses of plain "%ld" within N_():
- Replace "%ld" with "%" PRId64.
2014-04-23 06:56:33 -03:00
Eliseo Martínez
b8f3ff2a69 Use portable format specifiers: Case %ld - localized - EMSGN.
Fix uses of localized "%ld" within EMSGN():
- Replace "%ld" with "%" PRId64.
- No argument cast needed. EMSGN() will take care of that.
2014-04-23 06:56:33 -03:00
Eliseo Martínez
bf3b9d0ecb Use portable format specifiers: Case %ld - plain - EMSGN.
Fix uses of plain "%ld" within EMSGN():
- Replace "%ld" with "%" PRId64.
- No argument cast needed. EMSGN() will take care of that.
2014-04-23 06:56:33 -03:00
Eliseo Martínez
5b0aa1cb57 Use portable format specifiers: Adapt EMSGN/emsgn to use (int64_t). 2014-04-23 06:56:33 -03:00
Eliseo Martínez
f4b81576cc Use portable format specifiers: Case %ld - localized - vim_snprintf_add.
Fix uses of localized "%ld" within vim_snprintf_add():
- Replace "%ld" with "%" PRId64.
- Cast corresponding argument to (int64_t).
2014-04-23 06:56:32 -03:00
Eliseo Martínez
22dd4f62d3 Use portable format specifiers: Case %ld - localized - vim_snprintf.
Fix uses of localized "%ld" within vim_snprintf():
- Replace "%ld" with "%" PRId64.
- Cast corresponding argument to (int64_t).
2014-04-23 06:56:32 -03:00
Eliseo Martínez
3f8061f16c Use portable format specifiers: Case %ld - plain - vim_snprintf.
Fix uses of plain "%ld" within vim_snprintf():
- Replace "%ld" with "%" PRId64.
- Cast corresponding argument to (int64_t).
2014-04-23 06:56:32 -03:00
Eliseo Martínez
c049cb2b51 Use portable format specifiers: Case %ld - localized - smsg.
Fix uses of localized "%ld" within smsg():
- Replace "%ld" with "%" PRId64.
- Cast corresponding argument to (int64_t).
2014-04-23 06:56:32 -03:00
Eliseo Martínez
182b84e1c3 Use portable format specifiers: Case %ld - plain - smsg.
Fix uses of plain "%ld" within smsg():
- Replace "%ld" with "%" PRId64.
- Cast corresponding argument to (int64_t).
2014-04-23 06:56:32 -03:00
Eliseo Martínez
1bffe66508 Use portable format specifiers: Case %ld - plain - fprintf.
Fix uses of plain "%ld" within fprintf():
- Replace "%ld" with "%" PRId64.
- Cast corresponding argument to (int64_t).
2014-04-23 06:56:32 -03:00
Eliseo Martínez
b536c22550 Use portable format specifiers: Case %ld - localized - sprintf.
Fix uses of localized "%ld" within sprintf():
- Replace "%ld" with "%" PRId64.
- Cast corresponding argument to (int64_t).
2014-04-23 06:56:32 -03:00
Eliseo Martínez
fb94edf373 Use portable format specifiers: Case %ld - plain - sprintf.
Fix uses of plain "%ld" within sprintf():
- Replace "%ld" with "%" PRId64.
- Cast corresponding argument to (int64_t).
2014-04-23 06:56:32 -03:00
Eliseo Martínez
f916cf067d Use portable format specifiers: Remove branching with LONG_LONG_OFF_T.
After previous commits, branching code by using macro LONG_LONG_OFF_T
becomes unneccesary. Remove it.
2014-04-23 06:56:32 -03:00
Eliseo Martínez
e4a1ea9e02 Use portable format specifiers: Case %lld - localized - sprintf.
Fix uses of localized "%lld" within sprintf():
- Replace _("%lld") with _("%" PRId64).
- Cast corresponding argument to (int64_t).
- In *.po files, replace "%lld" with "%<PRId64>".
2014-04-23 06:56:32 -03:00
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