Browse Source

Update fmt to record the bytes written in the fmt.Info

gingerBill 3 years ago
parent
commit
14cb19c2df
2 changed files with 172 additions and 179 deletions
  1. 168 175
      core/fmt/fmt.odin
  2. 4 4
      core/reflect/types.odin

File diff suppressed because it is too large
+ 168 - 175
core/fmt/fmt.odin


+ 4 - 4
core/reflect/types.odin

@@ -334,11 +334,11 @@ is_relative_slice :: proc(info: ^Type_Info) -> bool {
 
 
 
-write_typeid_builder :: proc(buf: ^strings.Builder, id: typeid) {
-	write_type(buf, type_info_of(id))
+write_typeid_builder :: proc(buf: ^strings.Builder, id: typeid, n_written: ^int = nil) -> (n: int, err: io.Error) {
+	return write_type_writer(strings.to_writer(buf), type_info_of(id))
 }
-write_typeid_writer :: proc(writer: io.Writer, id: typeid) {
-	write_type(writer, type_info_of(id))
+write_typeid_writer :: proc(writer: io.Writer, id: typeid, n_written: ^int = nil) -> (n: int, err: io.Error) {
+	return write_type_writer(writer, type_info_of(id), n_written)
 }
 
 write_typeid :: proc{

Some files were not shown because too many files changed in this diff