Sort enum entities; Remove sprint* from fmt.odin

This commit is contained in:
Ginger Bill
2016-09-20 09:33:29 +01:00
parent 59b0cf61ef
commit 31c11a5037
4 changed files with 90 additions and 79 deletions
+5 -8
View File
@@ -64,6 +64,9 @@ Type_Info :: union {
}
type_info_base :: proc(info: ^Type_Info) -> ^Type_Info {
if info == null {
return null
}
for {
match type i : info {
case Type_Info.Named:
@@ -355,17 +358,11 @@ __default_allocator :: proc() -> Allocator {
__enum_to_string :: proc(info: ^Type_Info, value: i64) -> string {
for {
match type i : info {
case Type_Info.Named:
info = i.base
continue
}
break
}
info = type_info_base(info)
match type ti : info {
case Type_Info.Enum:
// TODO(bill): Search faster than linearly
for i := 0; i < ti.values.count; i++ {
if ti.values[i] == value {
return ti.names[i]