unused parameter macro

This commit is contained in:
jacob 2025-08-01 04:36:37 -05:00
parent 4675a22292
commit e9a031eea7
38 changed files with 121 additions and 129 deletions

View File

@ -5,8 +5,6 @@
#include "../platform/platform.h" #include "../platform/platform.h"
#include "../ttf/ttf.h" #include "../ttf/ttf.h"
#include "../gpu/gpu.h" #include "../gpu/gpu.h"
#include "../sim/sim.h"
#include "../user/user.h"
#include "../sprite/sprite.h" #include "../sprite/sprite.h"
#include "../watch/watch.h" #include "../watch/watch.h"
#include "../draw/draw.h" #include "../draw/draw.h"
@ -18,6 +16,7 @@
#include "../net/net.h" #include "../net/net.h"
#include "../resource/resource.h" #include "../resource/resource.h"
#include "../playback/playback.h" #include "../playback/playback.h"
#include "../pp/pp.h"
#include "app_core.h" #include "app_core.h"

View File

@ -150,11 +150,11 @@ void P_AppStartup(String args_str)
} }
} }
(UNUSED)args; (MaybeUnused)args;
(UNUSED)logfile_name; (MaybeUnused)logfile_name;
(UNUSED)settings_file_name; (MaybeUnused)settings_file_name;
(UNUSED)connect_address; (MaybeUnused)connect_address;
(UNUSED)GetDefaultAppWindowSettings; (MaybeUnused)GetDefaultAppWindowSettings;
#if !RtcIsEnabled #if !RtcIsEnabled
/* Verify test modes aren't left on by accident in release mode */ /* Verify test modes aren't left on by accident in release mode */
@ -243,14 +243,14 @@ void P_AppStartup(String args_str)
MIX_StartupReceipt mixer_sr = MIX_Startup(); MIX_StartupReceipt mixer_sr = MIX_Startup();
SND_StartupReceipt sound_sr = SND_Startup(&asset_cache_sr); SND_StartupReceipt sound_sr = SND_Startup(&asset_cache_sr);
D_StartupReceipt draw_sr = D_Startup(&font_sr); D_StartupReceipt draw_sr = D_Startup(&font_sr);
SimStartupReceipt sim_sr = sim_startup();
/* Interface systems */ /* Interface systems */
SimStartupReceipt sim_sr = SimStartup();
PB_StartupReceipt playback_sr = PB_Startup(&mixer_sr); 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; (MaybeUnused)user_sr;
(UNUSED)playback_sr; (MaybeUnused)playback_sr;
#if 0 #if 0
/* Write window settings to file */ /* Write window settings to file */

View File

@ -238,8 +238,8 @@ void ASE_Inflate(u8 *dst, u8 *encoded)
u8 cmf = (u8)(cm | (cinfo << 4)); u8 cmf = (u8)(cm | (cinfo << 4));
u8 flg = fcheck | (fdict << 5) | (flevl << 6); u8 flg = fcheck | (fdict << 5) | (flevl << 6);
(UNUSED)cmf; (MaybeUnused)cmf;
(UNUSED)flg; (MaybeUnused)flg;
Assert(((cmf * 256) + flg) % 31 == 0); Assert(((cmf * 256) + flg) % 31 == 0);
u8 bfinal = 0; u8 bfinal = 0;
@ -255,7 +255,7 @@ void ASE_Inflate(u8 *dst, u8 *encoded)
i16 len = ASE_ConsumeBits(&bb, 16); i16 len = ASE_ConsumeBits(&bb, 16);
i16 nlen = ASE_ConsumeBits(&bb, 16); i16 nlen = ASE_ConsumeBits(&bb, 16);
Assert(len == ~nlen); /* Validation */ Assert(len == ~nlen); /* Validation */
(UNUSED)nlen; (MaybeUnused)nlen;
while (len-- > 0) while (len-- > 0)
{ {
*dst++ = ASE_ConsumeBits(&bb, 8); *dst++ = ASE_ConsumeBits(&bb, 8);

View File

@ -50,7 +50,7 @@ AC_Asset *AC_GetAssetCacheSlotLocked(P_Lock *lock, String key, u64 hash)
{ {
AC_SharedState *g = &AC_shared_state; AC_SharedState *g = &AC_shared_state;
P_AssertLockedES(lock, &g->lookup_mutex); P_AssertLockedES(lock, &g->lookup_mutex);
(UNUSED)lock; (MaybeUnused)lock;
u64 index = hash % countof(g->lookup); u64 index = hash % countof(g->lookup);
for (;;) for (;;)

View File

@ -134,7 +134,7 @@ void ShrinkArena(Arena *arena)
{ {
/* Not implemented */ /* Not implemented */
Assert(0); Assert(0);
(UNUSED)arena; (MaybeUnused)arena;
} }
void SetArenaReadonly(Arena *arena) void SetArenaReadonly(Arena *arena)

View File

@ -205,7 +205,7 @@ Inline TempArena _BeginScratch(Arena *potential_conflict)
_BeginScratchNoConflict(); \ _BeginScratchNoConflict(); \
do { \ do { \
u8 arena = 0; \ u8 arena = 0; \
(UNUSED)arena; \ (MaybeUnused)arena; \
} while (0) } while (0)
Inline TempArena _BeginScratchNoConflict(void) Inline TempArena _BeginScratchNoConflict(void)

View File

@ -161,7 +161,7 @@ BuddyBlock *GetUnusedBuddyBlock(BuddyCtx *ctx, BuddyLevel *level)
left->parent = parent_block; left->parent = parent_block;
left->memory = parent_block->memory; left->memory = parent_block->memory;
/* Create right (UNUSED) block from parent block */ /* Create right (MaybeUnused) block from parent block */
BuddyBlock *right = PushBuddyBlock(ctx); BuddyBlock *right = PushBuddyBlock(ctx);
right->is_used = 0; right->is_used = 0;
right->level = level; right->level = level;
@ -196,7 +196,7 @@ BuddyBlock *GetUnusedBuddyBlock(BuddyCtx *ctx, BuddyLevel *level)
left->level = level; left->level = level;
left->memory = ArenaBase(arena); left->memory = ArenaBase(arena);
/* Create right (UNUSED) block from new arena memory */ /* Create right (MaybeUnused) block from new arena memory */
BuddyBlock *right = PushBuddyBlock(ctx); BuddyBlock *right = PushBuddyBlock(ctx);
right->is_used = 0; right->is_used = 0;
right->level = level; right->level = level;

View File

@ -133,7 +133,7 @@ extern "C" {
# define Assert(cond) ((cond) ? 1 : (__builtin_trap(), 0)) # define Assert(cond) ((cond) ? 1 : (__builtin_trap(), 0))
# define DEBUGBREAK __builtin_debugtrap() # define DEBUGBREAK __builtin_debugtrap()
# endif # 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 #else
# define Assert(cond) (void)(0) # define Assert(cond) (void)(0)
#endif #endif
@ -238,7 +238,13 @@ void __asan_unpoison_memory_region(void const volatile *add, size_t);
#endif #endif
//- Markup //- Markup
#define UNUSED void #define MaybeUnused void
#if CompilerIsClang
# define UNUSED __attribute((unused))
#else
# define UNUSED
#endif
#if CompilerIsMsvc #if CompilerIsMsvc
# if LanguageIsCpp # if LanguageIsCpp

View File

@ -649,7 +649,7 @@ b32 AdvanceCodepointIter(CodepointIter *iter)
void EndCodepointIter(CodepointIter *iter) void EndCodepointIter(CodepointIter *iter)
{ {
/* Do nothing */ /* Do nothing */
(UNUSED)iter; (MaybeUnused)iter;
} }
//- String decode //- String decode

View File

@ -7,7 +7,7 @@ D_StartupReceipt D_Startup(F_StartupReceipt *font_sr)
{ {
__prof; __prof;
D_SharedState *g = &D_shared_state; D_SharedState *g = &D_shared_state;
(UNUSED)font_sr; (MaybeUnused)font_sr;
u32 pixel_white = 0xFFFFFFFF; u32 pixel_white = 0xFFFFFFFF;
g->solid_white_texture = GPU_AllocTexture(GP_TEXTURE_FORMAT_R8G8B8A8_UNORM, 0, VEC2I32(1, 1), &pixel_white); g->solid_white_texture = GPU_AllocTexture(GP_TEXTURE_FORMAT_R8G8B8A8_UNORM, 0, VEC2I32(1, 1), &pixel_white);
return (D_StartupReceipt) { 0 }; 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)); D_DrawMaterial(sig, D_MATERIALPARAMS(.texture = g->solid_white_texture, .tint0 = start_color, .tint1 = end_color, .quad = quad));
#else #else
/* Placeholder */ /* Placeholder */
(UNUSED)end_color; (MaybeUnused)end_color;
Quad quad = QuadFromLine(start, end, thickness); Quad quad = QuadFromLine(start, end, thickness);
D_DrawQuad(sig, quad, start_color); D_DrawQuad(sig, quad, start_color);
#endif #endif

View File

@ -2,10 +2,10 @@
DXC_Result DXC_Compile(Arena *arena, String shader_source, i32 num_args, String *args) DXC_Result DXC_Compile(Arena *arena, String shader_source, i32 num_args, String *args)
{ {
(UNUSED)arena; (MaybeUnused)arena;
(UNUSED)shader_source; (MaybeUnused)shader_source;
(UNUSED)num_args; (MaybeUnused)num_args;
(UNUSED)args; (MaybeUnused)args;
DXC_Result result = ZI; DXC_Result result = ZI;
return result; return result;
} }

View File

@ -7,8 +7,8 @@ F_StartupReceipt F_Startup(AC_StartupReceipt *asset_cache_sr, TTF_StartupReceipt
{ {
__prof; __prof;
F_SharedState *g = &F_shared_state; F_SharedState *g = &F_shared_state;
(UNUSED)asset_cache_sr; (MaybeUnused)asset_cache_sr;
(UNUSED)ttf_sr; (MaybeUnused)ttf_sr;
g->params.arena = AllocArena(Gibi(64)); g->params.arena = AllocArena(Gibi(64));
return (F_StartupReceipt) { 0 }; return (F_StartupReceipt) { 0 };
} }

View File

@ -88,7 +88,7 @@ P_ExitFuncDef(GPU_D12_Shutdown)
} }
ID3D12Device_Release(g->device); ID3D12Device_Release(g->device);
#else #else
(UNUSED)GPU_D12_ReleaseCommandQueue; (MaybeUnused)GPU_D12_ReleaseCommandQueue;
#endif #endif
{ {
@ -339,7 +339,7 @@ void GPU_D12_InitObjects(void)
GPU_D12_CommandQueue *cq = g->command_queues[i]; GPU_D12_CommandQueue *cq = g->command_queues[i];
String dbg_name = params[i].dbg_name; String dbg_name = params[i].dbg_name;
__prof_dx12_ctx_alloc(cq->prof, g->device, cq->cq, dbg_name.text, dbg_name.len); __prof_dx12_ctx_alloc(cq->prof, g->device, cq->cq, dbg_name.text, dbg_name.len);
(UNUSED)dbg_name; (MaybeUnused)dbg_name;
} }
} }
#endif #endif
@ -1321,7 +1321,7 @@ GPU_D12_CpuDescriptorHeap *GPU_D12_AllocCpuDescriptorHeap(enum D3D12_DESCRIPTOR_
void cpu_descriptor_heap_release(GPU_D12_CpuDescriptorHeap *dh) void cpu_descriptor_heap_release(GPU_D12_CpuDescriptorHeap *dh)
{ {
/* TODO */ /* TODO */
(UNUSED)dh; (MaybeUnused)dh;
} }
#endif #endif
@ -1556,7 +1556,7 @@ void GPU_D12_ReleaseCommandQueue(GPU_D12_CommandQueue *cq)
{ {
__prof; __prof;
/* TODO */ /* TODO */
(UNUSED)cq; (MaybeUnused)cq;
//ID3D12CommandQueue_Release(cq->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) void GPU_ReleaseSwapchain(GPU_Swapchain *gp_swapchain)
{ {
/* TODO */ /* TODO */
(UNUSED)gp_swapchain; (MaybeUnused)gp_swapchain;
} }
void GPU_WaitOnSwapchain(GPU_Swapchain *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); WaitForSingleObjectEx(swapchain->waitable, 1000, 1);
} }
#else #else
(UNUSED)gp_swapchain; (MaybeUnused)gp_swapchain;
#endif #endif
} }

View File

@ -57,7 +57,7 @@ MIX_Track *MIX_AllocTrackLocked(P_Lock *lock, SND_Sound *sound)
{ {
MIX_SharedState *g = &M_shared_state; MIX_SharedState *g = &M_shared_state;
P_AssertLockedE(lock, &g->mutex); P_AssertLockedE(lock, &g->mutex);
(UNUSED)lock; (MaybeUnused)lock;
MIX_Track *track = 0; MIX_Track *track = 0;
if (g->track_first_free) if (g->track_first_free)
@ -104,7 +104,7 @@ void MIX_ReleaseTrackLocked(P_Lock *lock, MIX_Track *track)
{ {
MIX_SharedState *g = &M_shared_state; MIX_SharedState *g = &M_shared_state;
P_AssertLockedE(lock, &g->mutex); P_AssertLockedE(lock, &g->mutex);
(UNUSED)lock; (MaybeUnused)lock;
/* Remove from playing list */ /* Remove from playing list */
MIX_Track *prev = track->prev; MIX_Track *prev = track->prev;

View File

@ -65,8 +65,8 @@ void P_Unlock(P_Lock *lock);
# define P_AssertLockedE(l, m) Assert((l)->mutex == (m) && (l)->exclusive == 1) # define P_AssertLockedE(l, m) Assert((l)->mutex == (m) && (l)->exclusive == 1)
# define P_AssertLockedES(l, m) Assert((l)->mutex == (m)) # define P_AssertLockedES(l, m) Assert((l)->mutex == (m))
#else #else
# define P_AssertLockedE(l, m) (UNUSED)l # define P_AssertLockedE(l, m) (MaybeUnused)l
# define P_AssertLockedES(l, m) (UNUSED)l # define P_AssertLockedES(l, m) (MaybeUnused)l
#endif #endif
//////////////////////////////// ////////////////////////////////

View File

@ -187,7 +187,7 @@ void P_W32_WaitReleaseThread(P_W32_Thread *thread)
__prof; __prof;
b32 success = P_W32_TryReleaseThread(thread, F32Infinity); b32 success = P_W32_TryReleaseThread(thread, F32Infinity);
Assert(success); 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) void P_W32_YieldFiber(P_W32_Fiber *fiber, P_W32_Fiber *parent_fiber)
{ {
(UNUSED)fiber; (MaybeUnused)fiber;
Assert(fiber->id == FiberId()); Assert(fiber->id == FiberId());
Assert(parent_fiber->id == fiber->parent_id); Assert(parent_fiber->id == fiber->parent_id);
Assert(parent_fiber->id > 0); 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_W32_WorkerCtx *ctx = worker_ctx_arg;
P_Pool pool_kind = ctx->pool_kind; P_Pool pool_kind = ctx->pool_kind;
P_W32_JobPool *pool = &g->job_pools[pool_kind]; P_W32_JobPool *pool = &g->job_pools[pool_kind];
(UNUSED)ctx; (MaybeUnused)ctx;
{ {
/* TODO: Heuristic pinning */ /* TODO: Heuristic pinning */
@ -739,7 +739,7 @@ P_W32_ThreadDef(P_W32_JobWorkerEntryFunc, worker_ctx_arg)
__profn("Set priority"); __profn("Set priority");
b32 success = SetThreadPriority(thread_handle, pool->thread_priority) != 0; b32 success = SetThreadPriority(thread_handle, pool->thread_priority) != 0;
Assert(success); Assert(success);
(UNUSED)success; (MaybeUnused)success;
} }
#if 0 #if 0
@ -761,7 +761,7 @@ P_W32_ThreadDef(P_W32_JobWorkerEntryFunc, worker_ctx_arg)
} }
#endif #endif
Assert(success); Assert(success);
(UNUSED)success; (MaybeUnused)success;
} }
#endif #endif
@ -772,7 +772,7 @@ P_W32_ThreadDef(P_W32_JobWorkerEntryFunc, worker_ctx_arg)
DWORD task = 0; DWORD task = 0;
HANDLE mmc_handle = AvSetMmThreadCharacteristics(L"Pro Audio", &task); HANDLE mmc_handle = AvSetMmThreadCharacteristics(L"Pro Audio", &task);
Assert(mmc_handle); 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; i32 priority = THREAD_PRIORITY_TIME_CRITICAL;
b32 success = SetThreadPriority(GetCurrentThread(), priority); b32 success = SetThreadPriority(GetCurrentThread(), priority);
(UNUSED)success; (MaybeUnused)success;
Assert(success); Assert(success);
} }
@ -2281,7 +2281,7 @@ String P_ReadFile(Arena *arena, P_File file)
/* TODO: error checking */ /* TODO: error checking */
AlignArena(arena, 16); AlignArena(arena, 16);
s.text = PushStructsNoZero(arena, u8, size); s.text = PushStructsNoZero(arena, u8, size);
(UNUSED)ReadFile( (MaybeUnused)ReadFile(
(HANDLE)file.handle, (HANDLE)file.handle,
s.text, s.text,
(DWORD)s.len, (DWORD)s.len,
@ -2308,7 +2308,7 @@ void P_WriteFile(P_File file, String data)
} }
/* WriteFile returns TRUE on success */ /* WriteFile returns TRUE on success */
(UNUSED)WriteFile( (MaybeUnused)WriteFile(
(HANDLE)file.handle, (HANDLE)file.handle,
data.text, data.text,
(DWORD)data.len, (DWORD)data.len,
@ -2513,7 +2513,7 @@ P_WatchInfoList P_ReadWatchWait(Arena *arena, P_Watch *dw)
0, 0,
&ov, &ov,
0); 0);
(UNUSED)success; (MaybeUnused)success;
Assert(success); Assert(success);
HANDLE handles[] = { HANDLE handles[] = {
@ -3070,7 +3070,7 @@ void P_WriteSock(P_Sock *sock, P_Address address, String data)
if (size != (i32)data.len) if (size != (i32)data.len)
{ {
i32 err = WSAGetLastError(); i32 err = WSAGetLastError();
(UNUSED)err; (MaybeUnused)err;
Assert(0); Assert(0);
} }
#endif #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) int CALLBACK wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev_instance, _In_ LPWSTR cmdline_wstr, _In_ int show_code)
{ {
(UNUSED)instance; (MaybeUnused)instance;
(UNUSED)prev_instance; (MaybeUnused)prev_instance;
(UNUSED)cmdline_wstr; (MaybeUnused)cmdline_wstr;
(UNUSED)show_code; (MaybeUnused)show_code;
__profthread("Main thread", PROF_THREAD_GROUP_MAIN); __profthread("Main thread", PROF_THREAD_GROUP_MAIN);
P_W32_SharedCtx *g = &P_W32_shared_ctx; 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); Assert(success);
(UNUSED)success; (MaybeUnused)success;
} }
} }
CloseHandle(thread); CloseHandle(thread);
@ -3543,7 +3543,7 @@ int CALLBACK wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev_instance,
b32 success = RegisterRawInputDevices(&rid, 1, sizeof(rid)); b32 success = RegisterRawInputDevices(&rid, 1, sizeof(rid));
Assert(success); Assert(success);
(UNUSED)success; (MaybeUnused)success;
} }
/* Init threads pool */ /* Init threads pool */

View File

@ -13,7 +13,7 @@ PB_StartupReceipt PB_Startup(MIX_StartupReceipt *mixer_sr)
{ {
__prof; __prof;
PB_WSP_SharedState *g = &PB_WSP_shared_state; PB_WSP_SharedState *g = &PB_WSP_shared_state;
(UNUSED)mixer_sr; (MaybeUnused)mixer_sr;
PB_WSP_InitializeWasapi(); PB_WSP_InitializeWasapi();
/* Start playback job */ /* Start playback job */
P_Run(1, PB_WSP_PlaybackJob, 0, P_Pool_Audio, P_Priority_High, &g->PB_WSP_PlaybackJob_counter); P_Run(1, PB_WSP_PlaybackJob, 0, P_Pool_Audio, P_Priority_High, &g->PB_WSP_PlaybackJob_counter);

8
src/pp/pp.c Normal file
View File

@ -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"

21
src/pp/pp.h Normal file
View File

@ -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

View File

@ -13,13 +13,13 @@ UserStartupReceipt StartupUser(F_StartupReceipt *font_sr,
String connect_address_str) String connect_address_str)
{ {
__prof; __prof;
(UNUSED)font_sr; (MaybeUnused)font_sr;
(UNUSED)sprite_sr; (MaybeUnused)sprite_sr;
(UNUSED)draw_sr; (MaybeUnused)draw_sr;
(UNUSED)asset_cache_sr; (MaybeUnused)asset_cache_sr;
(UNUSED)sound_sr; (MaybeUnused)sound_sr;
(UNUSED)mixer_sr; (MaybeUnused)mixer_sr;
(UNUSED)sim_sr; (MaybeUnused)sim_sr;
SharedUserState *g = &shared_user_state; SharedUserState *g = &shared_user_state;
SetGstat(GSTAT_DEBUG_STEPS, U64Max); SetGstat(GSTAT_DEBUG_STEPS, U64Max);
@ -1358,8 +1358,8 @@ void UpdateUser(P_Window *window)
ContactConstraint *data = &ent->contact_constraint_data; ContactConstraint *data = &ent->contact_constraint_data;
Entity *e0 = sim_ent_from_id(g->ss_blended, data->e0); Entity *e0 = sim_ent_from_id(g->ss_blended, data->e0);
Entity *e1 = sim_ent_from_id(g->ss_blended, data->e1); Entity *e1 = sim_ent_from_id(g->ss_blended, data->e1);
(UNUSED)e0; (MaybeUnused)e0;
(UNUSED)e1; (MaybeUnused)e1;
#if DeveloperIsEnabled #if DeveloperIsEnabled
/* Draw contact points */ /* Draw contact points */
@ -1433,8 +1433,8 @@ void UpdateUser(P_Window *window)
Entity *e1 = sim_ent_from_id(g->ss_blended, data->e1); Entity *e1 = sim_ent_from_id(g->ss_blended, data->e1);
CLD_Shape e0_collider = e0->local_collider; CLD_Shape e0_collider = e0->local_collider;
CLD_Shape e1_collider = e1->local_collider; CLD_Shape e1_collider = e1->local_collider;
(UNUSED)e0_collider; (MaybeUnused)e0_collider;
(UNUSED)e1_collider; (MaybeUnused)e1_collider;
/* Draw closest points */ /* Draw closest points */
#if 0 #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); u32 color = collision_reuslt.solved ? Rgba32F(0, 0, 0.25, 1) : Rgba32F(0, 0.25, 0.25, 1);
f32 thickness = 2; f32 thickness = 2;
u32 detail = 512; u32 detail = 512;
(UNUSED)thickness; (MaybeUnused)thickness;
Vec2Array m = CLD_Menkowski(temp.arena, &e0_collider, &e1_collider, e0_xf, e1_xf, detail); 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 //~ Sim update
P_JobDef(SimJob, _) P_JobDef(SimJob, UNUSED job)
{ {
SharedUserState *g = &shared_user_state; SharedUserState *g = &shared_user_state;
#if 0 #if 0

View File

@ -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); sim_ent_set_angular_velocity(e1, e1->angular_velocity + joint->angular_impulse1 * inv_i);
} }
#else #else
(UNUSED)joint; (MaybeUnused)joint;
#endif #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); f32 earliest_toi = MaxF32(phys_determine_earliest_toi(ctx, step_dt, tolerance, max_iterations), min_toi);
step_dt = remaining_dt * earliest_toi; step_dt = remaining_dt * earliest_toi;
#else #else
(UNUSED)phys_determine_earliest_toi; (MaybeUnused)phys_determine_earliest_toi;
#endif #endif
} }
remaining_dt -= step_dt; remaining_dt -= step_dt;

View File

@ -52,7 +52,7 @@ Readonly Snapshot **_g_sim_snapshot_nil = &G.nil_snapshot;
/* Accessed via `sim_ent_nil()` */ /* Accessed via `sim_ent_nil()` */
Readonly Entity **_g_sim_ent_nil = &G.nil_ent; Readonly Entity **_g_sim_ent_nil = &G.nil_ent;
SimStartupReceipt sim_startup(void) SimStartupReceipt SimStartup(void)
{ {
__prof; __prof;
G.nil_arena = AllocArena(Gibi(1)); G.nil_arena = AllocArena(Gibi(1));

View File

@ -25,7 +25,7 @@ Struct(ClientHandle) {
* ========================== */ * ========================== */
Struct(SimStartupReceipt) { i32 _; }; Struct(SimStartupReceipt) { i32 _; };
SimStartupReceipt sim_startup(void); SimStartupReceipt SimStartup(void);
/* ========================== * /* ========================== *
* Client store * Client store

View File

@ -170,9 +170,9 @@ internal Entity *test_spawn_employee(Entity *parent)
/* Player weapon */ /* Player weapon */
if (employee->valid) { if (employee->valid) {
(UNUSED)test_spawn_smg; (MaybeUnused)test_spawn_smg;
(UNUSED)test_spawn_launcher; (MaybeUnused)test_spawn_launcher;
(UNUSED)test_spawn_chucker; (MaybeUnused)test_spawn_chucker;
Entity *e = test_spawn_chucker(employee); Entity *e = test_spawn_chucker(employee);
employee->equipped = e->id; 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) internal void test_spawn_entities1(Entity *parent, Vec2 pos)
{ {
(UNUSED)pos; (MaybeUnused)pos;
/* Enemy */ /* Enemy */
{ {
@ -242,7 +242,7 @@ internal void test_spawn_entities1(Entity *parent, Vec2 pos)
internal void test_spawn_entities2(Entity *parent, Vec2 pos) internal void test_spawn_entities2(Entity *parent, Vec2 pos)
{ {
(UNUSED)pos; (MaybeUnused)pos;
/* Small Box */ /* Small Box */
#if 1 #if 1
@ -313,7 +313,7 @@ internal void test_spawn_entities2(Entity *parent, Vec2 pos)
internal void test_spawn_entities3(Entity *parent, Vec2 pos) internal void test_spawn_entities3(Entity *parent, Vec2 pos)
{ {
(UNUSED)pos; (MaybeUnused)pos;
/* Heavy box */ /* Heavy box */
{ {
@ -338,7 +338,7 @@ internal void test_spawn_entities3(Entity *parent, Vec2 pos)
internal void test_spawn_entities4(Entity *parent, Vec2 pos) internal void test_spawn_entities4(Entity *parent, Vec2 pos)
{ {
(UNUSED)pos; (MaybeUnused)pos;
/* Light box */ /* Light box */
Entity *e = sim_ent_alloc_sync_src(parent); Entity *e = sim_ent_alloc_sync_src(parent);

View File

@ -42,7 +42,7 @@ RES_StartupReceipt RES_Startup(void);
RES_Resource RES_OpenResource(String name); RES_Resource RES_OpenResource(String name);
#if RESOURCES_EMBEDDED #if RESOURCES_EMBEDDED
# define RES_CloseResource(res_ptr) (UNUSED)res_ptr # define RES_CloseResource(res_ptr) (MaybeUnused)res_ptr
#else #else
void RES_CloseResource(RES_Resource *res_ptr); void RES_CloseResource(RES_Resource *res_ptr);
#endif #endif

View File

@ -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"

View File

@ -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

View File

@ -7,7 +7,7 @@ SND_StartupReceipt SND_Startup(AC_StartupReceipt *asset_cache_sr)
{ {
__prof; __prof;
SND_SharedState *g = &SND_shared_state; SND_SharedState *g = &SND_shared_state;
(UNUSED)asset_cache_sr; (MaybeUnused)asset_cache_sr;
g->params.arena = AllocArena(Gibi(64)); g->params.arena = AllocArena(Gibi(64));
return (SND_StartupReceipt) { 0 }; return (SND_StartupReceipt) { 0 };
} }

View File

@ -66,7 +66,7 @@ TTF_Result TTF_Decode(Arena *arena, String encoded, f32 point_size, u32 *cache_c
/* TODO: handle errors */ /* TODO: handle errors */
HRESULT error = 0; HRESULT error = 0;
(UNUSED)error; (MaybeUnused)error;
/* File */ /* File */
IDWriteFontFile *font_file = 0; IDWriteFontFile *font_file = 0;

View File

@ -1,3 +0,0 @@
#include "user.h"
#include "user_core.c"

View File

@ -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