Change General_Error.OK to nil

This commit is contained in:
Jeroen van Rijn
2021-05-03 15:38:43 +02:00
parent ca0f36be42
commit 9a39ce6b75
8 changed files with 53 additions and 54 deletions
+2 -2
View File
@@ -23,7 +23,7 @@ main :: proc() {
img, err = png.load(file, options);
defer png.destroy(img);
if err != png.E_General.OK {
if err != nil {
fmt.printf("Trying to read PNG file %v returned %v\n", file, err);
} else {
v: png.Info;
@@ -120,7 +120,7 @@ main :: proc() {
}
}
if err == E_General.OK && .do_not_decompress_image not_in options && .info not_in options {
if err == nil && .do_not_decompress_image not_in options && .info not_in options {
if ok := write_image_as_ppm("out.ppm", img); ok {
fmt.println("Saved decoded image.");
} else {