ci: fix static analyser with assertions

Signed-off-by: Stephan Lachnit <stephanlachnit@debian.org>
This commit is contained in:
Stephan Lachnit 2022-07-10 13:27:16 +02:00 committed by afayaz-feral
parent b58b32072a
commit 9b44fc6def

View File

@ -80,6 +80,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include <dlfcn.h>
#include <string.h>
#include <assert.h>
#include <sys/types.h>
static char internal_gamemode_client_error_string[512] = { 0 };
@ -231,6 +233,9 @@ __attribute__((always_inline)) static inline const char *gamemode_error_string(v
return internal_gamemode_client_error_string;
}
/* Assert for static analyser that the function is not NULL */
assert(REAL_internal_gamemode_error_string != NULL);
return REAL_internal_gamemode_error_string();
}
@ -254,6 +259,9 @@ int gamemode_request_start(void)
return -1;
}
/* Assert for static analyser that the function is not NULL */
assert(REAL_internal_gamemode_request_start != NULL);
if (REAL_internal_gamemode_request_start() < 0) {
#ifdef GAMEMODE_AUTO
fprintf(stderr, "gamemodeauto: %s\n", gamemode_error_string());
@ -280,6 +288,9 @@ int gamemode_request_end(void)
return -1;
}
/* Assert for static analyser that the function is not NULL */
assert(REAL_internal_gamemode_request_end != NULL);
if (REAL_internal_gamemode_request_end() < 0) {
#ifdef GAMEMODE_AUTO
fprintf(stderr, "gamemodeauto: %s\n", gamemode_error_string());