summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2024-01-27 20:41:36 -0500
committerAndrew Opalach <andrew@akon.city> 2024-01-27 20:41:36 -0500
commit3eeb6351ea365d8eb095a3db3063b6129f73a178 (patch)
tree57c1aa63ac6c4c0860bcc31fc7e1544180925734 /include
parenta1f9ffcc6eb38ad5f6f0fa750a34e14ad9cdf812 (diff)
downloadlibalabaster-3eeb6351ea365d8eb095a3db3063b6129f73a178.tar.gz
libalabaster-3eeb6351ea365d8eb095a3db3063b6129f73a178.tar.bz2
libalabaster-3eeb6351ea365d8eb095a3db3063b6129f73a178.zip
Switch the order of al_array_insert args, cleanup
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'include')
-rw-r--r--include/al/array_typed.h2
-rw-r--r--include/al/lib.h2
-rw-r--r--include/al/log.h5
-rw-r--r--include/al/ring_buffer.h1
-rw-r--r--include/al/str.h2
-rw-r--r--include/al/test.h1
-rw-r--r--include/al/wstr.h4
7 files changed, 12 insertions, 5 deletions
diff --git a/include/al/array_typed.h b/include/al/array_typed.h
index 678aef4..3334026 100644
--- a/include/al/array_typed.h
+++ b/include/al/array_typed.h
@@ -66,7 +66,7 @@
*ret = *al_array_at(N, __VA_ARGS__)(a, i); \
al_array_remove_at(N, __VA_ARGS__)(a, i); \
} \
- static inline void al_array_insert(N, __VA_ARGS__)(array(N, __VA_ARGS__) *a, T *item, u32 i) \
+ static inline void al_array_insert(N, __VA_ARGS__)(array(N, __VA_ARGS__) *a, u32 i, T *item) \
{ \
if (a->size > i) { \
al_array_reserve(N, __VA_ARGS__)(a, a->size + 1); \
diff --git a/include/al/lib.h b/include/al/lib.h
index b9b2318..aa0d0d2 100644
--- a/include/al/lib.h
+++ b/include/al/lib.h
@@ -177,7 +177,7 @@ static inline u16 al_u16_add_wrap(u16 v, u16 add)
return (((u32)v + add) > UINT16_MAX) ? (add - (UINT16_MAX - v)) : v + add;
}
-AL_UNUSED_FUNCTION_PUSH
+AL_UNUSED_FUNCTION_POP
extern size_t al_page_size;
extern size_t al_grow_limit;
diff --git a/include/al/log.h b/include/al/log.h
index 1848840..b3c57da 100644
--- a/include/al/log.h
+++ b/include/al/log.h
@@ -24,7 +24,10 @@ s32 _al_logv(const char *level, const char *section, const char *name,
#define al_log_debug(section, fmt, ...) al_log("debug", section, fmt, ##__VA_ARGS__)
#else
AL_UNUSED_FUNCTION_PUSH
-static s32 al_log_nop(const char *section, const char *fmt, ...) { (void)section; (void)fmt; return 0; }
+static s32 al_log_nop(const char *section, const char *fmt, ...)
+{
+ (void)section; (void)fmt; return 0;
+}
AL_UNUSED_FUNCTION_POP
#define al_log_debug(section, fmt, ...) al_log_nop(section, fmt, ##__VA_ARGS__)
#endif
diff --git a/include/al/ring_buffer.h b/include/al/ring_buffer.h
index 359d087..686f47a 100644
--- a/include/al/ring_buffer.h
+++ b/include/al/ring_buffer.h
@@ -2,7 +2,6 @@
#define _AL_RING_BUFFER_H
#include "types.h"
-#include "atomic.h"
struct al_ring_buffer {
u8 *start;
diff --git a/include/al/str.h b/include/al/str.h
index 9a3c2de..9be1394 100644
--- a/include/al/str.h
+++ b/include/al/str.h
@@ -160,6 +160,8 @@ static inline u32 al_str_hash(str *s)
return hash;
}
+AL_UNUSED_FUNCTION_POP
+
s64 al_str_to_long(str *s, s32 base);
bool al_str_get_line(str *buffer, char sep, str *line);
diff --git a/include/al/test.h b/include/al/test.h
index 43f6770..532c839 100644
--- a/include/al/test.h
+++ b/include/al/test.h
@@ -1,7 +1,6 @@
#ifndef _AL_TEST_H
#define _AL_TEST_H
-#include "types.h"
#include "lib.h"
#define AL_TEST_START_GROUP(name) \
diff --git a/include/al/wstr.h b/include/al/wstr.h
index 99c0157..540ed55 100644
--- a/include/al/wstr.h
+++ b/include/al/wstr.h
@@ -25,6 +25,8 @@ typedef struct {
#define AL_WSTR_PRINTF(w) (w)->len, (w)->data
#define AL_WSTR_PRINTF_MAXLEN(w, l) AL_MIN((w)->len, (l)), (w)->data
+AL_UNUSED_FUNCTION_PUSH
+
static inline s32 al_wchar_width(wchar_t wc)
{
return wcwidth(wc);
@@ -84,4 +86,6 @@ static inline s32 al_wstr_width(wstr *w)
return wcswidth(w->data, w->len);
}
+AL_UNUSED_FUNCTION_POP
+
#endif // _AL_WSTR_H