summaryrefslogtreecommitdiff
path: root/src/utils.h
diff options
context:
space:
mode:
authorFabrice <fabrice@schaub-dev.xyz>2026-02-10 12:54:18 +0100
committerFabrice <fabrice@schaub-dev.xyz>2026-02-10 12:54:18 +0100
commit949cceeaa87a76d647660d3585ef9338bfaa3781 (patch)
tree266d15b3a270bf0357e19f5058d75df67df7ea41 /src/utils.h
parentb9d3576c1402c530aef200e8832f13eecda5070d (diff)
formatting
Diffstat (limited to 'src/utils.h')
-rw-r--r--src/utils.h34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/utils.h b/src/utils.h
index 59b5334..b599a85 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -1,11 +1,12 @@
#pragma once
+#include <stdint.h>
+#include <wayland-client.h>
+
#include <cstdio>
#include <cstdlib>
-#include <stdint.h>
#include "xdg-shell.h"
-#include <wayland-client.h>
typedef uint8_t u8;
typedef uint16_t u16;
@@ -27,20 +28,20 @@ typedef i32 isize;
#error "Unsupported pointer size"
#endif
-typedef struct wl_display *wl_display_t;
-typedef struct wl_registry *wl_registry_t;
-typedef struct wl_compositor *wl_compositor_t;
-typedef struct wl_surface *wl_surface_t;
+typedef struct wl_display* wl_display_t;
+typedef struct wl_registry* wl_registry_t;
+typedef struct wl_compositor* wl_compositor_t;
+typedef struct wl_surface* wl_surface_t;
-typedef struct xdg_wm_base *xdg_wm_base_t;
-typedef struct xdg_surface *xdg_surface_t;
-typedef struct xdg_toplevel *xdg_toplevel_t;
+typedef struct xdg_wm_base* xdg_wm_base_t;
+typedef struct xdg_surface* xdg_surface_t;
+typedef struct xdg_toplevel* xdg_toplevel_t;
static inline u32 wayc_min(u32 a, u32 b) { return a > b ? a : b; }
-[[noreturn]] static inline void wayc_panic_impl(const char *file, int line,
- const char *func,
- const char *fmt, ...) {
+[[noreturn]] static inline void wayc_panic_impl(const char* file, int line,
+ const char* func,
+ const char* fmt, ...) {
fprintf(stderr, "Panic at %s:%d in %s: ", file, line, func);
va_list args;
va_start(args, fmt);
@@ -50,13 +51,12 @@ static inline u32 wayc_min(u32 a, u32 b) { return a > b ? a : b; }
exit(EXIT_FAILURE);
}
-#define wayc_panic(...) \
+#define wayc_panic(...) \
wayc_panic_impl(__FILE__, __LINE__, __func__, __VA_ARGS__)
-#define wayc_assert(expr) \
- do { \
- if (!(expr)) \
- wayc_panic("Assertion failed: %s", #expr); \
+#define wayc_assert(expr) \
+ do { \
+ if (!(expr)) wayc_panic("Assertion failed: %s", #expr); \
} while (0)
#define wayc_notnull(expr) wayc_assert(expr != NULL)