From 51a29bf4831a1925f364e3b17400f0c400578573 Mon Sep 17 00:00:00 2001 From: Adrien Plazas Date: Sun, 20 Dec 2020 09:51:08 +0100 Subject: [PATCH 1/3] environement: Add a missing const modifier Setter environment commands have const values. --- retro-runner/retro-environment.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/retro-runner/retro-environment.c b/retro-runner/retro-environment.c index 16fc47f..a5adccb 100644 --- a/retro-runner/retro-environment.c +++ b/retro-runner/retro-environment.c @@ -553,8 +553,8 @@ set_rotation (RetroCore *self, } static gboolean -set_support_no_game (RetroCore *self, - bool *support_no_game) +set_support_no_game (RetroCore *self, + const bool *support_no_game) { retro_debug ("Set support no game: %s", TRUENESS (*support_no_game)); @@ -685,7 +685,7 @@ environment_core_command (RetroCore *self, return set_rotation (self, (RetroRotation *) data); case RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME: - return set_support_no_game (self, (bool *) data); + return set_support_no_game (self, (const bool *) data); case RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO: return set_system_av_info (self, (RetroSystemAvInfo *) data); -- GitLab From 807b6da0693ed29fafac625fab22ca74f9e7344a Mon Sep 17 00:00:00 2001 From: Adrien Plazas Date: Sun, 20 Dec 2020 10:14:57 +0100 Subject: [PATCH 2/3] core: Sanitize bool setters While the values are unlikely to case issues, being careful doesn't hurt. --- retro-runner/retro-core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/retro-runner/retro-core.c b/retro-runner/retro-core.c index 79a8cf1..ebe31a1 100644 --- a/retro-runner/retro-core.c +++ b/retro-runner/retro-core.c @@ -1248,6 +1248,8 @@ retro_core_set_support_no_game (RetroCore *self, { g_return_if_fail (RETRO_IS_CORE (self)); + support_no_game = !!support_no_game; + if (retro_core_get_support_no_game (self) == support_no_game) return; -- GitLab From 3592fd2b099175a75586ca8543f0078024db28ff Mon Sep 17 00:00:00 2001 From: Adrien Plazas Date: Sun, 20 Dec 2020 10:15:37 +0100 Subject: [PATCH 3/3] core: Fix a documentation copypasta error --- retro-runner/retro-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retro-runner/retro-core.c b/retro-runner/retro-core.c index ebe31a1..3dbc0fa 100644 --- a/retro-runner/retro-core.c +++ b/retro-runner/retro-core.c @@ -1238,7 +1238,7 @@ retro_core_get_support_no_game (RetroCore *self) /** * retro_core_set_support_no_game: * @self: a #RetroCore - * @support_no_game: the save directory + * @support_no_game: whether the core supports running with no game * * Sets whether the core supports running with no game. */ -- GitLab