Clean up usage of using throughout core and vendor

This commit is contained in:
gingerBill
2023-07-31 11:46:40 +01:00
parent 0de7df9eab
commit 44ea82f845
12 changed files with 143 additions and 138 deletions
+8 -7
View File
@@ -4,13 +4,14 @@ import "core:bytes"
import "core:image"
destroy :: proc(img: ^image.Image) -> bool {
if img == nil do return false
if img == nil {
return false
}
defer free(img)
bytes.buffer_destroy(&img.pixels)
info, ok := img.metadata.(^image.Netpbm_Info)
if !ok do return false
info := img.metadata.(^image.Netpbm_Info) or_return
header_destroy(&info.header)
free(info)
@@ -19,9 +20,9 @@ destroy :: proc(img: ^image.Image) -> bool {
return true
}
header_destroy :: proc(using header: ^Header) {
if format == .P7 && tupltype != "" {
delete(tupltype)
tupltype = ""
header_destroy :: proc(header: ^Header) {
if header.format == .P7 && header.tupltype != "" {
delete(header.tupltype)
header.tupltype = ""
}
}