| Commit message (Collapse) | Author | Age |
| |
|
| |
|
|
|
|
|
| |
It is less error-prone than manually defining header guards. Pretty much
all compilers support it even if it's not part of the C standard.
|
|
|
|
|
|
| |
long is 32 bits on windows, while it is 64 bits on other architectures.
This makes the type suboptimal for a codebase meant to be
cross-platform. Replace it with more appropriate integer types.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix remaining clint errors and remove error suppression completely.
Rename the lint targets to align with the established naming convention:
- lintc-clint lints with clint.py.
- lintc-uncrustify lints with uncrustify.
- lintc runs both targets.
lintc is also provided as a make target for convenience.
After this change we can remove these files:
https://github.com/neovim/doc/tree/gh-pages/reports/clint
https://github.com/neovim/doc/blob/main/ci/clint-errors.sh
|
|
|
|
|
|
|
| |
This lint job will ensure that the C codebase is properly formatted at
all times. This helps eliminate most of clint.py.
To save CI time, it's faster to manually compile uncrustify and cache
the binary instead of using homebrew (the apt-get package is too old).
|
| |
|
|
|
|
|
| |
Disable formatting for assert.h since there's a bug that results in a
segmentation fault in uncrustify.
|
| |
|
|
|
|
|
|
|
|
| |
* refactor: format all C files under nvim
* refactor: disable formatting for Vim-owned files:
* src/nvim/indent_c.c
* src/nvim/regexp.c
* src/nvim/regexp_nfa.c
* src/nvim/testdir/samples/memfile_test.c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Performance of high-resolution time (clock_gettime via uv_hrtime) is
expensive on some systems. For profiling VimL, syntax, etc., we don't
care about nanosecond-precision and monotonicity edge-cases, so avoid
uv_hrtime().
closes #10328
From the uv__hrtime() source:
https://github.com/libuv/libuv/blob/0cdb4a5b4b706d0e09413d9270da28f9a88dc083/src/unix/linux-core.c#L442-L462
/* Prefer CLOCK_MONOTONIC_COARSE if available but only when it has
* millisecond granularity or better. CLOCK_MONOTONIC_COARSE is
* serviced entirely from the vDSO, whereas CLOCK_MONOTONIC may
* decide to make a costly system call.
*/
This micro-benchmark (Debug build) shows negligible differences on my
system:
#include <sys/time.h>
...
proftime_T tm = profile_start();
int trials = 999999;
int64_t t = 0;
struct timeval tv;
for (int i = 0; i < trials; i++) {
t += gettimeofday(&tv,NULL);
}
tm = profile_end(tm);
ILOG("%d trials of gettimeofday: %s", trials, profile_msg(tm));
tm = profile_start();
for (int i = 0; i < trials; i++) {
t += os_hrtime();
}
tm = profile_end(tm);
ILOG("%d trials of os_hrtime: %s", trials, profile_msg(tm));
tm = profile_start();
for (int i = 0; i < trials; i++) {
t += os_utime();
}
tm = profile_end(tm);
ILOG("%d trials of os_utime: %s", trials, profile_msg(tm));
ILOG("%zu", t);
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Travis CI, -Wmissing-prototypes gives strange error:
In file included from ../src/nvim/eval.c:5965:
/home/travis/build/neovim/neovim/build/src/nvim/auto/funcs.generated.h.gperf:215:1: error: conflicting types for 'find_internal_func_gperf'
find_internal_func_gperf (register const char *str, register unsigned int len)
^
../src/nvim/eval.c:5962:20: note: previous declaration is here
const VimLFuncDef *find_internal_func_gperf(register const char *str,
^
|
|
|
| |
closes #9522
|
| |
|
|
|
|
|
| |
Otherwise the symbols defined in config/config.h.in may not be defined,
depending on include-order.
|
| |
|
| |
|
| |
|
|
|
|
| |
The intentional behavior of do_sub was checked in vim
|
|
|
|
|
|
|
|
|
|
|
|
| |
MSVC does not handle __VA_ARGS__ as expected in STATIC_ASSERT, avoid its use
to work around it since we don't need it. The underlying issue seems to be one
of
https://connect.microsoft.com/VisualStudio/Feedback/Details/1232378
https://connect.microsoft.com/VisualStudio/Feedback/Details/1099052
The bug only seems to manifest when using multiple variadic macros that call
each other.
|
|
|
|
| |
Also makes sure that compiler will error out when new name is longer then
vv_filler.
|
|
Can be quite handy, attempt to provide fallbacks for compilers that don't
support _Static_assert (which is technically a C11 feature). Suppress
warnings as best we can (Clang and GCC warn that we're using a C11 feature
while in C99 mode).
Needs to be tested for MSVC still.
|