summaryrefslogtreecommitdiffstats
path: root/lib/skiplist.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* *: require semicolon after DEFINE_MTYPE & coDavid Lamparter2021-03-171-2/+2
| | | | | | | | | | | | | | | | | Back when I put this together in 2015, ISO C11 was still reasonably new and we couldn't require it just yet. Without ISO C11, there is no "good" way (only bad hacks) to require a semicolon after a macro that ends with a function definition. And if you added one anyway, you'd get "spurious semicolon" warnings on some compilers... With C11, `_Static_assert()` at the end of a macro will make it so that the semicolon is properly required, consumed, and not warned about. Consistently requiring semicolons after "file-level" macros matches Linux kernel coding style and helps some editors against mis-syntax'ing these macros. Signed-off-by: David Lamparter <equinox@diac24.net>
* lib, bgpd: fix crash using skiplist debug functionEmanuele Bovisio2020-11-101-4/+2
| | | | | | | | | calling "skiplist test" and then "skiplist debug", there was a crash due to a freed pointer. Agreed to remove static pointer (see PR #7474). Signed-off-by: Emanuele Bovisio <emanuele.bovisio@eolo.it>
* *: replace all random() callsRafael Zalamena2020-04-181-1/+2
| | | | | | | | | | | Replace all `random()` calls with a function called `frr_weak_random()` and make it clear that it is only supposed to be used for weak random applications. Use the annotation described by the Coverity Scan documentation to ignore `random()` call warnings. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
* *: Do not cast to the same typeDonatas Abraitis2020-04-081-2/+2
| | | | Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
* bgpd, isisd, lib: Make key values const for skiplistDonald Sharp2020-03-241-5/+6
| | | | | | Make some key values const for the skiplist code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* treewide: fix some issues found with -Werror=undefRuben Kerkhof2020-03-101-6/+6
| | | | Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
* lib: Cleanup set but unused variablesDonald Sharp2020-02-271-2/+2
| | | | | | There existed some variables set but never used. Clean this up. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* lib/skiplist: fix gcc-9 used-uninitialized warningDavid Lamparter2019-12-111-1/+1
| | | | | | | | Under some circumstances (apparently depends on several optimization flags), gcc-9 throws an used-uninitialized warning for this variable in the skiplist code. Just initialize to NULL. Signed-off-by: David Lamparter <equinox@diac24.net>
* Treewide: use ANSI function definitionsRuben Kerkhof2019-01-241-1/+1
| | | | Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
* *: style for EC replacementsQuentin Young2018-09-131-1/+1
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: LIB_[ERR|WARN] -> EC_LIBQuentin Young2018-09-131-1/+1
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* lib: fix SA warning in skiplist codeDavid Lamparter2018-09-081-0/+1
| | | | | | | | Clang was thinking the random level could be negative. (And, no, I couldn't figure that out by reading its output... trial and error this was.) Signed-off-by: David Lamparter <equinox@diac24.net>
* *: rename zlog_fer -> flog_errQuentin Young2018-08-141-1/+1
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* lib: Add LIB_ERR_DEVELOPMENTDonald Sharp2018-08-141-1/+3
| | | | | | | | | Sometimes a error state is detected when we have added new code to FRR, but not updated all the places that we should have. Consider this a developmental escape that needs to be fixed. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: fix be32 reading / 24-bit left shiftDavid Lamparter2017-09-091-2/+2
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-451/+429
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: ditch vty_outln(), part 1 of 2David Lamparter2017-07-131-2/+2
| | | | Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: use vty_outlnQuentin Young2017-06-291-4/+3
| | | | | | Saves 400 lines Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* lib: fix remaining coverity issuesDavid Lamparter2017-02-101-1/+2
| | | | | Reported-by: Coverity Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib: add skiplistLou Berger2016-09-301-0/+685