summaryrefslogtreecommitdiff
path: root/lib/skiplist.c
AgeCommit message (Collapse)Author
2023-02-09lib: SPDX License ID on skiplist codeDavid Lamparter
The skiplist code has a very "colorful" history. Use the SPDX "LicenseRef" syntax/notation to track it. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2021-10-05lib: fix spelling nits in more lib filesewlumpkin
Signed-off-by: ewlumpkin <ewlumpkin@gmail.com>
2021-09-21lib: skiplist: clean up level counter implementationG. Paul Ziemba
Signed-off-by: G. Paul Ziemba <paulz@labn.net>
2021-03-17*: require semicolon after DEFINE_MTYPE & coDavid Lamparter
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>
2020-11-10lib, bgpd: fix crash using skiplist debug functionEmanuele Bovisio
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>
2020-04-17*: replace all random() callsRafael Zalamena
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>
2020-04-08*: Do not cast to the same typeDonatas Abraitis
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
2020-03-24bgpd, isisd, lib: Make key values const for skiplistDonald Sharp
Make some key values const for the skiplist code. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-03-10treewide: fix some issues found with -Werror=undefRuben Kerkhof
Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2020-02-27lib: Cleanup set but unused variablesDonald Sharp
There existed some variables set but never used. Clean this up. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-12-11lib/skiplist: fix gcc-9 used-uninitialized warningDavid Lamparter
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>
2019-01-24Treewide: use ANSI function definitionsRuben Kerkhof
Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2018-09-13*: style for EC replacementsQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13*: LIB_[ERR|WARN] -> EC_LIBQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-08lib: fix SA warning in skiplist codeDavid Lamparter
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>
2018-08-14*: rename zlog_fer -> flog_errQuentin Young
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-08-14lib: Add LIB_ERR_DEVELOPMENTDonald Sharp
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>
2017-09-09*: fix be32 reading / 24-bit left shiftDavid Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-17*: reindentreindent-master-afterwhitespace / reindent
indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-07-13*: ditch vty_outln(), part 1 of 2David Lamparter
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-06-29*: use vty_outlnQuentin Young
Saves 400 lines Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-02-10lib: fix remaining coverity issuesDavid Lamparter
Reported-by: Coverity Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2016-09-30lib: add skiplistLou Berger