Skip to content

Commit 08a973d

Browse files
committed
Remove leftover TODO.
Fix incorrectly highlighted line. Remove redundant pragma. Reorder slice members. Wrap panic macro in block.
1 parent 7bb6e67 commit 08a973d

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

docs/lib/overview/comparators.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,3 @@ Consider an example where the data is an album with a rating:
4747
.. todo::
4848

4949
* Proper definition of ordering and equality.
50-
* Ensure that comparators get inlined.

docs/lib/utilities/container_of.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Data structures can be implemented without being tied to any data, and then embe
88

99
.. code-block:: c
1010
:caption: This binary search tree node holds no data. Instead it's embedded onto an album.
11-
:emphasize-lines: 5
11+
:emphasize-lines: 12
1212
1313
struct bstree
1414
{

include/container_of.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#pragma once
2-
#pragma once
32
#pragma icanc include
43
#include <leet.h>
54
#pragma icanc end

include/ds/slice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131
*/
3232
struct slice
3333
{
34+
byte* _data; ///< Pointer to the managed array.
3435
size_t _capacity; ///< Size of the managed array in bytes.
3536
size_t _el_size; ///< Size of each element in bytes.
3637
ptrdiff_t _ptr; ///< Write pointer. (Byte offset to the first free spot
3738
///< on the array.)
38-
byte* _data; ///< Pointer to the managed array.
3939
};
4040

4141
/**

include/error.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,13 @@ struct error
3838
* @param ... Parameters for the format string.
3939
*/
4040
#define panic(...) \
41-
fprintf(stderr, "panicked at %s:%d:\n", __FILE__, __LINE__); \
42-
fprintf(stderr, __VA_ARGS__); \
43-
fprintf(stderr, "\n"); \
44-
exit(-1);
41+
{ \
42+
fprintf(stderr, "panicked at %s:%d:\n", __FILE__, __LINE__); \
43+
fprintf(stderr, __VA_ARGS__); \
44+
fprintf(stderr, "\n"); \
45+
exit(-1); \
46+
\ \
47+
}
4548

4649
/**
4750
* @brief Reports a recoverable error with a formatted message.

0 commit comments

Comments
 (0)