aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/assert.h
Commit message (Collapse)AuthorAge
* refactor: fix headers with IWYUdundargoc2023-11-28
|
* refactor: move garray_T to garray_defs.h (#26227)zeertzjq2023-11-26
|
* refactor: replace manual header guards with #pragma oncedundargoc2023-11-12
| | | | | 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.
* refactor: the long goodbyedundargoc2023-11-05
| | | | | | 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.
* build: remove clint error suppression #21782dundargoc2023-01-13
| | | | | | | | | | | | | | | 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
* ci: lint with uncrustify #18563dundargoc2022-05-20
| | | | | | | 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).
* refactor(uncrustify): disable formatting in problematic code sectionsDundar Goc2022-04-29
|
* refactor: upgrade uncrustify config version to 0.74.0Dundar Göc2021-11-23
| | | | | Disable formatting for assert.h since there's a bug that results in a segmentation fault in uncrustify.
* refactor: uncrustify #16090dundargoc2021-10-29
|
* refactor: format all C files under nvim/ #15977dundargoc2021-10-12
| | | | | | | | * 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
* viml/profile: switch to uv_gettimeofday() #10356Justin M. Keyes2019-06-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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);
* build: PRAGMA_DIAG_PUSH_IGNORE_MISSING_PROTOTYPESJustin M. Keyes2019-02-04
| | | | | | | | | | | | 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, ^
* PVS/V1028 (rework): cast operands, not the result #9531Justin M. Keyes2019-01-21
| | | closes #9522
* STRICT_ADD, STRICT_SUB: Log error before abortJustin M. Keyes2019-01-20
|
* build: include auto/config.h explicitlyJustin M. Keyes2019-01-20
| | | | | Otherwise the symbols defined in config/config.h.in may not be defined, depending on include-order.
* CMake: Feature-detect __builtin_{add,sub}_overflowJustin M. Keyes2019-01-09
|
* PVS/V1028: cast operands, not the resultJustin M. Keyes2019-01-09
|
* assert.h: Check overflow with STRICT_ADD, STRICT_SUBJustin M. Keyes2019-01-09
|
* Fix warnings with gcc 6.1Björn Linse2016-05-19
| | | | The intentional behavior of do_sub was checked in vim
* MSVC: Avoid variadic macro bug in STATIC_ASSERTRui Abreu Ferreira2016-04-30
| | | | | | | | | | | | 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.
* eval: Do not break when VimVarIndex and vimvars order mismatchesZyX2016-04-18
| | | | Also makes sure that compiler will error out when new name is longer then vv_filler.
* assert: add STATIC_ASSERT macroNicolas Hillegeer2014-07-16
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.