eliminate dead code

This commit is contained in:
Ryan Fleury
2024-08-26 14:27:51 -07:00
parent 1de57557b5
commit c16e21db71
5 changed files with 0 additions and 284 deletions
-170
View File
@@ -355,66 +355,6 @@ df_expand_set_expansion(Arena *arena, DF_ExpandTreeTable *table, DF_ExpandKey pa
////////////////////////////////
//~ rjf: Config Type Functions
#if 0
internal DF_CfgNode *
df_cfg_tree_copy(Arena *arena, DF_CfgNode *src_root)
{
DF_CfgNode *dst_root = &df_g_nil_cfg_tree;
DF_CfgNode *dst_parent = dst_root;
{
DF_CfgNodeRec rec = {0};
for(DF_CfgNode *src = src_root; src != &df_g_nil_cfg_node; src = rec.next)
{
DF_CfgNode *dst = push_array(arena, DF_CfgNode, 1);
dst->first = dst->last = dst->parent = dst->next = &df_g_nil_cfg_node;
dst->flags = src->flags;
dst->string = push_str8_copy(arena, src->string);
dst->source = src->source;
dst->parent = dst_parent;
if(dst_parent != &df_g_nil_cfg_node)
{
SLLQueuePush_NZ(&df_g_nil_cfg_node, dst_parent->first, dst_parent->last, dst, next);
}
else
{
dst_root = dst_parent = dst;
}
rec = df_cfg_node_rec__depth_first_pre(src, src_root);
if(rec.push_count != 0)
{
dst_parent = dst;
}
else for(U64 idx = 0; idx < rec.pop_count; idx += 1)
{
dst_parent = dst_parent->parent;
}
}
}
return dst_root;
}
internal DF_CfgNodeRec
df_cfg_node_rec__depth_first_pre(DF_CfgNode *node, DF_CfgNode *root)
{
DF_CfgNodeRec rec = {0};
rec.next = &df_g_nil_cfg_node;
if(node->first != &df_g_nil_cfg_node)
{
rec.next = node->first;
rec.push_count = 1;
}
else for(DF_CfgNode *p = node; p != &df_g_nil_cfg_node && p != root; p = p->parent, rec.pop_count += 1)
{
if(p->next != &df_g_nil_cfg_node)
{
rec.next = p->next;
break;
}
}
return rec;
}
#endif
internal DF_CfgTree *
df_cfg_tree_copy(Arena *arena, DF_CfgTree *src)
{
@@ -532,116 +472,6 @@ df_cfg_val_from_string(DF_CfgTable *table, String8 string)
return result;
}
#if 0
internal DF_CfgNode *
df_cfg_node_child_from_string(DF_CfgNode *node, String8 string, StringMatchFlags flags)
{
DF_CfgNode *result = &df_g_nil_cfg_node;
for(DF_CfgNode *child = node->first; child != &df_g_nil_cfg_node; child = child->next)
{
if(str8_match(child->string, string, flags))
{
result = child;
break;
}
}
return result;
}
internal DF_CfgNode *
df_first_cfg_node_child_from_flags(DF_CfgNode *node, DF_CfgNodeFlags flags)
{
DF_CfgNode *result = &df_g_nil_cfg_node;
for(DF_CfgNode *child = node->first; child != &df_g_nil_cfg_node; child = child->next)
{
if(child->flags & flags)
{
result = child;
break;
}
}
return result;
}
internal String8
df_string_from_cfg_node_children(Arena *arena, DF_CfgNode *node)
{
Temp scratch = scratch_begin(&arena, 1);
String8List strs = {0};
for(DF_CfgNode *child = node->first; child != &df_g_nil_cfg_node; child = child->next)
{
str8_list_push(scratch.arena, &strs, child->string);
}
String8 result = str8_list_join(arena, &strs, 0);
scratch_end(scratch);
return result;
}
internal Vec4F32
df_hsva_from_cfg_node(DF_CfgNode *node)
{
Vec4F32 result = {0};
DF_CfgNode *hsva = df_cfg_node_child_from_string(node, str8_lit("hsva"), StringMatchFlag_CaseInsensitive);
DF_CfgNode *rgba = df_cfg_node_child_from_string(node, str8_lit("rgba"), StringMatchFlag_CaseInsensitive);
DF_CfgNode *hsv = df_cfg_node_child_from_string(node, str8_lit("hsv"), StringMatchFlag_CaseInsensitive);
DF_CfgNode *rgb = df_cfg_node_child_from_string(node, str8_lit("rgb"), StringMatchFlag_CaseInsensitive);
if(hsva != &df_g_nil_cfg_node)
{
DF_CfgNode *hue = hsva->first;
DF_CfgNode *sat = hue->next;
DF_CfgNode *val = sat->next;
DF_CfgNode *alp = val->next;
F32 hue_f32 = (F32)f64_from_str8(hue->string);
F32 sat_f32 = (F32)f64_from_str8(sat->string);
F32 val_f32 = (F32)f64_from_str8(val->string);
F32 alp_f32 = (F32)f64_from_str8(alp->string);
result = v4f32(hue_f32, sat_f32, val_f32, alp_f32);
}
else if(hsv != &df_g_nil_cfg_node)
{
DF_CfgNode *hue = hsva->first;
DF_CfgNode *sat = hue->next;
DF_CfgNode *val = sat->next;
F32 hue_f32 = (F32)f64_from_str8(hue->string);
F32 sat_f32 = (F32)f64_from_str8(sat->string);
F32 val_f32 = (F32)f64_from_str8(val->string);
result = v4f32(hue_f32, sat_f32, val_f32, 1.f);
}
else if(rgba != &df_g_nil_cfg_node)
{
DF_CfgNode *red = rgba->first;
DF_CfgNode *grn = red->next;
DF_CfgNode *blu = grn->next;
DF_CfgNode *alp = blu->next;
F32 red_f32 = (F32)f64_from_str8(red->string);
F32 grn_f32 = (F32)f64_from_str8(grn->string);
F32 blu_f32 = (F32)f64_from_str8(blu->string);
F32 alp_f32 = (F32)f64_from_str8(alp->string);
Vec3F32 hsv = hsv_from_rgb(v3f32(red_f32, grn_f32, blu_f32));
result = v4f32(hsv.x, hsv.y, hsv.z, alp_f32);
}
else if(rgb != &df_g_nil_cfg_node)
{
DF_CfgNode *red = rgba->first;
DF_CfgNode *grn = red->next;
DF_CfgNode *blu = grn->next;
F32 red_f32 = (F32)f64_from_str8(red->string);
F32 grn_f32 = (F32)f64_from_str8(grn->string);
F32 blu_f32 = (F32)f64_from_str8(blu->string);
Vec3F32 hsv = hsv_from_rgb(v3f32(red_f32, grn_f32, blu_f32));
result = v4f32(hsv.x, hsv.y, hsv.z, 1.f);
}
return result;
}
internal String8
df_string_from_cfg_node_key(DF_CfgNode *node, String8 key, StringMatchFlags flags)
{
DF_CfgNode *child = df_cfg_node_child_from_string(node, key, flags);
return child->first->string;
}
#endif
////////////////////////////////
//~ rjf: Debug Info Extraction Type Pure Functions