From ecb1939ff1ecbb190a28a9eb3544c2a58d210305 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Wed, 2 Apr 2014 23:50:20 -0700 Subject: [PATCH] Move common headers to common.h, remove util and debugger from being first class include directories --- CMakeLists.txt | 3 +-- src/arm/arm.c | 2 -- src/arm/arm.h | 14 +------------- src/arm/common.h | 26 ++++++++++++++++++++++++++ src/arm/isa-arm.h | 2 +- src/arm/isa-inlines.h | 2 ++ src/arm/isa-thumb.h | 2 +- src/debugger/cli-debugger.c | 5 ----- src/debugger/cli-debugger.h | 2 ++ src/debugger/debugger.c | 2 -- src/debugger/debugger.h | 2 ++ src/debugger/gdb-stub.c | 2 -- src/debugger/gdb-stub.h | 7 +++++-- src/debugger/memory-debugger.c | 2 -- src/debugger/memory-debugger.h | 2 ++ src/gba/gba-audio.c | 3 --- src/gba/gba-audio.h | 4 ++-- src/gba/gba-bios.c | 3 --- src/gba/gba-bios.h | 4 ++-- src/gba/gba-gpio.h | 2 +- src/gba/gba-io.h | 2 ++ src/gba/gba-memory.c | 6 +----- src/gba/gba-memory.h | 4 ++-- src/gba/gba-savedata.c | 5 ++--- src/gba/gba-savedata.h | 2 +- src/gba/gba-sensors.h | 2 +- src/gba/gba-serialize.c | 7 ++----- src/gba/gba-serialize.h | 2 ++ src/gba/gba-sio.c | 2 -- src/gba/gba-sio.h | 2 +- src/gba/gba-thread.c | 4 ++-- src/gba/gba-thread.h | 5 ++++- src/gba/gba-video.c | 4 +--- src/gba/gba-video.h | 4 ++-- src/gba/gba.c | 9 +++------ src/gba/gba.h | 6 +++--- src/gba/hle-bios.h | 3 +-- src/gba/renderers/video-glsl.h | 2 ++ src/gba/renderers/video-software.c | 2 -- src/gba/renderers/video-software.h | 4 ++-- src/platform/glsl-main.c | 1 - src/platform/perf-main.c | 3 --- src/platform/posix/memory.c | 2 +- src/platform/sdl/egl-main.c | 3 +-- src/platform/sdl/gl-main.c | 2 +- src/platform/sdl/sdl-audio.h | 2 ++ src/platform/sdl/sdl-events.c | 2 +- src/platform/sdl/sdl-events.h | 2 ++ src/platform/sdl/sw-main.c | 3 +-- src/platform/windows/memory.c | 2 +- src/util/circle-buffer.c | 3 --- src/util/circle-buffer.h | 3 +-- src/util/memory.h | 4 ++-- src/util/socket.h | 4 ++-- src/util/threading.h | 1 + 55 files changed, 98 insertions(+), 107 deletions(-) create mode 100644 src/arm/common.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f1635f18..94b9b8b41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,8 +16,7 @@ source_group("GBA board" FILES ${GBA_SRC} ${RENDERER_SRC}) source_group("Utilities" FILES ${UTIL_SRC}) include_directories(${CMAKE_SOURCE_DIR}/src/arm) include_directories(${CMAKE_SOURCE_DIR}/src/gba) -include_directories(${CMAKE_SOURCE_DIR}/src/debugger) -include_directories(${CMAKE_SOURCE_DIR}/src/util) +include_directories(${CMAKE_SOURCE_DIR}/src) if(WIN32) add_definitions(-D_WIN32_WINNT=0x0600) diff --git a/src/arm/arm.c b/src/arm/arm.c index b7c71dc76..80ec9a1d4 100644 --- a/src/arm/arm.c +++ b/src/arm/arm.c @@ -4,8 +4,6 @@ #include "isa-inlines.h" #include "isa-thumb.h" -#include - static inline enum RegisterBank _ARMSelectBank(enum PrivilegeMode); void ARMSetPrivilegeMode(struct ARMCore* cpu, enum PrivilegeMode mode) { diff --git a/src/arm/arm.h b/src/arm/arm.h index 7ff221ad5..b47c50cdb 100644 --- a/src/arm/arm.h +++ b/src/arm/arm.h @@ -1,19 +1,7 @@ #ifndef ARM_H #define ARM_H -#include - -#ifdef __POWERPC__ -#define LOAD_32(DEST, ADDR, ARR) asm("lwbrx %0, %1, %2" : "=r"(DEST) : "r"(ADDR), "r"(ARR)) -#define LOAD_16(DEST, ADDR, ARR) asm("lhbrx %0, %1, %2" : "=r"(DEST) : "r"(ADDR), "r"(ARR)) -#define STORE_32(SRC, ADDR, ARR) asm("stwbrx %0, %1, %2" : : "r"(SRC), "r"(ADDR), "r"(ARR)) -#define STORE_16(SRC, ADDR, ARR) asm("sthbrx %0, %1, %2" : : "r"(SRC), "r"(ADDR), "r"(ARR)) -#else -#define LOAD_32(DEST, ADDR, ARR) DEST = ((uint32_t*) ARR)[(ADDR) >> 2] -#define LOAD_16(DEST, ADDR, ARR) DEST = ((uint16_t*) ARR)[(ADDR) >> 1] -#define STORE_32(SRC, ADDR, ARR) ((uint32_t*) ARR)[(ADDR) >> 2] = SRC -#define STORE_16(SRC, ADDR, ARR) ((uint16_t*) ARR)[(ADDR) >> 1] = SRC -#endif +#include "common.h" enum { ARM_SP = 13, diff --git a/src/arm/common.h b/src/arm/common.h new file mode 100644 index 000000000..a9ef1edfd --- /dev/null +++ b/src/arm/common.h @@ -0,0 +1,26 @@ +#ifndef COMMON_H +#define COMMON_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __POWERPC__ +#define LOAD_32(DEST, ADDR, ARR) asm("lwbrx %0, %1, %2" : "=r"(DEST) : "r"(ADDR), "r"(ARR)) +#define LOAD_16(DEST, ADDR, ARR) asm("lhbrx %0, %1, %2" : "=r"(DEST) : "r"(ADDR), "r"(ARR)) +#define STORE_32(SRC, ADDR, ARR) asm("stwbrx %0, %1, %2" : : "r"(SRC), "r"(ADDR), "r"(ARR)) +#define STORE_16(SRC, ADDR, ARR) asm("sthbrx %0, %1, %2" : : "r"(SRC), "r"(ADDR), "r"(ARR)) +#else +#define LOAD_32(DEST, ADDR, ARR) DEST = ((uint32_t*) ARR)[(ADDR) >> 2] +#define LOAD_16(DEST, ADDR, ARR) DEST = ((uint16_t*) ARR)[(ADDR) >> 1] +#define STORE_32(SRC, ADDR, ARR) ((uint32_t*) ARR)[(ADDR) >> 2] = SRC +#define STORE_16(SRC, ADDR, ARR) ((uint16_t*) ARR)[(ADDR) >> 1] = SRC +#endif + +#endif diff --git a/src/arm/isa-arm.h b/src/arm/isa-arm.h index e25c2d482..26dfba455 100644 --- a/src/arm/isa-arm.h +++ b/src/arm/isa-arm.h @@ -1,7 +1,7 @@ #ifndef ISA_ARM_H #define ISA_ARM_H -#include +#include "common.h" #define ARM_PREFETCH_CYCLES (1 + cpu->memory->activePrefetchCycles32) diff --git a/src/arm/isa-inlines.h b/src/arm/isa-inlines.h index 8c25638f5..a7c3d541e 100644 --- a/src/arm/isa-inlines.h +++ b/src/arm/isa-inlines.h @@ -1,6 +1,8 @@ #ifndef ISA_INLINES_H #define ISA_INLINES_H +#include "common.h" + #include "arm.h" #define UNUSED(V) (void)(V) diff --git a/src/arm/isa-thumb.h b/src/arm/isa-thumb.h index 626e1c4a5..715086643 100644 --- a/src/arm/isa-thumb.h +++ b/src/arm/isa-thumb.h @@ -1,7 +1,7 @@ #ifndef ISA_THUMB_H #define ISA_THUMB_H -#include +#include "common.h" struct ARMCore; diff --git a/src/debugger/cli-debugger.c b/src/debugger/cli-debugger.c index a9983ef5c..fc5c89b76 100644 --- a/src/debugger/cli-debugger.c +++ b/src/debugger/cli-debugger.c @@ -1,11 +1,6 @@ #include "cli-debugger.h" #include -#include -#include -#include -#include -#include #ifdef USE_PTHREADS #include diff --git a/src/debugger/cli-debugger.h b/src/debugger/cli-debugger.h index 11a63c920..b4b97a3a4 100644 --- a/src/debugger/cli-debugger.h +++ b/src/debugger/cli-debugger.h @@ -1,6 +1,8 @@ #ifndef CLI_DEBUGGER_H #define CLI_DEBUGGER_H +#include "common.h" + #include "debugger.h" #include diff --git a/src/debugger/debugger.c b/src/debugger/debugger.c index af88b485c..ded8f6d79 100644 --- a/src/debugger/debugger.c +++ b/src/debugger/debugger.c @@ -4,8 +4,6 @@ #include "memory-debugger.h" -#include - static void _checkBreakpoints(struct ARMDebugger* debugger) { struct DebugBreakpoint* breakpoint; int instructionLength; diff --git a/src/debugger/debugger.h b/src/debugger/debugger.h index 1752108b6..7a7fdd870 100644 --- a/src/debugger/debugger.h +++ b/src/debugger/debugger.h @@ -1,6 +1,8 @@ #ifndef DEBUGGER_H #define DEBUGGER_H +#include "common.h" + #include "arm.h" enum DebuggerState { diff --git a/src/debugger/gdb-stub.c b/src/debugger/gdb-stub.c index b8759a12d..f6252737f 100644 --- a/src/debugger/gdb-stub.c +++ b/src/debugger/gdb-stub.c @@ -1,8 +1,6 @@ #include "gdb-stub.h" #include -#include -#include enum GDBError { GDB_NO_ERROR = 0x00, diff --git a/src/debugger/gdb-stub.h b/src/debugger/gdb-stub.h index b60540edf..9f80ae196 100644 --- a/src/debugger/gdb-stub.h +++ b/src/debugger/gdb-stub.h @@ -1,8 +1,11 @@ #ifndef GDB_STUB_H #define GDB_STUB_H -#include "debugger.h" -#include "socket.h" +#include "common.h" + +#include "debugger/debugger.h" + +#include "util/socket.h" #define GDB_STUB_MAX_LINE 1200 diff --git a/src/debugger/memory-debugger.c b/src/debugger/memory-debugger.c index f491d22ae..5a1538cb0 100644 --- a/src/debugger/memory-debugger.c +++ b/src/debugger/memory-debugger.c @@ -2,8 +2,6 @@ #include "debugger.h" -#include - static void ARMDebuggerShim_store32(struct ARMMemory*, uint32_t address, int32_t value, int* cycleCounter); static void ARMDebuggerShim_store16(struct ARMMemory*, uint32_t address, int16_t value, int* cycleCounter); static void ARMDebuggerShim_store8(struct ARMMemory*, uint32_t address, int8_t value, int* cycleCounter); diff --git a/src/debugger/memory-debugger.h b/src/debugger/memory-debugger.h index fc47369a1..a1a007803 100644 --- a/src/debugger/memory-debugger.h +++ b/src/debugger/memory-debugger.h @@ -1,6 +1,8 @@ #ifndef MEMORY_DEBUGGER_H #define MEMORY_DEBUGGER_H +#include "common.h" + #include "arm.h" struct ARMDebugger; diff --git a/src/gba/gba-audio.c b/src/gba/gba-audio.c index a3bc982dd..249c66076 100644 --- a/src/gba/gba-audio.c +++ b/src/gba/gba-audio.c @@ -5,9 +5,6 @@ #include "gba-serialize.h" #include "gba-thread.h" -#include -#include - const unsigned GBA_AUDIO_SAMPLES = 512; const unsigned GBA_AUDIO_FIFO_SIZE = 8 * sizeof(int32_t); #define SWEEP_CYCLES (GBA_ARM7TDMI_FREQUENCY / 128) diff --git a/src/gba/gba-audio.h b/src/gba/gba-audio.h index f09078eaf..f905af45c 100644 --- a/src/gba/gba-audio.h +++ b/src/gba/gba-audio.h @@ -1,9 +1,9 @@ #ifndef GBA_AUDIO_H #define GBA_AUDIO_H -#include "circle-buffer.h" +#include "common.h" -#include +#include "util/circle-buffer.h" struct GBADMA; diff --git a/src/gba/gba-bios.c b/src/gba/gba-bios.c index 086ee32d9..de6732716 100644 --- a/src/gba/gba-bios.c +++ b/src/gba/gba-bios.c @@ -4,9 +4,6 @@ #include "gba-io.h" #include "gba-memory.h" -#include -#include - const uint32_t GBA_BIOS_CHECKSUM = 0xBAAE187F; const uint32_t GBA_DS_BIOS_CHECKSUM = 0xBAAE1880; diff --git a/src/gba/gba-bios.h b/src/gba/gba-bios.h index acb3d3bab..5e2523370 100644 --- a/src/gba/gba-bios.h +++ b/src/gba/gba-bios.h @@ -1,9 +1,9 @@ #ifndef GBA_BIOS_H #define GBA_BIOS_H -#include "arm.h" +#include "common.h" -#include +#include "arm.h" void GBASwi16(struct ARMBoard* board, int immediate); void GBASwi32(struct ARMBoard* board, int immediate); diff --git a/src/gba/gba-gpio.h b/src/gba/gba-gpio.h index 75e8d8f6f..e5579c877 100644 --- a/src/gba/gba-gpio.h +++ b/src/gba/gba-gpio.h @@ -1,7 +1,7 @@ #ifndef GBA_GPIO_H #define GBA_GPIO_H -#include +#include "common.h" #define IS_GPIO_REGISTER(reg) ((reg) == GPIO_REG_DATA || (reg) == GPIO_REG_DIRECTION || (reg) == GPIO_REG_CONTROL) diff --git a/src/gba/gba-io.h b/src/gba/gba-io.h index 91c6b3d39..49ca528da 100644 --- a/src/gba/gba-io.h +++ b/src/gba/gba-io.h @@ -1,6 +1,8 @@ #ifndef GBA_IO_H #define GBA_IO_H +#include "common.h" + #include "gba.h" enum GBAIORegisters { diff --git a/src/gba/gba-memory.c b/src/gba/gba-memory.c index 67ce22d4c..0fc10025a 100644 --- a/src/gba/gba-memory.c +++ b/src/gba/gba-memory.c @@ -4,11 +4,7 @@ #include "gba-io.h" #include "gba-serialize.h" #include "hle-bios.h" -#include "memory.h" - -#include -#include -#include +#include "util/memory.h" static void GBASetActiveRegion(struct ARMMemory* memory, uint32_t region); static int GBAWaitMultiple(struct ARMMemory* memory, uint32_t startAddress, int count); diff --git a/src/gba/gba-memory.h b/src/gba/gba-memory.h index 7c5a2989e..a58ea16d3 100644 --- a/src/gba/gba-memory.h +++ b/src/gba/gba-memory.h @@ -1,13 +1,13 @@ #ifndef GBA_MEMORY_H #define GBA_MEMORY_H +#include "common.h" + #include "arm.h" #include "gba-gpio.h" #include "gba-savedata.h" -#include - enum GBAMemoryRegion { REGION_BIOS = 0x0, REGION_WORKING_RAM = 0x2, diff --git a/src/gba/gba-savedata.c b/src/gba/gba-savedata.c index 495c67bb2..39cef502c 100644 --- a/src/gba/gba-savedata.c +++ b/src/gba/gba-savedata.c @@ -1,12 +1,11 @@ #include "gba-savedata.h" #include "gba.h" -#include "memory.h" + +#include "util/memory.h" #include #include -#include -#include static void _flashSwitchBank(struct GBASavedata* savedata, int bank); static void _flashErase(struct GBASavedata* savedata); diff --git a/src/gba/gba-savedata.h b/src/gba/gba-savedata.h index e2bc93e4a..707680fd2 100644 --- a/src/gba/gba-savedata.h +++ b/src/gba/gba-savedata.h @@ -1,7 +1,7 @@ #ifndef GBA_SAVEDATA_H #define GBA_SAVEDATA_H -#include +#include "common.h" enum SavedataType { SAVEDATA_NONE = 0, diff --git a/src/gba/gba-sensors.h b/src/gba/gba-sensors.h index 926631f08..f4119e327 100644 --- a/src/gba/gba-sensors.h +++ b/src/gba/gba-sensors.h @@ -1,7 +1,7 @@ #ifndef GBA_SENSORS_H #define GBA_SENSORS_H -#include +#include "common.h" struct GBARotationSource { void (*sample)(struct GBARotationSource*); diff --git a/src/gba/gba-serialize.c b/src/gba/gba-serialize.c index 9fd7aa160..b2447adf0 100644 --- a/src/gba/gba-serialize.c +++ b/src/gba/gba-serialize.c @@ -3,13 +3,10 @@ #include "gba-audio.h" #include "gba-io.h" #include "gba-thread.h" -#include "memory.h" + +#include "util/memory.h" #include -#include -#include -#include -#include const uint32_t GBA_SAVESTATE_MAGIC = 0x01000000; diff --git a/src/gba/gba-serialize.h b/src/gba/gba-serialize.h index 0a9f54fcb..aa140de86 100644 --- a/src/gba/gba-serialize.h +++ b/src/gba/gba-serialize.h @@ -1,6 +1,8 @@ #ifndef GBA_SERIALIZE_H #define GBA_SERIALIZE_H +#include "common.h" + #include "gba.h" const uint32_t GBA_SAVESTATE_MAGIC; diff --git a/src/gba/gba-sio.c b/src/gba/gba-sio.c index 018a4a28f..e12947ea6 100644 --- a/src/gba/gba-sio.c +++ b/src/gba/gba-sio.c @@ -2,8 +2,6 @@ #include "gba-io.h" -#include - static struct GBASIODriver* _lookupDriver(struct GBASIO* sio, enum GBASIOMode mode) { switch (mode) { case SIO_NORMAL_8: diff --git a/src/gba/gba-sio.h b/src/gba/gba-sio.h index 7a8f57c49..dc4944080 100644 --- a/src/gba/gba-sio.h +++ b/src/gba/gba-sio.h @@ -1,7 +1,7 @@ #ifndef GBA_SIO_H #define GBA_SIO_H -#include +#include "common.h" enum GBASIOMode { SIO_NORMAL_8 = 0, diff --git a/src/gba/gba-thread.c b/src/gba/gba-thread.c index 56a5555bd..d5f7fb098 100644 --- a/src/gba/gba-thread.c +++ b/src/gba/gba-thread.c @@ -1,11 +1,11 @@ #include "gba-thread.h" #include "arm.h" -#include "debugger.h" #include "gba.h" #include "gba-serialize.h" -#include +#include "debugger/debugger.h" + #include #ifdef USE_PTHREADS diff --git a/src/gba/gba-thread.h b/src/gba/gba-thread.h index b19432f3c..d772aae55 100644 --- a/src/gba/gba-thread.h +++ b/src/gba/gba-thread.h @@ -1,8 +1,11 @@ #ifndef GBA_THREAD_H #define GBA_THREAD_H +#include "common.h" + #include "gba.h" -#include "threading.h" + +#include "util/threading.h" struct GBAThread; typedef void (*ThreadCallback)(struct GBAThread* threadContext); diff --git a/src/gba/gba-video.c b/src/gba/gba-video.c index 63bc9a304..5002a8def 100644 --- a/src/gba/gba-video.c +++ b/src/gba/gba-video.c @@ -4,10 +4,8 @@ #include "gba-io.h" #include "gba-serialize.h" #include "gba-thread.h" -#include "memory.h" -#include -#include +#include "util/memory.h" static void GBAVideoDummyRendererInit(struct GBAVideoRenderer* renderer); static void GBAVideoDummyRendererDeinit(struct GBAVideoRenderer* renderer); diff --git a/src/gba/gba-video.h b/src/gba/gba-video.h index 1bd752128..b8a31f0bd 100644 --- a/src/gba/gba-video.h +++ b/src/gba/gba-video.h @@ -1,9 +1,9 @@ #ifndef GBA_VIDEO_H #define GBA_VIDEO_H -#include "gba-memory.h" +#include "common.h" -#include +#include "gba-memory.h" enum { VIDEO_CYCLES_PER_PIXEL = 4, diff --git a/src/gba/gba.c b/src/gba/gba.c index 4550b53c9..2f92d26b8 100644 --- a/src/gba/gba.c +++ b/src/gba/gba.c @@ -4,14 +4,11 @@ #include "gba-io.h" #include "gba-sio.h" #include "gba-thread.h" -#include "memory.h" -#include "debugger.h" +#include "util/memory.h" + +#include "debugger/debugger.h" -#include -#include -#include -#include #include const uint32_t GBA_ARM7TDMI_FREQUENCY = 0x1000000; diff --git a/src/gba/gba.h b/src/gba/gba.h index 0b33f5cae..3e0e085f2 100644 --- a/src/gba/gba.h +++ b/src/gba/gba.h @@ -1,16 +1,16 @@ #ifndef GBA_H #define GBA_H +#include "common.h" + #include "arm.h" -#include "debugger.h" +#include "debugger/debugger.h" #include "gba-memory.h" #include "gba-video.h" #include "gba-audio.h" #include "gba-sio.h" -#include - extern const uint32_t GBA_ARM7TDMI_FREQUENCY; enum GBAIRQ { diff --git a/src/gba/hle-bios.h b/src/gba/hle-bios.h index a2f519f92..e0772c186 100644 --- a/src/gba/hle-bios.h +++ b/src/gba/hle-bios.h @@ -1,8 +1,7 @@ #ifndef HLE_BIOS_H #define HLE_BIOS_H -#include -#include +#include "common.h" extern const size_t hleBiosLength; extern const uint8_t hleBios[]; diff --git a/src/gba/renderers/video-glsl.h b/src/gba/renderers/video-glsl.h index da304170f..d29123c0d 100644 --- a/src/gba/renderers/video-glsl.h +++ b/src/gba/renderers/video-glsl.h @@ -1,6 +1,8 @@ #ifndef VIDEO_GLSL_H #define VIDEO_GLSL_H +#include "common.h" + #include "gba-video.h" #include diff --git a/src/gba/renderers/video-software.c b/src/gba/renderers/video-software.c index 7a15ec7c2..de7719e00 100644 --- a/src/gba/renderers/video-software.c +++ b/src/gba/renderers/video-software.c @@ -3,8 +3,6 @@ #include "gba.h" #include "gba-io.h" -#include - #define UNUSED(X) (void) (X) static const int _objSizes[32] = { diff --git a/src/gba/renderers/video-software.h b/src/gba/renderers/video-software.h index 5becd6db0..569014eac 100644 --- a/src/gba/renderers/video-software.h +++ b/src/gba/renderers/video-software.h @@ -1,9 +1,9 @@ #ifndef VIDEO_SOFTWARE_H #define VIDEO_SOFTWARE_H -#include "gba-video.h" +#include "common.h" -#include +#include "gba-video.h" #ifdef COLOR_16_BIT typedef uint16_t color_t; diff --git a/src/platform/glsl-main.c b/src/platform/glsl-main.c index eb015a9e4..951c4e3af 100644 --- a/src/platform/glsl-main.c +++ b/src/platform/glsl-main.c @@ -15,7 +15,6 @@ #include #include #include -#include static int _GBASDLInit(void); static void _GBASDLDeinit(void); diff --git a/src/platform/perf-main.c b/src/platform/perf-main.c index 7adc2df25..144128a3d 100644 --- a/src/platform/perf-main.c +++ b/src/platform/perf-main.c @@ -5,9 +5,6 @@ #include #include #include -#include -#include -#include static void _GBAPerfRunloop(struct GBAThread* context, int* frames); static void _GBAPerfShutdown(int signal); diff --git a/src/platform/posix/memory.c b/src/platform/posix/memory.c index 0ead2c71e..d4d69d993 100644 --- a/src/platform/posix/memory.c +++ b/src/platform/posix/memory.c @@ -1,4 +1,4 @@ -#include "memory.h" +#include "util/memory.h" #include diff --git a/src/platform/sdl/egl-main.c b/src/platform/sdl/egl-main.c index 52d403765..cd511049b 100644 --- a/src/platform/sdl/egl-main.c +++ b/src/platform/sdl/egl-main.c @@ -1,4 +1,4 @@ -#include "debugger.h" +#include "debugger/debugger.h" #include "gba-thread.h" #include "gba.h" #include "renderers/video-software.h" @@ -16,7 +16,6 @@ #include #include #include -#include struct GBAVideoEGLRenderer { struct GBAVideoSoftwareRenderer d; diff --git a/src/platform/sdl/gl-main.c b/src/platform/sdl/gl-main.c index bce26894f..408f86a0a 100644 --- a/src/platform/sdl/gl-main.c +++ b/src/platform/sdl/gl-main.c @@ -1,4 +1,4 @@ -#include "cli-debugger.h" +#include "debugger/cli-debugger.h" #include "gba-thread.h" #include "gba.h" #include "sdl-audio.h" diff --git a/src/platform/sdl/sdl-audio.h b/src/platform/sdl/sdl-audio.h index 39cefab08..e832c869a 100644 --- a/src/platform/sdl/sdl-audio.h +++ b/src/platform/sdl/sdl-audio.h @@ -1,6 +1,8 @@ #ifndef SDL_AUDIO_H #define SDL_AUDIO_H +#include "common.h" + #include struct GBASDLAudio { diff --git a/src/platform/sdl/sdl-events.c b/src/platform/sdl/sdl-events.c index af20fc3ec..889194671 100644 --- a/src/platform/sdl/sdl-events.c +++ b/src/platform/sdl/sdl-events.c @@ -1,6 +1,6 @@ #include "sdl-events.h" -#include "debugger.h" +#include "debugger/debugger.h" #include "gba-io.h" #include "gba-serialize.h" #include "gba-video.h" diff --git a/src/platform/sdl/sdl-events.h b/src/platform/sdl/sdl-events.h index 6d8b4a0ac..45c2c80fd 100644 --- a/src/platform/sdl/sdl-events.h +++ b/src/platform/sdl/sdl-events.h @@ -1,6 +1,8 @@ #ifndef SDL_EVENTS_H #define SDL_EVENTS_H +#include "common.h" + #include "gba-thread.h" #include diff --git a/src/platform/sdl/sw-main.c b/src/platform/sdl/sw-main.c index 730766c92..1ef63157f 100644 --- a/src/platform/sdl/sw-main.c +++ b/src/platform/sdl/sw-main.c @@ -1,4 +1,4 @@ -#include "debugger.h" +#include "debugger/debugger.h" #include "gba-thread.h" #include "gba.h" #include "renderers/video-software.h" @@ -11,7 +11,6 @@ #include #include #include -#include struct SoftwareRenderer { struct GBAVideoSoftwareRenderer d; diff --git a/src/platform/windows/memory.c b/src/platform/windows/memory.c index dbc495470..cd9748a45 100644 --- a/src/platform/windows/memory.c +++ b/src/platform/windows/memory.c @@ -1,4 +1,4 @@ -#include "memory.h" +#include "util/memory.h" #include #include diff --git a/src/util/circle-buffer.c b/src/util/circle-buffer.c index 7529aa362..d7b14a91b 100644 --- a/src/util/circle-buffer.c +++ b/src/util/circle-buffer.c @@ -1,8 +1,5 @@ #include "circle-buffer.h" -#include -#include - #ifndef NDEBUG static int _checkIntegrity(struct CircleBuffer* buffer) { if ((int8_t*) buffer->writePtr - (int8_t*) buffer->readPtr == buffer->size) { diff --git a/src/util/circle-buffer.h b/src/util/circle-buffer.h index c95325772..3a3939b5f 100644 --- a/src/util/circle-buffer.h +++ b/src/util/circle-buffer.h @@ -1,8 +1,7 @@ #ifndef CIRCLE_BUFFER_H #define CIRCLE_BUFFER_H -#include -#include +#include "common.h" struct CircleBuffer { void* data; diff --git a/src/util/memory.h b/src/util/memory.h index 93394259e..c9c04fbfb 100644 --- a/src/util/memory.h +++ b/src/util/memory.h @@ -1,7 +1,7 @@ #ifndef MEMORY_H #define MEMORY_H -#include +#include "common.h" #define MEMORY_READ 1 #define MEMORY_WRITE 2 @@ -10,4 +10,4 @@ void* anonymousMemoryMap(size_t size); void* fileMemoryMap(int fd, size_t size, int flags); void mappedMemoryFree(void* memory, size_t size); -#endif \ No newline at end of file +#endif diff --git a/src/util/socket.h b/src/util/socket.h index cc8d6a31f..903325e2b 100644 --- a/src/util/socket.h +++ b/src/util/socket.h @@ -1,6 +1,8 @@ #ifndef SOCKET_H #define SOCKET_H +#include "common.h" + #ifdef _WIN32 #include @@ -9,9 +11,7 @@ typedef SOCKET Socket; #include #include #include -#include #include -#include typedef int Socket; #endif diff --git a/src/util/threading.h b/src/util/threading.h index 8488ede5a..6e35e0348 100644 --- a/src/util/threading.h +++ b/src/util/threading.h @@ -1,6 +1,7 @@ #ifndef THREADING_H #define THREADING_H +#include "common.h" #ifdef USE_PTHREADS #include