summaryrefslogtreecommitdiff
path: root/reduced_system_layer.c
diff options
context:
space:
mode:
Diffstat (limited to 'reduced_system_layer.c')
-rw-r--r--reduced_system_layer.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/reduced_system_layer.c b/reduced_system_layer.c
index c945ed1..055cd3a 100644
--- a/reduced_system_layer.c
+++ b/reduced_system_layer.c
@@ -792,6 +792,14 @@ static u32 rgb_u32_from_f32_(vec3_f32 c) {
return (r << 16) | (g << 8) | b;
}
+static vec3_f32 rgb_f32_from_u32_(u32 c) {
+ return (vec3_f32) {
+ .x = ((c >> 16) & 0xff) / 255.f,
+ .y = ((c >> 8) & 0xff) / 255.f,
+ .z = ( c & 0xff) / 255.f,
+ };
+}
+
static i64 average_frame_duration_(i64 duration) {
_frame_duration[_frame_index] = duration;
_frame_index = (_frame_index + 1) % NUM_FRAMES_AVERAGED;
@@ -1767,6 +1775,8 @@ static void screencopy_frame_handle_flags(
void *frame,
u32 flags
) {
+ (void) frame;
+
WL_Output_ *output = data;
output->screencopy_frame_flags = flags;
}
@@ -1778,6 +1788,11 @@ static void screencopy_frame_handle_ready(
u32 tv_sec_lo,
u32 tv_nsec
) {
+ (void) frame;
+ (void) tv_sec_hi;
+ (void) tv_sec_lo;
+ (void) tv_nsec;
+
WL_Output_ *output = data;
++output->state->n_done;
}
@@ -1786,6 +1801,8 @@ static void screencopy_frame_handle_failed(
void *data,
void *frame
) {
+ (void) frame;
+
WL_Output_ *output = data;
output->state->ok = 0;
LOG_ERROR("Screenshot copy failed.");
@@ -1831,7 +1848,11 @@ static void handle_global(
);
}
-static void handle_global_remove(void *data, struct wl_registry *registry, u32 name) { }
+static void handle_global_remove(void *data, struct wl_registry *registry, u32 name) {
+ (void) data;
+ (void) registry;
+ (void) name;
+}
static struct wl_registry_listener _wayland_registry_listener = {
.global = handle_global,
@@ -1854,14 +1875,6 @@ b8 check_format_(i32 format) {
return 0;
}
-static vec3_f32 rgb_f32_from_u32_(u32 c) {
- return (vec3_f32) {
- .x = ((c >> 16) & 0xff) / 255.f,
- .y = ((c >> 8) & 0xff) / 255.f,
- .z = ( c & 0xff) / 255.f,
- };
-}
-
b8 wayland_screenshot_(i64 max_num_pixels, i64 *width, i64 *height, vec4_f32 *pixels) {
b8 ok = 0;
@@ -3140,6 +3153,8 @@ void p_sleep_for(i64 duration) {
}
void p_init(void) {
+ (void) rgb_f32_from_u32_;
+
++_num_events;
g_platform.done = 1;