mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-03 22:28:46 +00:00
Improve //+vet; remove using in many places; add //+vet !using-stmt where necessary
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
//+vet !using-stmt
|
||||
package netpbm
|
||||
|
||||
import "core:bytes"
|
||||
|
||||
@@ -80,11 +80,10 @@ time :: proc(c: image.PNG_Chunk) -> (res: tIME, ok: bool) {
|
||||
}
|
||||
|
||||
core_time :: proc(c: image.PNG_Chunk) -> (t: coretime.Time, ok: bool) {
|
||||
if png_time, png_ok := time(c); png_ok {
|
||||
using png_time
|
||||
if t, png_ok := time(c); png_ok {
|
||||
return coretime.datetime_to_time(
|
||||
int(year), int(month), int(day),
|
||||
int(hour), int(minute), int(second),
|
||||
int(t.year), int(t.month), int(t.day),
|
||||
int(t.hour), int(t.minute), int(t.second),
|
||||
)
|
||||
} else {
|
||||
return {}, false
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
// package png implements a PNG image reader
|
||||
//
|
||||
// The PNG specification is at https://www.w3.org/TR/PNG/.
|
||||
//+vet !using-stmt
|
||||
package png
|
||||
|
||||
import "core:compress"
|
||||
@@ -444,15 +445,14 @@ load_from_context :: proc(ctx: ^$C, options := Options{}, allocator := context.a
|
||||
img.width = int(header.width)
|
||||
img.height = int(header.height)
|
||||
|
||||
using header
|
||||
h := image.PNG_IHDR{
|
||||
width = width,
|
||||
height = height,
|
||||
bit_depth = bit_depth,
|
||||
color_type = color_type,
|
||||
compression_method = compression_method,
|
||||
filter_method = filter_method,
|
||||
interlace_method = interlace_method,
|
||||
width = header.width,
|
||||
height = header.height,
|
||||
bit_depth = header.bit_depth,
|
||||
color_type = header.color_type,
|
||||
compression_method = header.compression_method,
|
||||
filter_method = header.filter_method,
|
||||
interlace_method = header.interlace_method,
|
||||
}
|
||||
info.header = h
|
||||
|
||||
|
||||
Reference in New Issue
Block a user