aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-04-18 19:15:14 +0100
committergingerBill <bill@gingerbill.org>2021-04-18 19:15:14 +0100
commit9b3fb25a41ad21949c21253e1dae87b162ed400f (patch)
tree03f2d44ad90aca48e6efa655ebdf928ba3315880 /src
parent2ce98734648eb2f6e332d7e1cc0c240cba81517c (diff)
Fix enumerated arrays for .odin-doc
Diffstat (limited to 'src')
-rw-r--r--src/docs_format.cpp2
-rw-r--r--src/docs_writer.cpp11
2 files changed, 9 insertions, 4 deletions
diff --git a/src/docs_format.cpp b/src/docs_format.cpp
index f30a0bf43..8824153ad 100644
--- a/src/docs_format.cpp
+++ b/src/docs_format.cpp
@@ -131,7 +131,7 @@ struct OdinDocType {
// Used by some types
u32 elem_count_len;
- u64 elem_counts[OdinDocType_ElemsCap];
+ i64 elem_counts[OdinDocType_ElemsCap];
// Each of these is esed by some types, not all
OdinDocArray<OdinDocTypeIndex> types;
diff --git a/src/docs_writer.cpp b/src/docs_writer.cpp
index daae40930..0ae7487fa 100644
--- a/src/docs_writer.cpp
+++ b/src/docs_writer.cpp
@@ -544,7 +544,12 @@ OdinDocTypeIndex odin_doc_type(OdinDocWriter *w, Type *type) {
doc_type.kind = OdinDocType_EnumeratedArray;
doc_type.elem_count_len = 1;
doc_type.elem_counts[0] = type->EnumeratedArray.count;
- doc_type.types = odin_doc_type_as_slice(w, type->EnumeratedArray.elem);
+ {
+ OdinDocTypeIndex types[2] = {};
+ types[0] = odin_doc_type(w, type->EnumeratedArray.index);
+ types[1] = odin_doc_type(w, type->EnumeratedArray.elem);
+ doc_type.types = odin_write_slice(w, types, gb_count_of(types));
+ }
break;
case Type_Slice:
doc_type.kind = OdinDocType_Slice;
@@ -686,8 +691,8 @@ OdinDocTypeIndex odin_doc_type(OdinDocWriter *w, Type *type) {
}
doc_type.types = odin_write_slice(w, types, type_count);
doc_type.elem_count_len = 2;
- doc_type.elem_counts[0] = cast(u64)type->BitSet.lower;
- doc_type.elem_counts[1] = cast(u64)type->BitSet.upper;
+ doc_type.elem_counts[0] = type->BitSet.lower;
+ doc_type.elem_counts[1] = type->BitSet.upper;
}
break;
case Type_SimdVector: