diff --git a/src/app/app.h b/src/app/app.h index fa5371ce..e951dec7 100644 --- a/src/app/app.h +++ b/src/app/app.h @@ -5,8 +5,6 @@ #include "../platform/platform.h" #include "../ttf/ttf.h" #include "../gpu/gpu.h" -#include "../sim/sim.h" -#include "../user/user.h" #include "../sprite/sprite.h" #include "../watch/watch.h" #include "../draw/draw.h" @@ -18,6 +16,7 @@ #include "../net/net.h" #include "../resource/resource.h" #include "../playback/playback.h" +#include "../pp/pp.h" #include "app_core.h" diff --git a/src/app/app_core.c b/src/app/app_core.c index a8a2bdc3..7e6fc259 100644 --- a/src/app/app_core.c +++ b/src/app/app_core.c @@ -150,11 +150,11 @@ void P_AppStartup(String args_str) } } - (UNUSED)args; - (UNUSED)logfile_name; - (UNUSED)settings_file_name; - (UNUSED)connect_address; - (UNUSED)GetDefaultAppWindowSettings; + (MaybeUnused)args; + (MaybeUnused)logfile_name; + (MaybeUnused)settings_file_name; + (MaybeUnused)connect_address; + (MaybeUnused)GetDefaultAppWindowSettings; #if !RtcIsEnabled /* Verify test modes aren't left on by accident in release mode */ @@ -240,17 +240,17 @@ void P_AppStartup(String args_str) TTF_StartupReceipt ttf_sr = TTF_Startup(); F_StartupReceipt font_sr = F_Startup(&asset_cache_sr, &ttf_sr); S_StartupReceipt sprite_sr = S_Startup(); - MIX_StartupReceipt mixer_sr = MIX_Startup(); + MIX_StartupReceipt mixer_sr = MIX_Startup(); SND_StartupReceipt sound_sr = SND_Startup(&asset_cache_sr); D_StartupReceipt draw_sr = D_Startup(&font_sr); - SimStartupReceipt sim_sr = sim_startup(); - + /* Interface systems */ + SimStartupReceipt sim_sr = SimStartup(); PB_StartupReceipt playback_sr = PB_Startup(&mixer_sr); - UserStartupReceipt user_sr = StartupUser(&font_sr, &sprite_sr, &draw_sr, &asset_cache_sr, &sound_sr, &mixer_sr, &sim_sr, connect_address); + UserStartupReceipt user_sr = StartupUser(&font_sr, &sprite_sr, &draw_sr, &asset_cache_sr, &sound_sr, &mixer_sr, &sim_sr, connect_address); - (UNUSED)user_sr; - (UNUSED)playback_sr; + (MaybeUnused)user_sr; + (MaybeUnused)playback_sr; #if 0 /* Write window settings to file */ diff --git a/src/ase/ase_core.c b/src/ase/ase_core.c index 24f4bbea..2584257d 100644 --- a/src/ase/ase_core.c +++ b/src/ase/ase_core.c @@ -238,8 +238,8 @@ void ASE_Inflate(u8 *dst, u8 *encoded) u8 cmf = (u8)(cm | (cinfo << 4)); u8 flg = fcheck | (fdict << 5) | (flevl << 6); - (UNUSED)cmf; - (UNUSED)flg; + (MaybeUnused)cmf; + (MaybeUnused)flg; Assert(((cmf * 256) + flg) % 31 == 0); u8 bfinal = 0; @@ -255,7 +255,7 @@ void ASE_Inflate(u8 *dst, u8 *encoded) i16 len = ASE_ConsumeBits(&bb, 16); i16 nlen = ASE_ConsumeBits(&bb, 16); Assert(len == ~nlen); /* Validation */ - (UNUSED)nlen; + (MaybeUnused)nlen; while (len-- > 0) { *dst++ = ASE_ConsumeBits(&bb, 8); diff --git a/src/asset_cache/asset_cache_core.c b/src/asset_cache/asset_cache_core.c index d120d9a0..66118744 100644 --- a/src/asset_cache/asset_cache_core.c +++ b/src/asset_cache/asset_cache_core.c @@ -50,7 +50,7 @@ AC_Asset *AC_GetAssetCacheSlotLocked(P_Lock *lock, String key, u64 hash) { AC_SharedState *g = &AC_shared_state; P_AssertLockedES(lock, &g->lookup_mutex); - (UNUSED)lock; + (MaybeUnused)lock; u64 index = hash % countof(g->lookup); for (;;) diff --git a/src/base/base_arena.c b/src/base/base_arena.c index de380047..451d934f 100644 --- a/src/base/base_arena.c +++ b/src/base/base_arena.c @@ -134,7 +134,7 @@ void ShrinkArena(Arena *arena) { /* Not implemented */ Assert(0); - (UNUSED)arena; + (MaybeUnused)arena; } void SetArenaReadonly(Arena *arena) diff --git a/src/base/base_arena.h b/src/base/base_arena.h index b0a450f6..431877e7 100644 --- a/src/base/base_arena.h +++ b/src/base/base_arena.h @@ -205,7 +205,7 @@ Inline TempArena _BeginScratch(Arena *potential_conflict) _BeginScratchNoConflict(); \ do { \ u8 arena = 0; \ - (UNUSED)arena; \ + (MaybeUnused)arena; \ } while (0) Inline TempArena _BeginScratchNoConflict(void) diff --git a/src/base/base_buddy.c b/src/base/base_buddy.c index dc950a5d..ca9fc2bb 100644 --- a/src/base/base_buddy.c +++ b/src/base/base_buddy.c @@ -161,7 +161,7 @@ BuddyBlock *GetUnusedBuddyBlock(BuddyCtx *ctx, BuddyLevel *level) left->parent = parent_block; left->memory = parent_block->memory; - /* Create right (UNUSED) block from parent block */ + /* Create right (MaybeUnused) block from parent block */ BuddyBlock *right = PushBuddyBlock(ctx); right->is_used = 0; right->level = level; @@ -196,7 +196,7 @@ BuddyBlock *GetUnusedBuddyBlock(BuddyCtx *ctx, BuddyLevel *level) left->level = level; left->memory = ArenaBase(arena); - /* Create right (UNUSED) block from new arena memory */ + /* Create right (MaybeUnused) block from new arena memory */ BuddyBlock *right = PushBuddyBlock(ctx); right->is_used = 0; right->level = level; diff --git a/src/base/base_core.h b/src/base/base_core.h index bfa7c8f3..cd305ac6 100644 --- a/src/base/base_core.h +++ b/src/base/base_core.h @@ -133,7 +133,7 @@ extern "C" { # define Assert(cond) ((cond) ? 1 : (__builtin_trap(), 0)) # define DEBUGBREAK __builtin_debugtrap() # endif -# define DEBUGBREAKABLE { volatile i32 __DEBUGBREAKABLE_VAR = 0; (UNUSED) __DEBUGBREAKABLE_VAR; } (void)0 +# define DEBUGBREAKABLE { volatile i32 __DEBUGBREAKABLE_VAR = 0; (MaybeUnused) __DEBUGBREAKABLE_VAR; } (void)0 #else # define Assert(cond) (void)(0) #endif @@ -238,7 +238,13 @@ void __asan_unpoison_memory_region(void const volatile *add, size_t); #endif //- Markup -#define UNUSED void +#define MaybeUnused void + +#if CompilerIsClang +# define UNUSED __attribute((unused)) +#else +# define UNUSED +#endif #if CompilerIsMsvc # if LanguageIsCpp diff --git a/src/base/base_string.c b/src/base/base_string.c index d20a73bf..5f97cd10 100644 --- a/src/base/base_string.c +++ b/src/base/base_string.c @@ -649,7 +649,7 @@ b32 AdvanceCodepointIter(CodepointIter *iter) void EndCodepointIter(CodepointIter *iter) { /* Do nothing */ - (UNUSED)iter; + (MaybeUnused)iter; } //- String decode diff --git a/src/draw/draw_core.c b/src/draw/draw_core.c index d5dfc5ba..4a09bc1b 100644 --- a/src/draw/draw_core.c +++ b/src/draw/draw_core.c @@ -7,7 +7,7 @@ D_StartupReceipt D_Startup(F_StartupReceipt *font_sr) { __prof; D_SharedState *g = &D_shared_state; - (UNUSED)font_sr; + (MaybeUnused)font_sr; u32 pixel_white = 0xFFFFFFFF; g->solid_white_texture = GPU_AllocTexture(GP_TEXTURE_FORMAT_R8G8B8A8_UNORM, 0, VEC2I32(1, 1), &pixel_white); return (D_StartupReceipt) { 0 }; @@ -116,7 +116,7 @@ void D_DrawLineGradient(GPU_RenderSig *sig, Vec2 start, Vec2 end, f32 thickness, D_DrawMaterial(sig, D_MATERIALPARAMS(.texture = g->solid_white_texture, .tint0 = start_color, .tint1 = end_color, .quad = quad)); #else /* Placeholder */ - (UNUSED)end_color; + (MaybeUnused)end_color; Quad quad = QuadFromLine(start, end, thickness); D_DrawQuad(sig, quad, start_color); #endif diff --git a/src/dxc/dxc_core_win32.cpp b/src/dxc/dxc_core_win32.cpp index a7336146..1c6d61d5 100644 --- a/src/dxc/dxc_core_win32.cpp +++ b/src/dxc/dxc_core_win32.cpp @@ -2,10 +2,10 @@ DXC_Result DXC_Compile(Arena *arena, String shader_source, i32 num_args, String *args) { - (UNUSED)arena; - (UNUSED)shader_source; - (UNUSED)num_args; - (UNUSED)args; + (MaybeUnused)arena; + (MaybeUnused)shader_source; + (MaybeUnused)num_args; + (MaybeUnused)args; DXC_Result result = ZI; return result; } diff --git a/src/font/font_core.c b/src/font/font_core.c index 62f281e0..da798302 100644 --- a/src/font/font_core.c +++ b/src/font/font_core.c @@ -7,8 +7,8 @@ F_StartupReceipt F_Startup(AC_StartupReceipt *asset_cache_sr, TTF_StartupReceipt { __prof; F_SharedState *g = &F_shared_state; - (UNUSED)asset_cache_sr; - (UNUSED)ttf_sr; + (MaybeUnused)asset_cache_sr; + (MaybeUnused)ttf_sr; g->params.arena = AllocArena(Gibi(64)); return (F_StartupReceipt) { 0 }; } diff --git a/src/gpu/gpu_dx12.c b/src/gpu/gpu_dx12.c index fde8f86a..17e837d5 100644 --- a/src/gpu/gpu_dx12.c +++ b/src/gpu/gpu_dx12.c @@ -88,7 +88,7 @@ P_ExitFuncDef(GPU_D12_Shutdown) } ID3D12Device_Release(g->device); #else - (UNUSED)GPU_D12_ReleaseCommandQueue; + (MaybeUnused)GPU_D12_ReleaseCommandQueue; #endif { @@ -339,7 +339,7 @@ void GPU_D12_InitObjects(void) GPU_D12_CommandQueue *cq = g->command_queues[i]; String dbg_name = params[i].dbg_name; __prof_dx12_ctx_alloc(cq->prof, g->device, cq->cq, dbg_name.text, dbg_name.len); - (UNUSED)dbg_name; + (MaybeUnused)dbg_name; } } #endif @@ -1321,7 +1321,7 @@ GPU_D12_CpuDescriptorHeap *GPU_D12_AllocCpuDescriptorHeap(enum D3D12_DESCRIPTOR_ void cpu_descriptor_heap_release(GPU_D12_CpuDescriptorHeap *dh) { /* TODO */ - (UNUSED)dh; + (MaybeUnused)dh; } #endif @@ -1556,7 +1556,7 @@ void GPU_D12_ReleaseCommandQueue(GPU_D12_CommandQueue *cq) { __prof; /* TODO */ - (UNUSED)cq; + (MaybeUnused)cq; //ID3D12CommandQueue_Release(cq->cq); } @@ -3090,7 +3090,7 @@ GPU_Swapchain *GPU_AllocSwapchain(P_Window *window, Vec2I32 resolution) void GPU_ReleaseSwapchain(GPU_Swapchain *gp_swapchain) { /* TODO */ - (UNUSED)gp_swapchain; + (MaybeUnused)gp_swapchain; } void GPU_WaitOnSwapchain(GPU_Swapchain *gp_swapchain) @@ -3102,7 +3102,7 @@ void GPU_WaitOnSwapchain(GPU_Swapchain *gp_swapchain) WaitForSingleObjectEx(swapchain->waitable, 1000, 1); } #else - (UNUSED)gp_swapchain; + (MaybeUnused)gp_swapchain; #endif } diff --git a/src/mixer/mixer_core.c b/src/mixer/mixer_core.c index 96827c6f..fa8606bc 100644 --- a/src/mixer/mixer_core.c +++ b/src/mixer/mixer_core.c @@ -57,7 +57,7 @@ MIX_Track *MIX_AllocTrackLocked(P_Lock *lock, SND_Sound *sound) { MIX_SharedState *g = &M_shared_state; P_AssertLockedE(lock, &g->mutex); - (UNUSED)lock; + (MaybeUnused)lock; MIX_Track *track = 0; if (g->track_first_free) @@ -104,7 +104,7 @@ void MIX_ReleaseTrackLocked(P_Lock *lock, MIX_Track *track) { MIX_SharedState *g = &M_shared_state; P_AssertLockedE(lock, &g->mutex); - (UNUSED)lock; + (MaybeUnused)lock; /* Remove from playing list */ MIX_Track *prev = track->prev; diff --git a/src/platform/platform_snc.h b/src/platform/platform_snc.h index b8419ce2..1a5b50b6 100644 --- a/src/platform/platform_snc.h +++ b/src/platform/platform_snc.h @@ -65,8 +65,8 @@ void P_Unlock(P_Lock *lock); # define P_AssertLockedE(l, m) Assert((l)->mutex == (m) && (l)->exclusive == 1) # define P_AssertLockedES(l, m) Assert((l)->mutex == (m)) #else -# define P_AssertLockedE(l, m) (UNUSED)l -# define P_AssertLockedES(l, m) (UNUSED)l +# define P_AssertLockedE(l, m) (MaybeUnused)l +# define P_AssertLockedES(l, m) (MaybeUnused)l #endif //////////////////////////////// diff --git a/src/platform/platform_win32.c b/src/platform/platform_win32.c index fe2a3e4c..5ac37268 100644 --- a/src/platform/platform_win32.c +++ b/src/platform/platform_win32.c @@ -187,7 +187,7 @@ void P_W32_WaitReleaseThread(P_W32_Thread *thread) __prof; b32 success = P_W32_TryReleaseThread(thread, F32Infinity); Assert(success); - (UNUSED)success; + (MaybeUnused)success; } //////////////////////////////// @@ -671,7 +671,7 @@ ForceNoInline void P_W32_FiberResume(P_W32_Fiber *fiber) void P_W32_YieldFiber(P_W32_Fiber *fiber, P_W32_Fiber *parent_fiber) { - (UNUSED)fiber; + (MaybeUnused)fiber; Assert(fiber->id == FiberId()); Assert(parent_fiber->id == fiber->parent_id); Assert(parent_fiber->id > 0); @@ -727,7 +727,7 @@ P_W32_ThreadDef(P_W32_JobWorkerEntryFunc, worker_ctx_arg) P_W32_WorkerCtx *ctx = worker_ctx_arg; P_Pool pool_kind = ctx->pool_kind; P_W32_JobPool *pool = &g->job_pools[pool_kind]; - (UNUSED)ctx; + (MaybeUnused)ctx; { /* TODO: Heuristic pinning */ @@ -739,7 +739,7 @@ P_W32_ThreadDef(P_W32_JobWorkerEntryFunc, worker_ctx_arg) __profn("Set priority"); b32 success = SetThreadPriority(thread_handle, pool->thread_priority) != 0; Assert(success); - (UNUSED)success; + (MaybeUnused)success; } #if 0 @@ -761,7 +761,7 @@ P_W32_ThreadDef(P_W32_JobWorkerEntryFunc, worker_ctx_arg) } #endif Assert(success); - (UNUSED)success; + (MaybeUnused)success; } #endif @@ -772,7 +772,7 @@ P_W32_ThreadDef(P_W32_JobWorkerEntryFunc, worker_ctx_arg) DWORD task = 0; HANDLE mmc_handle = AvSetMmThreadCharacteristics(L"Pro Audio", &task); Assert(mmc_handle); - (UNUSED)mmc_handle; + (MaybeUnused)mmc_handle; } } @@ -1107,7 +1107,7 @@ P_W32_ThreadDef(P_W32_JobSchedulerEntryFunc, _) { i32 priority = THREAD_PRIORITY_TIME_CRITICAL; b32 success = SetThreadPriority(GetCurrentThread(), priority); - (UNUSED)success; + (MaybeUnused)success; Assert(success); } @@ -2281,7 +2281,7 @@ String P_ReadFile(Arena *arena, P_File file) /* TODO: error checking */ AlignArena(arena, 16); s.text = PushStructsNoZero(arena, u8, size); - (UNUSED)ReadFile( + (MaybeUnused)ReadFile( (HANDLE)file.handle, s.text, (DWORD)s.len, @@ -2308,7 +2308,7 @@ void P_WriteFile(P_File file, String data) } /* WriteFile returns TRUE on success */ - (UNUSED)WriteFile( + (MaybeUnused)WriteFile( (HANDLE)file.handle, data.text, (DWORD)data.len, @@ -2513,7 +2513,7 @@ P_WatchInfoList P_ReadWatchWait(Arena *arena, P_Watch *dw) 0, &ov, 0); - (UNUSED)success; + (MaybeUnused)success; Assert(success); HANDLE handles[] = { @@ -3070,7 +3070,7 @@ void P_WriteSock(P_Sock *sock, P_Address address, String data) if (size != (i32)data.len) { i32 err = WSAGetLastError(); - (UNUSED)err; + (MaybeUnused)err; Assert(0); } #endif @@ -3373,10 +3373,10 @@ P_JobDef(P_W32_AppShutdownJob, _) int CALLBACK wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev_instance, _In_ LPWSTR cmdline_wstr, _In_ int show_code) { - (UNUSED)instance; - (UNUSED)prev_instance; - (UNUSED)cmdline_wstr; - (UNUSED)show_code; + (MaybeUnused)instance; + (MaybeUnused)prev_instance; + (MaybeUnused)cmdline_wstr; + (MaybeUnused)show_code; __profthread("Main thread", PROF_THREAD_GROUP_MAIN); P_W32_SharedCtx *g = &P_W32_shared_ctx; @@ -3441,7 +3441,7 @@ int CALLBACK wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev_instance, } } Assert(success); - (UNUSED)success; + (MaybeUnused)success; } } CloseHandle(thread); @@ -3543,7 +3543,7 @@ int CALLBACK wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev_instance, b32 success = RegisterRawInputDevices(&rid, 1, sizeof(rid)); Assert(success); - (UNUSED)success; + (MaybeUnused)success; } /* Init threads pool */ diff --git a/src/playback/playback_win32.c b/src/playback/playback_win32.c index a13eda2d..1676a77a 100644 --- a/src/playback/playback_win32.c +++ b/src/playback/playback_win32.c @@ -13,7 +13,7 @@ PB_StartupReceipt PB_Startup(MIX_StartupReceipt *mixer_sr) { __prof; PB_WSP_SharedState *g = &PB_WSP_shared_state; - (UNUSED)mixer_sr; + (MaybeUnused)mixer_sr; PB_WSP_InitializeWasapi(); /* Start playback job */ P_Run(1, PB_WSP_PlaybackJob, 0, P_Pool_Audio, P_Priority_High, &g->PB_WSP_PlaybackJob_counter); diff --git a/src/pp/pp.c b/src/pp/pp.c new file mode 100644 index 00000000..2bbe132e --- /dev/null +++ b/src/pp/pp.c @@ -0,0 +1,8 @@ +#include "pp.h" + +#include "pp_ent.c" +#include "pp_phys.c" +#include "pp_step.c" +#include "pp_space.c" +#include "pp_sim.c" +#include "pp_core.c" diff --git a/src/pp/pp.h b/src/pp/pp.h new file mode 100644 index 00000000..2cda782b --- /dev/null +++ b/src/pp/pp.h @@ -0,0 +1,21 @@ +#ifndef PP_H +#define PP_H + +#include "../base/base.h" +#include "../gpu/gpu.h" +#include "../sprite/sprite.h" +#include "../font/font.h" +#include "../collider/collider.h" +#include "../draw/draw.h" +#include "../net/net.h" +#include "../mixer/mixer.h" +#include "../bitbuff/bitbuff.h" + +#include "pp_sim.h" +#include "pp_phys.h" +#include "pp_space.h" +#include "pp_ent.h" +#include "pp_step.h" +#include "pp_core.h" + +#endif diff --git a/src/user/user_core.c b/src/pp/pp_core.c similarity index 99% rename from src/user/user_core.c rename to src/pp/pp_core.c index a0708f9f..5c699c76 100644 --- a/src/user/user_core.c +++ b/src/pp/pp_core.c @@ -13,13 +13,13 @@ UserStartupReceipt StartupUser(F_StartupReceipt *font_sr, String connect_address_str) { __prof; - (UNUSED)font_sr; - (UNUSED)sprite_sr; - (UNUSED)draw_sr; - (UNUSED)asset_cache_sr; - (UNUSED)sound_sr; - (UNUSED)mixer_sr; - (UNUSED)sim_sr; + (MaybeUnused)font_sr; + (MaybeUnused)sprite_sr; + (MaybeUnused)draw_sr; + (MaybeUnused)asset_cache_sr; + (MaybeUnused)sound_sr; + (MaybeUnused)mixer_sr; + (MaybeUnused)sim_sr; SharedUserState *g = &shared_user_state; SetGstat(GSTAT_DEBUG_STEPS, U64Max); @@ -1358,8 +1358,8 @@ void UpdateUser(P_Window *window) ContactConstraint *data = &ent->contact_constraint_data; Entity *e0 = sim_ent_from_id(g->ss_blended, data->e0); Entity *e1 = sim_ent_from_id(g->ss_blended, data->e1); - (UNUSED)e0; - (UNUSED)e1; + (MaybeUnused)e0; + (MaybeUnused)e1; #if DeveloperIsEnabled /* Draw contact points */ @@ -1433,8 +1433,8 @@ void UpdateUser(P_Window *window) Entity *e1 = sim_ent_from_id(g->ss_blended, data->e1); CLD_Shape e0_collider = e0->local_collider; CLD_Shape e1_collider = e1->local_collider; - (UNUSED)e0_collider; - (UNUSED)e1_collider; + (MaybeUnused)e0_collider; + (MaybeUnused)e1_collider; /* Draw closest points */ #if 0 @@ -1538,7 +1538,7 @@ void UpdateUser(P_Window *window) u32 color = collision_reuslt.solved ? Rgba32F(0, 0, 0.25, 1) : Rgba32F(0, 0.25, 0.25, 1); f32 thickness = 2; u32 detail = 512; - (UNUSED)thickness; + (MaybeUnused)thickness; Vec2Array m = CLD_Menkowski(temp.arena, &e0_collider, &e1_collider, e0_xf, e1_xf, detail); @@ -2134,7 +2134,7 @@ void GenerateuserInputCmds(Client *user_input_client, u64 tick) //////////////////////////////// //~ Sim update -P_JobDef(SimJob, _) +P_JobDef(SimJob, UNUSED job) { SharedUserState *g = &shared_user_state; #if 0 diff --git a/src/user/user_core.h b/src/pp/pp_core.h similarity index 100% rename from src/user/user_core.h rename to src/pp/pp_core.h diff --git a/src/sim/sim_ent.c b/src/pp/pp_ent.c similarity index 100% rename from src/sim/sim_ent.c rename to src/pp/pp_ent.c diff --git a/src/sim/sim_ent.h b/src/pp/pp_ent.h similarity index 100% rename from src/sim/sim_ent.h rename to src/pp/pp_ent.h diff --git a/src/sim/sim_phys.c b/src/pp/pp_phys.c similarity index 99% rename from src/sim/sim_phys.c rename to src/pp/pp_phys.c index 49b94d70..77fc107f 100644 --- a/src/sim/sim_phys.c +++ b/src/pp/pp_phys.c @@ -1013,7 +1013,7 @@ void phys_warm_start_weld_joints(PhysStepCtx *ctx) sim_ent_set_angular_velocity(e1, e1->angular_velocity + joint->angular_impulse1 * inv_i); } #else - (UNUSED)joint; + (MaybeUnused)joint; #endif } } @@ -1260,7 +1260,7 @@ void phys_step(PhysStepCtx *ctx, f32 timestep) f32 earliest_toi = MaxF32(phys_determine_earliest_toi(ctx, step_dt, tolerance, max_iterations), min_toi); step_dt = remaining_dt * earliest_toi; #else - (UNUSED)phys_determine_earliest_toi; + (MaybeUnused)phys_determine_earliest_toi; #endif } remaining_dt -= step_dt; diff --git a/src/sim/sim_phys.h b/src/pp/pp_phys.h similarity index 100% rename from src/sim/sim_phys.h rename to src/pp/pp_phys.h diff --git a/src/sim/sim_core.c b/src/pp/pp_sim.c similarity index 99% rename from src/sim/sim_core.c rename to src/pp/pp_sim.c index 99937e52..61f3b7e4 100644 --- a/src/sim/sim_core.c +++ b/src/pp/pp_sim.c @@ -52,7 +52,7 @@ Readonly Snapshot **_g_sim_snapshot_nil = &G.nil_snapshot; /* Accessed via `sim_ent_nil()` */ Readonly Entity **_g_sim_ent_nil = &G.nil_ent; -SimStartupReceipt sim_startup(void) +SimStartupReceipt SimStartup(void) { __prof; G.nil_arena = AllocArena(Gibi(1)); diff --git a/src/sim/sim_core.h b/src/pp/pp_sim.h similarity index 99% rename from src/sim/sim_core.h rename to src/pp/pp_sim.h index 522aa938..47e7eb33 100644 --- a/src/sim/sim_core.h +++ b/src/pp/pp_sim.h @@ -25,7 +25,7 @@ Struct(ClientHandle) { * ========================== */ Struct(SimStartupReceipt) { i32 _; }; -SimStartupReceipt sim_startup(void); +SimStartupReceipt SimStartup(void); /* ========================== * * Client store diff --git a/src/sim/sim_space.c b/src/pp/pp_space.c similarity index 100% rename from src/sim/sim_space.c rename to src/pp/pp_space.c diff --git a/src/sim/sim_space.h b/src/pp/pp_space.h similarity index 100% rename from src/sim/sim_space.h rename to src/pp/pp_space.h diff --git a/src/sim/sim_step.c b/src/pp/pp_step.c similarity index 99% rename from src/sim/sim_step.c rename to src/pp/pp_step.c index 4385823d..51ba1cab 100644 --- a/src/sim/sim_step.c +++ b/src/pp/pp_step.c @@ -170,9 +170,9 @@ internal Entity *test_spawn_employee(Entity *parent) /* Player weapon */ if (employee->valid) { - (UNUSED)test_spawn_smg; - (UNUSED)test_spawn_launcher; - (UNUSED)test_spawn_chucker; + (MaybeUnused)test_spawn_smg; + (MaybeUnused)test_spawn_launcher; + (MaybeUnused)test_spawn_chucker; Entity *e = test_spawn_chucker(employee); employee->equipped = e->id; @@ -229,7 +229,7 @@ internal void test_teleport(Entity *ent, Vec2 pos) internal void test_spawn_entities1(Entity *parent, Vec2 pos) { - (UNUSED)pos; + (MaybeUnused)pos; /* Enemy */ { @@ -242,7 +242,7 @@ internal void test_spawn_entities1(Entity *parent, Vec2 pos) internal void test_spawn_entities2(Entity *parent, Vec2 pos) { - (UNUSED)pos; + (MaybeUnused)pos; /* Small Box */ #if 1 @@ -313,7 +313,7 @@ internal void test_spawn_entities2(Entity *parent, Vec2 pos) internal void test_spawn_entities3(Entity *parent, Vec2 pos) { - (UNUSED)pos; + (MaybeUnused)pos; /* Heavy box */ { @@ -338,7 +338,7 @@ internal void test_spawn_entities3(Entity *parent, Vec2 pos) internal void test_spawn_entities4(Entity *parent, Vec2 pos) { - (UNUSED)pos; + (MaybeUnused)pos; /* Light box */ Entity *e = sim_ent_alloc_sync_src(parent); diff --git a/src/sim/sim_step.h b/src/pp/pp_step.h similarity index 100% rename from src/sim/sim_step.h rename to src/pp/pp_step.h diff --git a/src/resource/resource_core.h b/src/resource/resource_core.h index 644c080b..49d26f94 100644 --- a/src/resource/resource_core.h +++ b/src/resource/resource_core.h @@ -42,7 +42,7 @@ RES_StartupReceipt RES_Startup(void); RES_Resource RES_OpenResource(String name); #if RESOURCES_EMBEDDED -# define RES_CloseResource(res_ptr) (UNUSED)res_ptr +# define RES_CloseResource(res_ptr) (MaybeUnused)res_ptr #else void RES_CloseResource(RES_Resource *res_ptr); #endif diff --git a/src/sim/sim.c b/src/sim/sim.c deleted file mode 100644 index bd0084cf..00000000 --- a/src/sim/sim.c +++ /dev/null @@ -1,7 +0,0 @@ -#include "sim.h" - -#include "sim_core.c" -#include "sim_ent.c" -#include "sim_phys.c" -#include "sim_step.c" -#include "sim_space.c" diff --git a/src/sim/sim.h b/src/sim/sim.h deleted file mode 100644 index c47255e7..00000000 --- a/src/sim/sim.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef SIM_H -#define SIM_H - -#include "../base/base.h" -#include "../sprite/sprite.h" -#include "../collider/collider.h" -#include "../net/net.h" -#include "../mixer/mixer.h" -#include "../bitbuff/bitbuff.h" - -#include "sim_core.h" -#include "sim_phys.h" -#include "sim_space.h" -#include "sim_ent.h" -#include "sim_step.h" - -#endif diff --git a/src/sound/sound_core.c b/src/sound/sound_core.c index e3d14d22..7c5785ad 100644 --- a/src/sound/sound_core.c +++ b/src/sound/sound_core.c @@ -7,7 +7,7 @@ SND_StartupReceipt SND_Startup(AC_StartupReceipt *asset_cache_sr) { __prof; SND_SharedState *g = &SND_shared_state; - (UNUSED)asset_cache_sr; + (MaybeUnused)asset_cache_sr; g->params.arena = AllocArena(Gibi(64)); return (SND_StartupReceipt) { 0 }; } diff --git a/src/ttf/ttf_dwrite.cpp b/src/ttf/ttf_dwrite.cpp index 6569f21a..045368d9 100644 --- a/src/ttf/ttf_dwrite.cpp +++ b/src/ttf/ttf_dwrite.cpp @@ -66,7 +66,7 @@ TTF_Result TTF_Decode(Arena *arena, String encoded, f32 point_size, u32 *cache_c /* TODO: handle errors */ HRESULT error = 0; - (UNUSED)error; + (MaybeUnused)error; /* File */ IDWriteFontFile *font_file = 0; diff --git a/src/user/user.c b/src/user/user.c deleted file mode 100644 index 204c2f4a..00000000 --- a/src/user/user.c +++ /dev/null @@ -1,3 +0,0 @@ -#include "user.h" - -#include "user_core.c" diff --git a/src/user/user.h b/src/user/user.h deleted file mode 100644 index e9d32d90..00000000 --- a/src/user/user.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef USER_H -#define USER_H - -#include "../base/base.h" -#include "../sim/sim.h" -#include "../gpu/gpu.h" -#include "../sprite/sprite.h" -#include "../font/font.h" -#include "../collider/collider.h" -#include "../draw/draw.h" -#include "../net/net.h" - -#include "user_core.h" - -#endif