Browse Source

Remove unneeded includes

Marc Di Luzio 5 years ago
parent
commit
2e67906402

+ 0 - 4
common/common-external.c

@@ -34,10 +34,6 @@ POSSIBILITY OF SUCH DAMAGE.
 #include "common-external.h"
 #include "common-logging.h"
 
-#include <linux/limits.h>
-#include <stdio.h>
-#include <sys/time.h>
-#include <sys/types.h>
 #include <sys/wait.h>
 #include <unistd.h>
 

+ 0 - 2
common/common-governors.c

@@ -36,8 +36,6 @@ POSSIBILITY OF SUCH DAMAGE.
 
 #include <assert.h>
 #include <glob.h>
-#include <stdio.h>
-#include <string.h>
 
 /**
  * Discover all governers on the system.

+ 0 - 2
common/common-gpu.c

@@ -31,8 +31,6 @@ POSSIBILITY OF SUCH DAMAGE.
 #include "common-gpu.h"
 #include "common-logging.h"
 
-#include <stdio.h>
-
 /* Get the vendor for a device */
 enum GPUVendor gamemode_get_gpu_vendor(long device)
 {

+ 0 - 1
common/common-helpers.h

@@ -31,7 +31,6 @@ POSSIBILITY OF SUCH DAMAGE.
 
 #pragma once
 
-#include <stdio.h>
 #include <string.h>
 #include <sys/param.h>
 #include <unistd.h>

+ 0 - 1
common/common-logging.h

@@ -37,7 +37,6 @@ POSSIBILITY OF SUCH DAMAGE.
 #include <stdlib.h>
 #include <string.h>
 #include <syslog.h>
-#include <unistd.h>
 
 /* Macros to help with basic logging */
 #define PLOG_MSG(...) printf(__VA_ARGS__)

+ 0 - 4
daemon/gamemode-config.c

@@ -39,14 +39,10 @@ POSSIBILITY OF SUCH DAMAGE.
 #include "ini.h"
 
 #include <dirent.h>
-#include <linux/limits.h>
 #include <pthread.h>
 #include <pwd.h>
-#include <stdio.h>
-#include <string.h>
 #include <sys/inotify.h>
 #include <sys/stat.h>
-#include <sys/types.h>
 
 /* Name and possible location of the config file */
 #define CONFIG_NAME "gamemode.ini"

+ 2 - 4
daemon/gamemode-context.c

@@ -35,6 +35,7 @@ POSSIBILITY OF SUCH DAMAGE.
 #include "common-governors.h"
 #include "common-helpers.h"
 #include "common-logging.h"
+
 #include "gamemode-config.h"
 #include "gamemode.h"
 
@@ -42,11 +43,8 @@ POSSIBILITY OF SUCH DAMAGE.
 
 #include <fcntl.h>
 #include <pthread.h>
-#include <signal.h>
 #include <stdatomic.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <systemd/sd-daemon.h>
+#include <systemd/sd-daemon.h> /* TODO: Move usage to gamemode-dbus.c */
 #include <unistd.h>
 
 /**

+ 0 - 2
daemon/gamemode-dbus.c

@@ -34,8 +34,6 @@ POSSIBILITY OF SUCH DAMAGE.
 #include "common-logging.h"
 #include "gamemode.h"
 
-#include <stdlib.h>
-
 #include <systemd/sd-bus.h>
 #include <systemd/sd-daemon.h>
 

+ 1 - 0
daemon/gamemode-gpu.c

@@ -36,6 +36,7 @@ POSSIBILITY OF SUCH DAMAGE.
 #include "common-gpu.h"
 #include "common-helpers.h"
 #include "common-logging.h"
+
 #include "gamemode-config.h"
 #include "gamemode.h"
 

+ 0 - 3
daemon/gamemode-ioprio.c

@@ -37,10 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
 #include "gamemode.h"
 
 #include <dirent.h>
-#include <errno.h>
-#include <stdio.h>
 #include <sys/syscall.h>
-#include <unistd.h>
 
 /**
  * Define the syscall interface in Linux because it is missing from glibc

+ 0 - 3
daemon/gamemode-sched.c

@@ -36,10 +36,7 @@ POSSIBILITY OF SUCH DAMAGE.
 #include "gamemode.h"
 
 #include <dirent.h>
-#include <errno.h>
 #include <sched.h>
-#include <stdio.h>
-#include <string.h>
 #include <sys/resource.h>
 #include <sys/sysinfo.h>
 

+ 1 - 3
daemon/gamemode-tests.c

@@ -36,16 +36,14 @@ POSSIBILITY OF SUCH DAMAGE.
 #include "common-gpu.h"
 #include "common-helpers.h"
 #include "common-logging.h"
+
 #include "gamemode-config.h"
 #include "gamemode.h"
 #include "gamemode_client.h"
 
-#include <libgen.h>
 #include <pthread.h>
 #include <sys/syscall.h>
-#include <sys/types.h>
 #include <sys/wait.h>
-#include <unistd.h>
 
 struct GameModeConfig;
 

+ 0 - 5
daemon/gamemode-wine.c

@@ -37,12 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
 
 #include <ctype.h>
 #include <fcntl.h>
-#include <linux/limits.h>
 #include <pwd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
 
 /**
  * Detect if the process is a wine preloader process

+ 0 - 1
daemon/gamemode.h

@@ -32,7 +32,6 @@ POSSIBILITY OF SUCH DAMAGE.
 #pragma once
 
 #include <stdbool.h>
-#include <sys/types.h>
 
 #define INVALID_PROCFD -1
 

+ 1 - 4
daemon/gamemoded.c

@@ -60,11 +60,8 @@ POSSIBILITY OF SUCH DAMAGE.
 #include <fcntl.h>
 #include <getopt.h>
 #include <signal.h>
-#include <stdlib.h>
-#include <string.h>
 #include <sys/stat.h>
-#include <sys/types.h>
-#include <systemd/sd-daemon.h>
+#include <systemd/sd-daemon.h> /* TODO: Move usage to gamemode-dbus.c */
 #include <unistd.h>
 
 #define USAGE_TEXT                                                                                 \

+ 0 - 4
lib/client_impl.c

@@ -32,11 +32,7 @@ POSSIBILITY OF SUCH DAMAGE.
 #define _GNU_SOURCE
 
 #include <dbus/dbus.h>
-#include <dlfcn.h>
-#include <errno.h>
 #include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <unistd.h>

+ 1 - 3
util/cpugovctl.c

@@ -34,9 +34,7 @@ POSSIBILITY OF SUCH DAMAGE.
 #include "common-governors.h"
 #include "common-logging.h"
 
-#include <ctype.h>
-#include <errno.h>
-#include <sys/types.h>
+#include <unistd.h>
 
 /**
  * Sets all governors to a value

+ 1 - 0
util/gpuclockctl.c

@@ -36,6 +36,7 @@ POSSIBILITY OF SUCH DAMAGE.
 #include "common-logging.h"
 
 #include <limits.h>
+#include <unistd.h>
 
 /* NV constants */
 #define NV_CORE_OFFSET_ATTRIBUTE "GPUGraphicsClockOffset"