From f77b4199c46311ae1d2af7b66afcfb8651b718bc Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 11 Nov 2021 15:43:07 +0900 Subject: [PATCH] Fix some optimization warnings --- include/QF/input/event.h | 2 +- include/QF/input/imt.h | 2 +- libs/console/client.c | 2 +- libs/input/in_imt.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/QF/input/event.h b/include/QF/input/event.h index 2339dd732..399d25f9f 100644 --- a/include/QF/input/event.h +++ b/include/QF/input/event.h @@ -117,6 +117,6 @@ int IE_Send_Event (const IE_event_t *event); int IE_Add_Handler (ie_handler_t *event_handler, void *data); void IE_Remove_Handler (int handle); void IE_Set_Focus (int handle); -int IE_Get_Focus (void); +int IE_Get_Focus (void) __attribute__ ((pure)); #endif//__QF_in_event_h diff --git a/include/QF/input/imt.h b/include/QF/input/imt.h index a6e38334e..fc5192d9a 100644 --- a/include/QF/input/imt.h +++ b/include/QF/input/imt.h @@ -59,7 +59,7 @@ typedef struct in_context_s { int IMT_GetAxisBlock (int num_axes); int IMT_GetButtonBlock (int num_buttons); int IMT_CreateContext (const char *name); -int IMT_GetContext (void); +int IMT_GetContext (void) __attribute__ ((pure)); void IMT_SetContext (int ctx); void IMT_SetContextCbuf (int ctx, struct cbuf_s *cbuf); imt_t *IMT_FindIMT (const char *name); diff --git a/libs/console/client.c b/libs/console/client.c index 1e907be83..24b6acf78 100644 --- a/libs/console/client.c +++ b/libs/console/client.c @@ -648,7 +648,7 @@ draw_notify (view_t *view) static void setup_console (void) { - float lines; + float lines = 0; switch (con_state) { case con_inactive: diff --git a/libs/input/in_imt.c b/libs/input/in_imt.c index 2589d2f28..b47ae1b8a 100644 --- a/libs/input/in_imt.c +++ b/libs/input/in_imt.c @@ -185,7 +185,7 @@ IMT_CreateContext (const char *name) return ctx - in_contexts.a; } -static in_context_t * +static in_context_t * __attribute__ ((pure)) imt_find_context (const char *name) { for (size_t i = 0; i < in_contexts.size; i++) {