mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Change General_Error.OK to nil
This commit is contained in:
@@ -35,7 +35,7 @@ main :: proc() {
|
||||
if len(args) < 2 {
|
||||
stderr("No input file specified.\n");
|
||||
err := gzip.load(TEST, &buf);
|
||||
if err != E_General.OK {
|
||||
if err != nil {
|
||||
stdout("Displaying test vector: ");
|
||||
stdout(bytes.buffer_to_string(&buf));
|
||||
stdout("\n");
|
||||
@@ -54,7 +54,7 @@ main :: proc() {
|
||||
} else {
|
||||
err = gzip.load(file, &buf);
|
||||
}
|
||||
if err != gzip.E_General.OK {
|
||||
if err != nil {
|
||||
if err != E_General.File_Not_Found {
|
||||
stderr("File not found: ");
|
||||
stderr(file);
|
||||
|
||||
@@ -277,7 +277,7 @@ load_from_stream :: proc(stream: io.Stream, buf: ^bytes.Buffer, allocator := con
|
||||
|
||||
// fmt.printf("ZLIB returned: %v\n", zlib_error);
|
||||
|
||||
if zlib_error != E_General.OK || zlib_error == nil {
|
||||
if zlib_error != nil {
|
||||
return zlib_error;
|
||||
}
|
||||
|
||||
@@ -307,7 +307,7 @@ load_from_stream :: proc(stream: io.Stream, buf: ^bytes.Buffer, allocator := con
|
||||
if len(payload) != payload_len {
|
||||
return E_GZIP.Payload_Length_Invalid;
|
||||
}
|
||||
return E_General.OK;
|
||||
return nil;
|
||||
}
|
||||
|
||||
load :: proc{load_from_file, load_from_slice, load_from_stream};
|
||||
|
||||
Reference in New Issue
Block a user