From 536b31829ab400277c30088c3b61827ebb99ca03 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Wed, 15 Aug 2018 17:01:54 +0200 Subject: [PATCH] Separate multi-words filenames by '_' Rename foobar.ext to foo_bar.ext. --- app/meson.build | 18 +++++++++--------- app/src/{controlevent.c => control_event.c} | 4 ++-- app/src/{controlevent.h => control_event.h} | 0 app/src/controller.c | 2 +- app/src/controller.h | 2 +- app/src/convert.h | 2 +- app/src/decoder.c | 2 +- app/src/file_handler.c | 2 +- app/src/{fpscounter.c => fps_counter.c} | 2 +- app/src/{fpscounter.h => fps_counter.h} | 0 app/src/frames.c | 2 +- app/src/frames.h | 2 +- app/src/{inputmanager.c => input_manager.c} | 4 ++-- app/src/{inputmanager.h => input_manager.h} | 2 +- app/src/{lockutil.c => lock_util.c} | 0 app/src/{lockutil.h => lock_util.h} | 0 app/src/scrcpy.c | 8 ++++---- app/src/screen.c | 4 ++-- app/src/{strutil.c => str_util.c} | 2 +- app/src/{strutil.h => str_util.h} | 0 app/src/sys/win/command.c | 2 +- app/src/{tinyxpm.c => tiny_xpm.c} | 2 +- app/src/{tinyxpm.h => tiny_xpm.h} | 0 app/tests/test_control_event_queue.c | 2 +- app/tests/test_control_event_serialize.c | 2 +- app/tests/test_strutil.c | 2 +- 26 files changed, 34 insertions(+), 34 deletions(-) rename app/src/{controlevent.c => control_event.c} (98%) rename app/src/{controlevent.h => control_event.h} (100%) rename app/src/{fpscounter.c => fps_counter.c} (98%) rename app/src/{fpscounter.h => fps_counter.h} (100%) rename app/src/{inputmanager.c => input_manager.c} (99%) rename app/src/{inputmanager.h => input_manager.h} (97%) rename app/src/{lockutil.c => lock_util.c} (100%) rename app/src/{lockutil.h => lock_util.h} (100%) rename app/src/{strutil.c => str_util.c} (97%) rename app/src/{strutil.h => str_util.h} (100%) rename app/src/{tinyxpm.c => tiny_xpm.c} (99%) rename app/src/{tinyxpm.h => tiny_xpm.h} (100%) diff --git a/app/meson.build b/app/meson.build index c09d772d..f2f1e339 100644 --- a/app/meson.build +++ b/app/meson.build @@ -1,22 +1,22 @@ src = [ 'src/main.c', 'src/command.c', - 'src/controlevent.c', + 'src/control_event.c', 'src/controller.c', 'src/convert.c', 'src/decoder.c', 'src/device.c', 'src/file_handler.c', - 'src/fpscounter.c', + 'src/fps_counter.c', 'src/frames.c', - 'src/inputmanager.c', - 'src/lockutil.c', + 'src/input_manager.c', + 'src/lock_util.c', 'src/net.c', 'src/scrcpy.c', 'src/screen.c', 'src/server.c', - 'src/strutil.c', - 'src/tinyxpm.c', + 'src/str_util.c', + 'src/tiny_xpm.c', ] if not get_option('crossbuild_windows') @@ -147,9 +147,9 @@ executable('scrcpy', src, dependencies: dependencies, include_directories: src_d ### TESTS tests = [ - ['test_control_event_queue', ['tests/test_control_event_queue.c', 'src/controlevent.c']], - ['test_control_event_serialize', ['tests/test_control_event_serialize.c', 'src/controlevent.c']], - ['test_strutil', ['tests/test_strutil.c', 'src/strutil.c']], + ['test_control_event_queue', ['tests/test_control_event_queue.c', 'src/control_event.c']], + ['test_control_event_serialize', ['tests/test_control_event_serialize.c', 'src/control_event.c']], + ['test_strutil', ['tests/test_strutil.c', 'src/str_util.c']], ] foreach t : tests diff --git a/app/src/controlevent.c b/app/src/control_event.c similarity index 98% rename from app/src/controlevent.c rename to app/src/control_event.c index edb7a1a2..78b6a4c6 100644 --- a/app/src/controlevent.c +++ b/app/src/control_event.c @@ -1,9 +1,9 @@ -#include "controlevent.h" +#include "control_event.h" #include #include -#include "lockutil.h" +#include "lock_util.h" #include "log.h" static inline void write16(Uint8 *buf, Uint16 value) { diff --git a/app/src/controlevent.h b/app/src/control_event.h similarity index 100% rename from app/src/controlevent.h rename to app/src/control_event.h diff --git a/app/src/controller.c b/app/src/controller.c index d4919c56..f659d4b9 100644 --- a/app/src/controller.c +++ b/app/src/controller.c @@ -2,7 +2,7 @@ #include #include "config.h" -#include "lockutil.h" +#include "lock_util.h" #include "log.h" SDL_bool controller_init(struct controller *controller, socket_t video_socket) { diff --git a/app/src/controller.h b/app/src/controller.h index 7c22fe07..08d639a6 100644 --- a/app/src/controller.h +++ b/app/src/controller.h @@ -1,7 +1,7 @@ #ifndef CONTROL_H #define CONTROL_H -#include "controlevent.h" +#include "control_event.h" #include #include diff --git a/app/src/convert.h b/app/src/convert.h index 5a535a37..30f0dd3d 100644 --- a/app/src/convert.h +++ b/app/src/convert.h @@ -3,7 +3,7 @@ #include #include -#include "controlevent.h" +#include "control_event.h" struct complete_mouse_motion_event { SDL_MouseMotionEvent *mouse_motion_event; diff --git a/app/src/decoder.c b/app/src/decoder.c index 94dc9401..9e90e4b7 100644 --- a/app/src/decoder.c +++ b/app/src/decoder.c @@ -9,7 +9,7 @@ #include "config.h" #include "events.h" #include "frames.h" -#include "lockutil.h" +#include "lock_util.h" #include "log.h" #define BUFSIZE 0x10000 diff --git a/app/src/file_handler.c b/app/src/file_handler.c index 24741b28..d1e0fd7b 100644 --- a/app/src/file_handler.c +++ b/app/src/file_handler.c @@ -5,7 +5,7 @@ #include "config.h" #include "command.h" #include "device.h" -#include "lockutil.h" +#include "lock_util.h" #include "log.h" struct request { diff --git a/app/src/fpscounter.c b/app/src/fps_counter.c similarity index 98% rename from app/src/fpscounter.c rename to app/src/fps_counter.c index 4cb512f3..27aa4ee0 100644 --- a/app/src/fpscounter.c +++ b/app/src/fps_counter.c @@ -1,4 +1,4 @@ -#include "fpscounter.h" +#include "fps_counter.h" #include diff --git a/app/src/fpscounter.h b/app/src/fps_counter.h similarity index 100% rename from app/src/fpscounter.h rename to app/src/fps_counter.h diff --git a/app/src/frames.c b/app/src/frames.c index 27fcc1fb..514d4788 100644 --- a/app/src/frames.c +++ b/app/src/frames.c @@ -6,7 +6,7 @@ #include #include "config.h" -#include "lockutil.h" +#include "lock_util.h" #include "log.h" SDL_bool frames_init(struct frames *frames) { diff --git a/app/src/frames.h b/app/src/frames.h index 7a52d2c8..437838fc 100644 --- a/app/src/frames.h +++ b/app/src/frames.h @@ -5,7 +5,7 @@ #include #include "config.h" -#include "fpscounter.h" +#include "fps_counter.h" // forward declarations typedef struct AVFrame AVFrame; diff --git a/app/src/inputmanager.c b/app/src/input_manager.c similarity index 99% rename from app/src/inputmanager.c rename to app/src/input_manager.c index 9dd95264..797fd764 100644 --- a/app/src/inputmanager.c +++ b/app/src/input_manager.c @@ -1,7 +1,7 @@ -#include "inputmanager.h" +#include "input_manager.h" #include "convert.h" -#include "lockutil.h" +#include "lock_util.h" #include "log.h" // Convert window coordinates (as provided by SDL_GetMouseState() to renderer coordinates (as provided in SDL mouse events) diff --git a/app/src/inputmanager.h b/app/src/input_manager.h similarity index 97% rename from app/src/inputmanager.h rename to app/src/input_manager.h index d7eaccbc..b9037aa1 100644 --- a/app/src/inputmanager.h +++ b/app/src/input_manager.h @@ -3,7 +3,7 @@ #include "common.h" #include "controller.h" -#include "fpscounter.h" +#include "fps_counter.h" #include "frames.h" #include "screen.h" diff --git a/app/src/lockutil.c b/app/src/lock_util.c similarity index 100% rename from app/src/lockutil.c rename to app/src/lock_util.c diff --git a/app/src/lockutil.h b/app/src/lock_util.h similarity index 100% rename from app/src/lockutil.h rename to app/src/lock_util.h diff --git a/app/src/scrcpy.c b/app/src/scrcpy.c index cee4e123..3eaa45c0 100644 --- a/app/src/scrcpy.c +++ b/app/src/scrcpy.c @@ -15,14 +15,14 @@ #include "events.h" #include "file_handler.h" #include "frames.h" -#include "fpscounter.h" -#include "inputmanager.h" +#include "fps_counter.h" +#include "input_manager.h" #include "log.h" -#include "lockutil.h" +#include "lock_util.h" #include "net.h" #include "screen.h" #include "server.h" -#include "tinyxpm.h" +#include "tiny_xpm.h" static struct server server = SERVER_INITIALIZER; static struct screen screen = SCREEN_INITIALIZER; diff --git a/app/src/screen.c b/app/src/screen.c index 5b4f0634..5d7a4009 100644 --- a/app/src/screen.c +++ b/app/src/screen.c @@ -4,9 +4,9 @@ #include #include "icon.xpm" -#include "lockutil.h" +#include "lock_util.h" #include "log.h" -#include "tinyxpm.h" +#include "tiny_xpm.h" #define DISPLAY_MARGINS 96 diff --git a/app/src/strutil.c b/app/src/str_util.c similarity index 97% rename from app/src/strutil.c rename to app/src/str_util.c index 0b5ac12d..0e090403 100644 --- a/app/src/strutil.c +++ b/app/src/str_util.c @@ -1,4 +1,4 @@ -#include "strutil.h" +#include "str_util.h" size_t xstrncpy(char *dest, const char *src, size_t n) { size_t i; diff --git a/app/src/strutil.h b/app/src/str_util.h similarity index 100% rename from app/src/strutil.h rename to app/src/str_util.h diff --git a/app/src/sys/win/command.c b/app/src/sys/win/command.c index 32d2a8b8..2552eeca 100644 --- a/app/src/sys/win/command.c +++ b/app/src/sys/win/command.c @@ -2,7 +2,7 @@ #include "config.h" #include "log.h" -#include "strutil.h" +#include "str_util.h" HANDLE cmd_execute(const char *path, const char *const argv[]) { STARTUPINFO si; diff --git a/app/src/tinyxpm.c b/app/src/tiny_xpm.c similarity index 99% rename from app/src/tinyxpm.c rename to app/src/tiny_xpm.c index 949aeeae..3b80b88e 100644 --- a/app/src/tinyxpm.c +++ b/app/src/tiny_xpm.c @@ -1,4 +1,4 @@ -#include "tinyxpm.h" +#include "tiny_xpm.h" #include #include diff --git a/app/src/tinyxpm.h b/app/src/tiny_xpm.h similarity index 100% rename from app/src/tinyxpm.h rename to app/src/tiny_xpm.h diff --git a/app/tests/test_control_event_queue.c b/app/tests/test_control_event_queue.c index dc89fa2d..07e547c1 100644 --- a/app/tests/test_control_event_queue.c +++ b/app/tests/test_control_event_queue.c @@ -1,7 +1,7 @@ #include #include -#include "controlevent.h" +#include "control_event.h" static void test_control_event_queue_empty() { struct control_event_queue queue; diff --git a/app/tests/test_control_event_serialize.c b/app/tests/test_control_event_serialize.c index e15c64bf..ad472776 100644 --- a/app/tests/test_control_event_serialize.c +++ b/app/tests/test_control_event_serialize.c @@ -1,7 +1,7 @@ #include #include -#include "controlevent.h" +#include "control_event.h" static void test_serialize_keycode_event() { struct control_event event = { diff --git a/app/tests/test_strutil.c b/app/tests/test_strutil.c index 6dbc2ff3..b00e01fe 100644 --- a/app/tests/test_strutil.c +++ b/app/tests/test_strutil.c @@ -1,7 +1,7 @@ #include #include -#include "strutil.h" +#include "str_util.h" static void test_xstrncpy_simple() { char s[] = "xxxxxxxxxx";