WIP: corrections/formatting post prefix addition

This commit is contained in:
ed
2025-02-12 15:11:20 -05:00
parent 0ab226f739
commit 4a6a6b2290
17 changed files with 352 additions and 360 deletions
+3 -7
View File
@@ -1,17 +1,13 @@
# Metadesk Library: RAD Debugger's Standalone Fork # Metadesk Library: RAD Debugger's Standalone Fork
**Note: This repo is under heavy WIP. Currently getting the code from RAD's (Epic Games) Debugger over to a standalone state while at the same time studying it.**
**Update:**
This will contain just the minimal lib. Extra additions or the ability to generate variants will be in another repo (Currently removing [excess](https://github.com/Ed94/metadesk_lib_gen)).
This is a fork that aims to make the latest version of metadesk available from the [RAD Debugger](https://github.com/EpicGamesExt/raddebugger) accessible as a library. This is a fork that aims to make the latest version of metadesk available from the [RAD Debugger](https://github.com/EpicGamesExt/raddebugger) accessible as a library.
**Note: This repo is under heavy WIP. Currently getting the code from RAD's (Epic Games) Debugger over to a standalone state while at the same time studying it.**
**Update:** This will contain just the minimal lib. Extra additions or the ability to generate variants are available at: [metadesk_libgen](https://github.com/Ed94/metadesk_libgen)
docs will be updated referencing content procued by Ryan Fleury and content based on studying or resolving this library for this repo. docs will be updated referencing content procued by Ryan Fleury and content based on studying or resolving this library for this repo.
## Documentation ## Documentation
* [docs](./docs/Readme.md) * [docs](./docs/Readme.md)
* [examples](./examples/Readme.md) * [examples](./examples/Readme.md)
* [gen_c11](./gen_c11/Readme.md) (Remvoing to another repo)
* [gen_cpp17](./gen_cpp17/Readme.md) (Removing to another repo)
+5 -7
View File
@@ -36,9 +36,9 @@ md_cmd_line_opt_from_slot(MD_CmdLineOpt** slot, MD_String8 string) {
MD_CmdLineOpt* MD_CmdLineOpt*
md_cmd_line_insert_opt__ainfo(MD_AllocatorInfo ainfo, MD_CmdLine* cmd_line, MD_String8 string, MD_String8List values) md_cmd_line_insert_opt__ainfo(MD_AllocatorInfo ainfo, MD_CmdLine* cmd_line, MD_String8 string, MD_String8List values)
{ {
MD_CmdLineOpt *var = 0; MD_CmdLineOpt* var = 0;
MD_CmdLineOpt **slot = md_cmd_line_slot_from_string(cmd_line, string); MD_CmdLineOpt** slot = md_cmd_line_slot_from_string(cmd_line, string);
MD_CmdLineOpt *existing_var = md_cmd_line_opt_from_slot(slot, string); MD_CmdLineOpt* existing_var = md_cmd_line_opt_from_slot(slot, string);
if(existing_var != 0) if(existing_var != 0)
{ {
var = existing_var; var = existing_var;
@@ -63,8 +63,6 @@ md_cmd_line_insert_opt__ainfo(MD_AllocatorInfo ainfo, MD_CmdLine* cmd_line, MD_S
return var; return var;
} }
MD_CmdLine MD_CmdLine
md_cmd_line_from_string_list__ainfo(MD_AllocatorInfo ainfo, MD_String8List command_line) md_cmd_line_from_string_list__ainfo(MD_AllocatorInfo ainfo, MD_String8List command_line)
{ {
@@ -89,7 +87,7 @@ md_cmd_line_from_string_list__ainfo(MD_AllocatorInfo ainfo, MD_String8List comma
// a flag option. All arguments after a single "--" (with no trailing string // a flag option. All arguments after a single "--" (with no trailing string
// on the command line will be considered as input files. // on the command line will be considered as input files.
MD_B32 is_option = 1; MD_B32 is_option = 1;
if(after_passthrough_option == 0) if (after_passthrough_option == 0)
{ {
if (md_str8_match(node->string, md_str8_lit("--"), 0)) { if (md_str8_match(node->string, md_str8_lit("--"), 0)) {
after_passthrough_option = 1; after_passthrough_option = 1;
@@ -111,7 +109,7 @@ md_cmd_line_from_string_list__ainfo(MD_AllocatorInfo ainfo, MD_String8List comma
} }
// NOTE(rjf): This string is an option. // NOTE(rjf): This string is an option.
if(is_option) if (is_option)
{ {
MD_B32 has_arguments = 0; MD_B32 has_arguments = 0;
MD_U64 arg_signifier_position1 = md_str8_find_needle(option_name, 0, md_str8_lit(":"), 0); MD_U64 arg_signifier_position1 = md_str8_find_needle(option_name, 0, md_str8_lit(":"), 0);
-2
View File
@@ -6,8 +6,6 @@
# include "base_types.h" # include "base_types.h"
#endif #endif
// TODO(Ed): Review this
//////////////////////////////// ////////////////////////////////
//~ rjf: Asserts //~ rjf: Asserts
+9 -9
View File
@@ -80,7 +80,7 @@ MD_UNRESOLVED_GENERIC_SELECTION const md_assert_generic_sel_fail = {0};
size_t md_generic_example_hash__P_long( long val ) { return val * 2654435761ull; } size_t md_generic_example_hash__P_long( long val ) { return val * 2654435761ull; }
// To add support for long long: // To add support for long long:
#define GENERIC_SLOT_2__example_hash long long, md_generic_example_hash__P_long_long #define MD_GENERIC_SLOT_2__example_hash long long, md_generic_example_hash__P_long_long
size_t md_generic_example_hash__P_long_long( long long val ) { return val * 2654435761ull; } size_t md_generic_example_hash__P_long_long( long long val ) { return val * 2654435761ull; }
// If using an Editor with support for syntax hightlighting macros: // If using an Editor with support for syntax hightlighting macros:
@@ -90,13 +90,13 @@ size_t md_generic_example_hash__P_long_long( long long val ) { return val * 2654
(function_arguments), /* Select Via Expression*/ \ (function_arguments), /* Select Via Expression*/ \
/* Extendibility slots: */ \ /* Extendibility slots: */ \
md_if_generic_selector_defined_include_slot( MD_GENERIC_SLOT_1__example_hash ) \ md_if_generic_selector_defined_include_slot( MD_GENERIC_SLOT_1__example_hash ) \
md_if_generic_selector_defined_include_slot( GENERIC_SLOT_2__example_hash ) \ md_if_generic_selector_defined_include_slot( MD_GENERIC_SLOT_2__example_hash ) \
md_if_generic_selector_defined_include_slot( GENERIC_SLOT_3__example_hash ) \ md_if_generic_selector_defined_include_slot( MD_GENERIC_SLOT_3__example_hash ) \
md_if_generic_selector_defined_include_slot( GENERIC_SLOT_4__example_hash ) \ md_if_generic_selector_defined_include_slot( MD_GENERIC_SLOT_4__example_hash ) \
md_if_generic_selector_defined_include_slot( GENERIC_SLOT_5__example_hash ) \ md_if_generic_selector_defined_include_slot( MD_GENERIC_SLOT_5__example_hash ) \
md_if_generic_selector_defined_include_slot( GENERIC_SLOT_6__example_hash ) \ md_if_generic_selector_defined_include_slot( MD_GENERIC_SLOT_6__example_hash ) \
md_if_generic_selector_defined_include_slot( GENERIC_SLOT_7__example_hash ) \ md_if_generic_selector_defined_include_slot( MD_GENERIC_SLOT_7__example_hash ) \
md_if_generic_selector_defined_include_slot( GENERIC_SLOT_8__example_hash ) \ md_if_generic_selector_defined_include_slot( MD_GENERIC_SLOT_8__example_hash ) \
default: md_assert_generic_sel_fail \ default: md_assert_generic_sel_fail \
) md_generic_call( function_arguments ) ) md_generic_call( function_arguments )
@@ -163,7 +163,7 @@ _Generic_L2((expr), \
#undef example_with_generic_layers #undef example_with_generic_layers
#undef function_generic_example #undef function_generic_example
#undef MD_GENERIC_SLOT_1__example_hash #undef MD_GENERIC_SLOT_1__example_hash
#undef GENERIC_SLOT_2__example_hash #undef MD_GENERIC_SLOT_2__example_hash
#undef generic_example_hash #undef generic_example_hash
#undef md_function_generic_example_varadic #undef md_function_generic_example_varadic
#undef md_function_generic_example_direct_type #undef md_function_generic_example_direct_type
+3 -3
View File
@@ -181,7 +181,7 @@
#endif #endif
#define ct_if(expr, then, else) _Generic( \ #define ct_if(expr, then, else) _Generic( \
(&(char[1 + !!(EXPR)]){0}), \ (&(char[1 + !!(expr)]){0}), \
char (*)[2]: (THEN), \ char (*)[2]: (then), \
char (*)[1]: (ELSE) \ char (*)[1]: (else) \
) )
+8 -8
View File
@@ -407,10 +407,10 @@ md_f64_from_str8(MD_String8 string)
void void
md_str8_list_concat_in_place(MD_String8List* list, MD_String8List* to_push) { md_str8_list_concat_in_place(MD_String8List* list, MD_String8List* to_push) {
if(to_push->md_node_count != 0) if(to_push->node_count != 0)
{ {
if (list->last) { if (list->last) {
list->md_node_count += to_push->md_node_count; list->node_count += to_push->node_count;
list->total_size += to_push->total_size; list->total_size += to_push->total_size;
list->last->next = to_push->first; list->last->next = to_push->first;
list->last = to_push->last; list->last = to_push->last;
@@ -441,7 +441,7 @@ md_str8_list_aligner__ainfo(MD_AllocatorInfo ainfo, MD_String8List* list, MD_U64
md_assert(increase_size <= md_array_count(zeroes_buffer)); md_assert(increase_size <= md_array_count(zeroes_buffer));
md_sll_queue_push(list->first, list->last, node); md_sll_queue_push(list->first, list->last, node);
list->md_node_count += 1; list->node_count += 1;
list->total_size = new_size; list->total_size = new_size;
node->string.str = (MD_U8*)zeroes_buffer; node->string.str = (MD_U8*)zeroes_buffer;
node->string.size = increase_size; node->string.size = increase_size;
@@ -506,8 +506,8 @@ md_str8_list_join__ainfo(MD_AllocatorInfo ainfo, MD_String8List* list, MD_String
md_memory_copy_struct(&join, optional_params); md_memory_copy_struct(&join, optional_params);
} }
MD_U64 sep_count = 0; MD_U64 sep_count = 0;
if (list->md_node_count > 0){ if (list->node_count > 0){
sep_count = list->md_node_count - 1; sep_count = list->node_count - 1;
} }
MD_String8 result; MD_String8 result;
@@ -1079,7 +1079,7 @@ md_try_guid_from_string(MD_String8 string, MD_Guid* md_guid_out)
MD_B32 is_parsed = 0; MD_B32 is_parsed = 0;
MD_String8List list = md_str8_split_by_string_chars(scratch.arena, string, md_str8_lit("-"), MD_StringSplitFlag_KeepEmpties); MD_String8List list = md_str8_split_by_string_chars(scratch.arena, string, md_str8_lit("-"), MD_StringSplitFlag_KeepEmpties);
if(list.md_node_count == 5) if(list.node_count == 5)
{ {
MD_String8 data1_str = list.first->string; MD_String8 data1_str = list.first->string;
MD_String8 data2_str = list.first->next->string; MD_String8 data2_str = list.first->next->string;
@@ -1294,7 +1294,7 @@ md_wrapped_lines_from_string__ainfo(MD_AllocatorInfo ainfo, MD_String8 string, M
MD_String8 substr = md_str8_substr(string, candidate_line_range); MD_String8 substr = md_str8_substr(string, candidate_line_range);
MD_U64 width_this_line = max_width-wrapped_indent_level; MD_U64 width_this_line = max_width-wrapped_indent_level;
if (list.md_node_count == 0) { if (list.node_count == 0) {
width_this_line = first_line_max_width; width_this_line = first_line_max_width;
} }
if (substr.size > width_this_line) if (substr.size > width_this_line)
@@ -1355,7 +1355,7 @@ md_fuzzy_match_find__ainfo(MD_AllocatorInfo ainfo, MD_String8 needle, MD_String8
MD_String8List needles = md_str8_split(scratch.arena, needle, (MD_U8*)" ", 1, 0); MD_String8List needles = md_str8_split(scratch.arena, needle, (MD_U8*)" ", 1, 0);
MD_FuzzyMatchRangeList MD_FuzzyMatchRangeList
result = {0}; result = {0};
result.needle_part_count = needles.md_node_count; result.needle_part_count = needles.node_count;
for(MD_String8Node* needle_n = needles.first; needle_n != 0; needle_n = needle_n->next) for(MD_String8Node* needle_n = needles.first; needle_n != 0; needle_n = needle_n->next)
{ {
MD_U64 find_pos = 0; MD_U64 find_pos = 0;
+1 -1
View File
@@ -66,7 +66,7 @@ struct MD_String8List
{ {
MD_String8Node* first; MD_String8Node* first;
MD_String8Node* last; MD_String8Node* last;
MD_U64 md_node_count; MD_U64 node_count;
MD_U64 total_size; MD_U64 total_size;
}; };