From 13ed8b71c9ea9af5f644e2f130bafe95bdfcd6ac Mon Sep 17 00:00:00 2001 From: Doyle Date: Sat, 23 Feb 2019 14:22:09 +1100 Subject: [PATCH] Update test file to be more compliant --- Code/DqnInspect.h | 15 +++++++++++---- Data/DqnInspect_TestData.h | 6 +++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Code/DqnInspect.h b/Code/DqnInspect.h index 7cd2e3d..89ea59b 100644 --- a/Code/DqnInspect.h +++ b/Code/DqnInspect.h @@ -95,6 +95,13 @@ struct DqnInspect_StructMemberMetadata int key_len; char const *val_str; // Metadata value is always inspected to a string int val_str_len; + + // TODO(doyle): Implement + union + { + int int_val; + float flt_val; + }; }; struct DqnInspect_StructMember @@ -899,10 +906,10 @@ void ParseCPPStruct(CPPTokeniser *tokeniser) CPPTokeniser_SprintfToFile(tokeniser, "DqnInspect_StructMemberMetadataType::String,\n"); // metadata->key - CPPTokeniser_SprintfToFile(tokeniser, "STR_AND_LEN(\"%.*s\"),\n", entry.key.len, entry.key.str); + CPPTokeniser_SprintfToFile(tokeniser, "STR_AND_LEN(\"%.*s\"), ", entry.key.len, entry.key.str); // metadata->value - CPPTokeniser_SprintfToFile(tokeniser, "STR_AND_LEN(\"%.*s\"),\n", entry.value.len, entry.value.str); + CPPTokeniser_SprintfToFileNoIndenting(tokeniser, "STR_AND_LEN(\"%.*s\"),\n", entry.value.len, entry.value.str); tokeniser->indent_level--; CPPTokeniser_SprintfToFile(tokeniser, "},\n"); @@ -924,8 +931,8 @@ void ParseCPPStruct(CPPTokeniser *tokeniser) CPPTokeniser_SprintfToFile(tokeniser, "{\n"); tokeniser->indent_level++; - CPPTokeniser_SprintfToFile(tokeniser, "STR_AND_LEN(\"%.*s\"),\n", decl->type.len, decl->type.str); - CPPTokeniser_SprintfToFile(tokeniser, "STR_AND_LEN(\"%.*s\"),\n", decl->name.len, decl->name.str); + CPPTokeniser_SprintfToFile(tokeniser, "STR_AND_LEN(\"%.*s\"), ", decl->type.len, decl->type.str); + CPPTokeniser_SprintfToFileNoIndenting(tokeniser, "STR_AND_LEN(\"%.*s\"),\n", decl->name.len, decl->name.str); CPPTokeniser_SprintfToFile(tokeniser, "%d, // array_dimensions\n", decl->array_dimensions); if (member->metadata_array.len <= 0) CPPTokeniser_SprintfToFile(tokeniser, "nullptr, // metadata\n"); diff --git a/Data/DqnInspect_TestData.h b/Data/DqnInspect_TestData.h index a5d19bd..a95a1a3 100644 --- a/Data/DqnInspect_TestData.h +++ b/Data/DqnInspect_TestData.h @@ -33,16 +33,16 @@ DQN_INSPECT struct OpenGLState // u32 shaders[(int)OpenGLShader::Count]; V4 draw_color DQN_INSPECT_META(DisplayName = "HelloWorld"); V3 lighting_ambient_coeff; - // u8 **bitmaps; + char **bitmaps; // FixedArray lights; // FixedArray camera_matrixes; int draw_call_count; const int *const a; - int const *const b, c, const *const d, *const e; + int const *const b, c, *d, *e; const int f; int const g; int *const h; int const* i; - int *********const j, k, ******l, const *m; + int *********const j, k, ******l, *m; };