From d3f7bef2b7eb13fa450abf67a3e928fd0ef74cb9 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Sat, 1 Jun 2024 19:32:24 -0700 Subject: [PATCH] appease clang --- build.bat | 2 +- project.4coder | 2 +- src/df/core/df_core.h | 12 ++++++++---- .../dwrite/font_provider_dwrite.h | 18 ++++++++++-------- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/build.bat b/build.bat index 41f8ecb9..74e5ea3e 100644 --- a/build.bat +++ b/build.bat @@ -42,7 +42,7 @@ if "%asan%"=="1" set auto_compile_flags=%auto_compile_flags% -fsanitize=add :: --- Compile/Link Line Definitions ------------------------------------------ set cl_common= /I..\src\ /I..\local\ /nologo /FC /Z7 -set clang_common= -I..\src\ -I..\local\ -gcodeview -fdiagnostics-absolute-paths -Wall -Wno-unknown-warning-option -Wno-missing-braces -Wno-unused-function -Wno-writable-strings -Wno-unused-value -Wno-unused-variable -Wno-unused-local-typedef -Wno-deprecated-register -Wno-deprecated-declarations -Wno-unused-but-set-variable -Wno-single-bit-bitfield-constant-conversion -Xclang -flto-visibility-public-std -D_USE_MATH_DEFINES -Dstrdup=_strdup -Dgnu_printf=printf +set clang_common= -I..\src\ -I..\local\ -gcodeview -fdiagnostics-absolute-paths -Wall -Wno-unknown-warning-option -Wno-missing-braces -Wno-unused-function -Wno-writable-strings -Wno-unused-value -Wno-unused-variable -Wno-unused-local-typedef -Wno-deprecated-register -Wno-deprecated-declarations -Wno-unused-but-set-variable -Wno-single-bit-bitfield-constant-conversion -Wno-compare-distinct-pointer-types -Xclang -flto-visibility-public-std -D_USE_MATH_DEFINES -Dstrdup=_strdup -Dgnu_printf=printf set cl_debug= call cl /Od /DBUILD_DEBUG=1 %cl_common% %auto_compile_flags% set cl_release= call cl /O2 /DBUILD_DEBUG=0 %cl_common% %auto_compile_flags% set clang_debug= call clang -g -O0 -DBUILD_DEBUG=1 %clang_common% %auto_compile_flags% diff --git a/project.4coder b/project.4coder index 9f070887..241a911b 100644 --- a/project.4coder +++ b/project.4coder @@ -47,7 +47,7 @@ commands = { .rjf_f1 = { - .win = "build raddbg telemetry", + .win = "build raddbg telemetry clang", .linux = "", .out = "*compilation*", .footer_panel = true, diff --git a/src/df/core/df_core.h b/src/df/core/df_core.h index 1a5e032d..a8a72850 100644 --- a/src/df/core/df_core.h +++ b/src/df/core/df_core.h @@ -265,10 +265,15 @@ struct DF_Eval //////////////////////////////// //~ rjf: View Rule Hook Types -#define DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_SIG(name) DF_Eval name(Arena *arena, DI_Scope *di_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_Eval eval, struct DF_CfgVal *val) +typedef struct DF_CfgNode DF_CfgNode; +typedef struct DF_CfgVal DF_CfgVal; +typedef struct DF_CfgTable DF_CfgTable; +typedef struct DF_EvalView DF_EvalView; +typedef struct DF_EvalVizBlockList DF_EvalVizBlockList; +#define DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_SIG(name) DF_Eval name(Arena *arena, DI_Scope *di_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_Eval eval, DF_CfgVal *val) #define DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_NAME(name) df_core_view_rule_eval_resolution__##name #define DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_DEF(name) internal DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_SIG(DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_NAME(name)) -#define DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_SIG(name) void name(Arena *arena, DI_Scope *di_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, struct DF_EvalView *eval_view, DF_Eval eval, String8 string, struct DF_CfgTable *cfg_table, DF_ExpandKey parent_key, DF_ExpandKey key, S32 depth, struct DF_CfgNode *cfg, struct DF_EvalVizBlockList *out) +#define DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_SIG(name) void name(Arena *arena, DI_Scope *di_scope, DF_CtrlCtx *ctrl_ctx, EVAL_ParseCtx *parse_ctx, EVAL_String2ExprMap *macro_map, DF_EvalView *eval_view, DF_Eval eval, String8 string, DF_CfgTable *cfg_table, DF_ExpandKey parent_key, DF_ExpandKey key, S32 depth, DF_CfgNode *cfg, struct DF_EvalVizBlockList *out) #define DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(name) df_core_view_rule_viz_block_prod__##name #define DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_DEF(name) internal DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_SIG(DF_CORE_VIEW_RULE_VIZ_BLOCK_PROD_FUNCTION_NAME(name)) typedef DF_CORE_VIEW_RULE_EVAL_RESOLUTION_FUNCTION_SIG(DF_CoreViewRuleEvalResolutionHookFunctionType); @@ -1270,8 +1275,7 @@ read_only global DF_Entity df_g_nil_entity = 0, // rjf: name equipment - 0, - zero_struct, + {0}, 0, // rjf: timestamp diff --git a/src/font_provider/dwrite/font_provider_dwrite.h b/src/font_provider/dwrite/font_provider_dwrite.h index 973104fe..6a21ea13 100644 --- a/src/font_provider/dwrite/font_provider_dwrite.h +++ b/src/font_provider/dwrite/font_provider_dwrite.h @@ -192,16 +192,17 @@ static inline UINT32 IDWriteBitmapRenderTarget_Releas //- rjf: font file loader interface types +typedef struct FP_DWrite_FontFileLoader FP_DWrite_FontFileLoader; typedef struct FP_DWrite_FontFileLoaderVTable FP_DWrite_FontFileLoaderVTable; + struct FP_DWrite_FontFileLoaderVTable { HRESULT (*QueryInterface)(void *obj, REFIID riid, void *ptr_to_object); ULONG (*AddRef)(void *obj); ULONG (*Release)(void *obj); - HRESULT (*CreateStreamFromKey)(struct FP_DWrite_FontFileLoader *loader, void const *font_file_ref_key, UINT32 font_file_ref_key_size, IDWriteFontFileStream **stream_out); + HRESULT (*CreateStreamFromKey)(FP_DWrite_FontFileLoader *loader, void const *font_file_ref_key, UINT32 font_file_ref_key_size, IDWriteFontFileStream **stream_out); }; -typedef struct FP_DWrite_FontFileLoader FP_DWrite_FontFileLoader; struct FP_DWrite_FontFileLoader { FP_DWrite_FontFileLoaderVTable *lpVtbl; @@ -209,26 +210,27 @@ struct FP_DWrite_FontFileLoader //- rjf: font file stream interface types +typedef struct FP_DWrite_FontFileStream FP_DWrite_FontFileStream; typedef struct FP_DWrite_FontFileStreamVTable FP_DWrite_FontFileStreamVTable; +typedef struct FP_DWrite_FontFileStreamNode FP_DWrite_FontFileStreamNode; + struct FP_DWrite_FontFileStreamVTable { HRESULT (*QueryInterface)(void *obj, REFIID riid, void *ptr_to_object); ULONG (*AddRef)(void *obj); ULONG (*Release)(void *obj); - HRESULT (*ReadFileFragment)(struct FP_DWrite_FontFileStream *obj, void const **fragment_start, UINT64 file_offset, UINT64 fragment_size, void **fragment_context); - HRESULT (*ReleaseFileFragment)(struct FP_DWrite_FontFileStream *obj, void *fragment_context); - HRESULT (*GetFileSize)(struct FP_DWrite_FontFileStream *obj, UINT64 *size_out); - HRESULT (*GetLastWriteTime)(struct FP_DWrite_FontFileStream *obj, UINT64 *time_out); + HRESULT (*ReadFileFragment)(FP_DWrite_FontFileStream *obj, void const **fragment_start, UINT64 file_offset, UINT64 fragment_size, void **fragment_context); + HRESULT (*ReleaseFileFragment)(FP_DWrite_FontFileStream *obj, void *fragment_context); + HRESULT (*GetFileSize)(FP_DWrite_FontFileStream *obj, UINT64 *size_out); + HRESULT (*GetLastWriteTime)(FP_DWrite_FontFileStream *obj, UINT64 *time_out); }; -typedef struct FP_DWrite_FontFileStream FP_DWrite_FontFileStream; struct FP_DWrite_FontFileStream { FP_DWrite_FontFileStreamVTable *lpVtbl; String8 *data; }; -typedef struct FP_DWrite_FontFileStreamNode FP_DWrite_FontFileStreamNode; struct FP_DWrite_FontFileStreamNode { FP_DWrite_FontFileStreamNode *next;