]> begriffs open source - libderp/log
libderp
4 years agoTests aren't relevant in release variant
Joe Nelson [Sat, 27 Mar 2021 17:00:58 +0000 (12:00 -0500)]
Tests aren't relevant in release variant

NDEBUG prevents the assertions from doing anything. So the default
make target is now "lib" and doesn't include tests.

4 years agoLet's be real
Joe Nelson [Sat, 27 Mar 2021 16:59:55 +0000 (11:59 -0500)]
Let's be real

4 years agoSome tests
Joe Nelson [Sat, 27 Mar 2021 04:56:19 +0000 (23:56 -0500)]
Some tests

4 years agoSome missing null checks
Joe Nelson [Fri, 26 Mar 2021 03:45:32 +0000 (22:45 -0500)]
Some missing null checks

4 years agoSet errno uniformly
Joe Nelson [Fri, 26 Mar 2021 03:31:56 +0000 (22:31 -0500)]
Set errno uniformly

Even when the return code allows the caller to determine
that they passed invalid arguments.

4 years agoHave v_remove operate on a single element
Joe Nelson [Fri, 26 Mar 2021 02:50:55 +0000 (21:50 -0500)]
Have v_remove operate on a single element

This way it can work like a generalized pop(), and the caller
can use/free the element as desired. Removing a range has no
clean way to return the elements to the caller, other than
packaging up the results into a new vector perhaps.

Later we could add a v_erase() that works on a range and frees
the elements, like the C++ vector::erase(). Or call it v_delete()
like Vectors in Ada.

4 years agoDeal with large allocations more consistently
Joe Nelson [Fri, 26 Mar 2021 01:52:30 +0000 (20:52 -0500)]
Deal with large allocations more consistently

This is kind of academic because it's unlikely that such huge amounts
of memory could ever actually be allocated. In fact, probably impossible
given sizeof(void*). However I want the numerical logic to be correct,
and we'll leave it to realloc() to determine failure.

4 years agoA little cleaner way to do invariant check
Joe Nelson [Thu, 25 Mar 2021 04:07:22 +0000 (23:07 -0500)]
A little cleaner way to do invariant check

4 years agoMore untested functions
Joe Nelson [Thu, 25 Mar 2021 04:02:36 +0000 (23:02 -0500)]
More untested functions

4 years agoKeep on implementing
Joe Nelson [Thu, 25 Mar 2021 03:33:53 +0000 (22:33 -0500)]
Keep on implementing

4 years agoAlways check invariants in debug mode
Joe Nelson [Thu, 25 Mar 2021 03:33:37 +0000 (22:33 -0500)]
Always check invariants in debug mode

4 years agoStart implementing
Joe Nelson [Tue, 23 Mar 2021 04:29:11 +0000 (23:29 -0500)]
Start implementing

4 years agoAdd const where possible
Joe Nelson [Tue, 23 Mar 2021 04:28:02 +0000 (23:28 -0500)]
Add const where possible

4 years agoBeginning with vector
Joe Nelson [Mon, 22 Mar 2021 02:57:54 +0000 (21:57 -0500)]
Beginning with vector