changed TomlValue.value to anonymous union

This commit is contained in:
2025-11-27 01:32:34 +05:00
parent 711cc70b68
commit 6978bb2afe
7 changed files with 47 additions and 47 deletions

View File

@@ -32,25 +32,25 @@ void print_value(const TomlValue* value)
assert(false && "invalid type");
break;
case TLIBTOML_TABLE:
print_table(value->value.table);
print_table(value->table);
break;
case TLIBTOML_ARRAY:
print_array(value->value.array);
print_array(value->array);
break;
case TLIBTOML_STRING:
printf("'" FMT_str "'", value->value.s->len, value->value.s->data);
printf("'" FMT_str "'", value->s->len, value->s->data);
break;
case TLIBTOML_INTEGER:
printf("%" PRId64, value->value.i);
printf("%" PRId64, value->i);
break;
case TLIBTOML_FLOAT:
printf("%f", value->value.f);
printf("%f", value->f);
break;
case TLIBTOML_DATETIME:
printf("(datetime)");
break;
case TLIBTOML_BOOLEAN:
printf("%s", value->value.b ? "true" : "false");
printf("%s", value->b ? "true" : "false");
break;
}
}