From 1f8ba1ca79f4915f3a7b3c5199258904e3192445 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Sun, 29 Sep 2019 22:36:56 +0200 Subject: [PATCH] Include config.h everywhere Ref: Suggested-by: Louis Kruger --- app/src/buffer_util.h | 2 ++ app/src/cbuf.h | 2 ++ app/src/command.c | 1 + app/src/command.h | 2 ++ app/src/common.h | 2 ++ app/src/control_msg.c | 1 + app/src/control_msg.h | 1 + app/src/controller.h | 1 + app/src/decoder.c | 2 +- app/src/decoder.h | 2 ++ app/src/device.c | 2 ++ app/src/device.h | 1 + app/src/device_msg.c | 1 + app/src/device_msg.h | 2 ++ app/src/event_converter.c | 2 ++ app/src/event_converter.h | 1 + app/src/file_handler.h | 1 + app/src/fps_counter.c | 1 + app/src/fps_counter.h | 2 ++ app/src/input_manager.c | 2 ++ app/src/input_manager.h | 1 + app/src/lock_util.h | 1 + app/src/main.c | 2 +- app/src/net.c | 1 + app/src/net.h | 2 ++ app/src/queue.h | 2 ++ app/src/receiver.h | 1 + app/src/recorder.c | 2 +- app/src/recorder.h | 1 + app/src/scrcpy.c | 1 + app/src/scrcpy.h | 2 ++ app/src/screen.h | 1 + app/src/server.h | 1 + app/src/str_util.c | 2 ++ app/src/str_util.h | 2 ++ app/src/stream.c | 2 +- app/src/stream.h | 1 + app/src/sys/unix/command.c | 2 ++ app/src/sys/unix/net.c | 2 ++ app/src/sys/win/net.c | 1 + app/src/tiny_xpm.c | 1 + app/src/tiny_xpm.h | 2 ++ app/src/video_buffer.h | 1 + 43 files changed, 61 insertions(+), 4 deletions(-) diff --git a/app/src/buffer_util.h b/app/src/buffer_util.h index a79014b1..681421f3 100644 --- a/app/src/buffer_util.h +++ b/app/src/buffer_util.h @@ -4,6 +4,8 @@ #include #include +#include "config.h" + static inline void buffer_write16be(uint8_t *buf, uint16_t value) { buf[0] = value >> 8; diff --git a/app/src/cbuf.h b/app/src/cbuf.h index 35b39b7b..c18e4680 100644 --- a/app/src/cbuf.h +++ b/app/src/cbuf.h @@ -5,6 +5,8 @@ #include #include +#include "config.h" + // To define a circular buffer type of 20 ints: // struct cbuf_int CBUF(int, 20); // diff --git a/app/src/command.c b/app/src/command.c index 4cb2e408..d914e6ab 100644 --- a/app/src/command.c +++ b/app/src/command.c @@ -5,6 +5,7 @@ #include #include +#include "config.h" #include "common.h" #include "log.h" #include "str_util.h" diff --git a/app/src/command.h b/app/src/command.h index db6358da..d119c9bb 100644 --- a/app/src/command.h +++ b/app/src/command.h @@ -33,6 +33,8 @@ #endif +#include "config.h" + # define NO_EXIT_CODE -1 enum process_result { diff --git a/app/src/common.h b/app/src/common.h index 8963f058..e5cbe953 100644 --- a/app/src/common.h +++ b/app/src/common.h @@ -3,6 +3,8 @@ #include +#include "config.h" + #define ARRAY_LEN(a) (sizeof(a) / sizeof(a[0])) #define MIN(X,Y) (X) < (Y) ? (X) : (Y) #define MAX(X,Y) (X) > (Y) ? (X) : (Y) diff --git a/app/src/control_msg.c b/app/src/control_msg.c index 9c3d9849..fff93592 100644 --- a/app/src/control_msg.c +++ b/app/src/control_msg.c @@ -2,6 +2,7 @@ #include +#include "config.h" #include "buffer_util.h" #include "log.h" #include "str_util.h" diff --git a/app/src/control_msg.h b/app/src/control_msg.h index e7fdfc4c..308d54a3 100644 --- a/app/src/control_msg.h +++ b/app/src/control_msg.h @@ -5,6 +5,7 @@ #include #include +#include "config.h" #include "android/input.h" #include "android/keycodes.h" #include "common.h" diff --git a/app/src/controller.h b/app/src/controller.h index ae13e39f..1b0d005b 100644 --- a/app/src/controller.h +++ b/app/src/controller.h @@ -5,6 +5,7 @@ #include #include +#include "config.h" #include "cbuf.h" #include "control_msg.h" #include "net.h" diff --git a/app/src/decoder.c b/app/src/decoder.c index 8fa218f4..cad19913 100644 --- a/app/src/decoder.c +++ b/app/src/decoder.c @@ -8,8 +8,8 @@ #include #include -#include "compat.h" #include "config.h" +#include "compat.h" #include "buffer_util.h" #include "events.h" #include "lock_util.h" diff --git a/app/src/decoder.h b/app/src/decoder.h index 76fee80e..f243812c 100644 --- a/app/src/decoder.h +++ b/app/src/decoder.h @@ -4,6 +4,8 @@ #include #include +#include "config.h" + struct video_buffer; struct decoder { diff --git a/app/src/device.c b/app/src/device.c index 8027ccbb..4f50ab48 100644 --- a/app/src/device.c +++ b/app/src/device.c @@ -1,4 +1,6 @@ #include "device.h" + +#include "config.h" #include "log.h" bool diff --git a/app/src/device.h b/app/src/device.h index 828443d7..34a5f17f 100644 --- a/app/src/device.h +++ b/app/src/device.h @@ -3,6 +3,7 @@ #include +#include "config.h" #include "common.h" #include "net.h" diff --git a/app/src/device_msg.c b/app/src/device_msg.c index a90d78dd..2fc90ae4 100644 --- a/app/src/device_msg.c +++ b/app/src/device_msg.c @@ -3,6 +3,7 @@ #include #include +#include "config.h" #include "buffer_util.h" #include "log.h" diff --git a/app/src/device_msg.h b/app/src/device_msg.h index fd4a7eb1..04723597 100644 --- a/app/src/device_msg.h +++ b/app/src/device_msg.h @@ -5,6 +5,8 @@ #include #include +#include "config.h" + #define DEVICE_MSG_TEXT_MAX_LENGTH 4093 #define DEVICE_MSG_SERIALIZED_MAX_SIZE (3 + DEVICE_MSG_TEXT_MAX_LENGTH) diff --git a/app/src/event_converter.c b/app/src/event_converter.c index dea61eee..da4b2e30 100644 --- a/app/src/event_converter.c +++ b/app/src/event_converter.c @@ -1,5 +1,7 @@ #include "event_converter.h" +#include "config.h" + #define MAP(FROM, TO) case FROM: *to = TO; return true #define FAIL default: return false diff --git a/app/src/event_converter.h b/app/src/event_converter.h index 2d7aa1ae..e0b24c15 100644 --- a/app/src/event_converter.h +++ b/app/src/event_converter.h @@ -4,6 +4,7 @@ #include #include +#include "config.h" #include "control_msg.h" struct complete_mouse_motion_event { diff --git a/app/src/file_handler.h b/app/src/file_handler.h index 3418c532..4c158296 100644 --- a/app/src/file_handler.h +++ b/app/src/file_handler.h @@ -5,6 +5,7 @@ #include #include +#include "config.h" #include "cbuf.h" #include "command.h" diff --git a/app/src/fps_counter.c b/app/src/fps_counter.c index daece470..2a9478f6 100644 --- a/app/src/fps_counter.c +++ b/app/src/fps_counter.c @@ -3,6 +3,7 @@ #include #include +#include "config.h" #include "lock_util.h" #include "log.h" diff --git a/app/src/fps_counter.h b/app/src/fps_counter.h index 6b560a35..1c56bb01 100644 --- a/app/src/fps_counter.h +++ b/app/src/fps_counter.h @@ -7,6 +7,8 @@ #include #include +#include "config.h" + struct fps_counter { SDL_Thread *thread; SDL_mutex *mutex; diff --git a/app/src/input_manager.c b/app/src/input_manager.c index e6b3738b..cf2a7519 100644 --- a/app/src/input_manager.c +++ b/app/src/input_manager.c @@ -1,6 +1,8 @@ #include "input_manager.h" #include + +#include "config.h" #include "event_converter.h" #include "lock_util.h" #include "log.h" diff --git a/app/src/input_manager.h b/app/src/input_manager.h index 83cb7405..61a0447f 100644 --- a/app/src/input_manager.h +++ b/app/src/input_manager.h @@ -3,6 +3,7 @@ #include +#include "config.h" #include "common.h" #include "controller.h" #include "fps_counter.h" diff --git a/app/src/lock_util.h b/app/src/lock_util.h index d1ca7336..260d2c12 100644 --- a/app/src/lock_util.h +++ b/app/src/lock_util.h @@ -4,6 +4,7 @@ #include #include +#include "config.h" #include "log.h" static inline void diff --git a/app/src/main.c b/app/src/main.c index 3be74d6b..c00bf419 100644 --- a/app/src/main.c +++ b/app/src/main.c @@ -8,8 +8,8 @@ #define SDL_MAIN_HANDLED // avoid link error on Linux Windows Subsystem #include -#include "compat.h" #include "config.h" +#include "compat.h" #include "log.h" #include "recorder.h" diff --git a/app/src/net.c b/app/src/net.c index a0bc38f2..bf4389dd 100644 --- a/app/src/net.c +++ b/app/src/net.c @@ -2,6 +2,7 @@ #include +#include "config.h" #include "log.h" #ifdef __WINDOWS__ diff --git a/app/src/net.h b/app/src/net.h index dd82c083..ffd5dd89 100644 --- a/app/src/net.h +++ b/app/src/net.h @@ -17,6 +17,8 @@ typedef int socket_t; #endif +#include "config.h" + bool net_init(void); diff --git a/app/src/queue.h b/app/src/queue.h index ed3d4c21..6cf7aba6 100644 --- a/app/src/queue.h +++ b/app/src/queue.h @@ -6,6 +6,8 @@ #include #include +#include "config.h" + // To define a queue type of "struct foo": // struct queue_foo QUEUE(struct foo); #define QUEUE(TYPE) { \ diff --git a/app/src/receiver.h b/app/src/receiver.h index c119b827..6108e545 100644 --- a/app/src/receiver.h +++ b/app/src/receiver.h @@ -5,6 +5,7 @@ #include #include +#include "config.h" #include "net.h" // receive events from the device diff --git a/app/src/recorder.c b/app/src/recorder.c index 0d4e4e68..77186350 100644 --- a/app/src/recorder.c +++ b/app/src/recorder.c @@ -3,8 +3,8 @@ #include #include -#include "compat.h" #include "config.h" +#include "compat.h" #include "lock_util.h" #include "log.h" diff --git a/app/src/recorder.h b/app/src/recorder.h index af541882..b1953fcb 100644 --- a/app/src/recorder.h +++ b/app/src/recorder.h @@ -6,6 +6,7 @@ #include #include +#include "config.h" #include "common.h" #include "queue.h" diff --git a/app/src/scrcpy.c b/app/src/scrcpy.c index ed988778..defcb751 100644 --- a/app/src/scrcpy.c +++ b/app/src/scrcpy.c @@ -7,6 +7,7 @@ #include #include +#include "config.h" #include "command.h" #include "common.h" #include "compat.h" diff --git a/app/src/scrcpy.h b/app/src/scrcpy.h index faeb246f..1593fb1e 100644 --- a/app/src/scrcpy.h +++ b/app/src/scrcpy.h @@ -5,6 +5,8 @@ #include #include +#include "config.h" + struct scrcpy_options { const char *serial; const char *crop; diff --git a/app/src/screen.h b/app/src/screen.h index 63da6aa5..bc189189 100644 --- a/app/src/screen.h +++ b/app/src/screen.h @@ -5,6 +5,7 @@ #include #include +#include "config.h" #include "common.h" struct video_buffer; diff --git a/app/src/server.h b/app/src/server.h index 4970d64e..2140d8ab 100644 --- a/app/src/server.h +++ b/app/src/server.h @@ -4,6 +4,7 @@ #include #include +#include "config.h" #include "command.h" #include "net.h" diff --git a/app/src/str_util.c b/app/src/str_util.c index 7d46a1a0..15378d8a 100644 --- a/app/src/str_util.c +++ b/app/src/str_util.c @@ -10,6 +10,8 @@ #include +#include "config.h" + size_t xstrncpy(char *dest, const char *src, size_t n) { size_t i; diff --git a/app/src/str_util.h b/app/src/str_util.h index 0b7a571a..56490190 100644 --- a/app/src/str_util.h +++ b/app/src/str_util.h @@ -3,6 +3,8 @@ #include +#include "config.h" + // like strncpy, except: // - it copies at most n-1 chars // - the dest string is nul-terminated diff --git a/app/src/stream.c b/app/src/stream.c index bca89f71..6c3192f2 100644 --- a/app/src/stream.c +++ b/app/src/stream.c @@ -8,8 +8,8 @@ #include #include -#include "compat.h" #include "config.h" +#include "compat.h" #include "buffer_util.h" #include "decoder.h" #include "events.h" diff --git a/app/src/stream.h b/app/src/stream.h index 160ed7f5..cb50468e 100644 --- a/app/src/stream.h +++ b/app/src/stream.h @@ -7,6 +7,7 @@ #include #include +#include "config.h" #include "net.h" struct video_buffer; diff --git a/app/src/sys/unix/command.c b/app/src/sys/unix/command.c index 9e00ccf8..6a3a5a47 100644 --- a/app/src/sys/unix/command.c +++ b/app/src/sys/unix/command.c @@ -7,6 +7,8 @@ #include "command.h" +#include "config.h" + #include #include #include diff --git a/app/src/sys/unix/net.c b/app/src/sys/unix/net.c index 199cd7c2..d940f3bb 100644 --- a/app/src/sys/unix/net.c +++ b/app/src/sys/unix/net.c @@ -2,6 +2,8 @@ #include +#include "config.h" + bool net_init(void) { // do nothing diff --git a/app/src/sys/win/net.c b/app/src/sys/win/net.c index dc483682..55519782 100644 --- a/app/src/sys/win/net.c +++ b/app/src/sys/win/net.c @@ -1,5 +1,6 @@ #include "net.h" +#include "config.h" #include "log.h" bool diff --git a/app/src/tiny_xpm.c b/app/src/tiny_xpm.c index 0fb410f3..5ea89078 100644 --- a/app/src/tiny_xpm.c +++ b/app/src/tiny_xpm.c @@ -5,6 +5,7 @@ #include #include +#include "config.h" #include "log.h" struct index { diff --git a/app/src/tiny_xpm.h b/app/src/tiny_xpm.h index 85dea5c2..6e6f8035 100644 --- a/app/src/tiny_xpm.h +++ b/app/src/tiny_xpm.h @@ -3,6 +3,8 @@ #include +#include "config.h" + SDL_Surface * read_xpm(char *xpm[]); diff --git a/app/src/video_buffer.h b/app/src/video_buffer.h index 26a6fa1f..303b3fc2 100644 --- a/app/src/video_buffer.h +++ b/app/src/video_buffer.h @@ -4,6 +4,7 @@ #include #include +#include "config.h" #include "fps_counter.h" // forward declarations