From ddc802573a5afe78c07428fadf1d7a0c33dc1240 Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Tue, 14 May 2019 20:22:02 +0100 Subject: [PATCH 1/4] Remove unneeded includes in gamemode_client.h --- lib/gamemode_client.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/gamemode_client.h b/lib/gamemode_client.h index dfc67e7..1e5e33b 100644 --- a/lib/gamemode_client.h +++ b/lib/gamemode_client.h @@ -68,11 +68,8 @@ POSSIBILITY OF SUCH DAMAGE. #include #include -#include -#include #include -#include #include #include From ddecc89f103aee117a1caa7ca1f1a9b77648ee10 Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Tue, 14 May 2019 20:29:37 +0100 Subject: [PATCH 2/4] Add a note about GAMEMODE_AUTO and blocking calls --- lib/gamemode_client.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/gamemode_client.h b/lib/gamemode_client.h index 1e5e33b..41d8ac1 100644 --- a/lib/gamemode_client.h +++ b/lib/gamemode_client.h @@ -42,6 +42,9 @@ POSSIBILITY OF SUCH DAMAGE. * 0 if the request was sent successfully * -1 if the request failed * + * GAMEMODE_AUTO can be defined to make the above two functions apply during static init and + * destruction, as appropriate. In this configuration, errors will be printed to stderr + * * int gamemode_query_status() - Query the current status of gamemode * 0 if gamemode is inactive * 1 if gamemode is active @@ -64,6 +67,9 @@ POSSIBILITY OF SUCH DAMAGE. * * const char* gamemode_error_string() - Get an error string * returns a string describing any of the above errors + * + * Note: All the above requests can be blocking - dbus requests can and will block while the daemon + * handles the request. It is not recommended to make these calls in performance critical code */ #include From 7ede50af39b0a3b89605eec8410e957a8ae591c5 Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Wed, 15 May 2019 18:52:52 +0100 Subject: [PATCH 3/4] Make sure we actually build the examples in the travis tests Otherwise failing changes to gamemode_client.h risk passing --- .travis.yml | 2 +- bootstrap.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ed38501..cd2bde2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,5 +19,5 @@ before_script: script: - ./scripts/format-check.sh - - ./bootstrap.sh + - ./bootstrap.sh -Dwith-examples=true - gamemoded -v diff --git a/bootstrap.sh b/bootstrap.sh index eb643b9..bd107c9 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -26,7 +26,7 @@ fi # Echo the rest so it's obvious set -x -meson --prefix=$prefix build --buildtype debugoptimized -Dwith-systemd-user-unit-dir=/etc/systemd/user +meson --prefix=$prefix build --buildtype debugoptimized -Dwith-systemd-user-unit-dir=/etc/systemd/user "$@" cd build ninja From f41ecda047e7b60bd0e2f5d2fd9f82104552ccb2 Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Tue, 14 May 2019 20:25:54 +0100 Subject: [PATCH 4/4] Fix a missing e --- lib/gamemode_client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gamemode_client.h b/lib/gamemode_client.h index 41d8ac1..a503463 100644 --- a/lib/gamemode_client.h +++ b/lib/gamemode_client.h @@ -233,7 +233,7 @@ __attribute__((always_inline)) static inline const char *gamemode_error_string(v } /** - * Redirect to the real libgamemod + * Redirect to the real libgamemode * Allow automatically requesting game mode * Also prints errors as they happen. */