Replace err != 0 with err != nil where possible

This commit is contained in:
gingerBill
2024-08-04 14:57:25 +01:00
parent fc10b781af
commit 93fabf8628
6 changed files with 18 additions and 34 deletions
+2 -2
View File
@@ -24,7 +24,7 @@ map_file :: proc{
map_file_from_path :: proc(filename: string, flags: Map_File_Flags) -> (data: []byte, error: Map_File_Error) {
fd, err := os.open(filename, os.O_RDWR)
if err != 0 {
if err != nil {
return nil, .Open_Failure
}
defer os.close(fd)
@@ -34,7 +34,7 @@ map_file_from_path :: proc(filename: string, flags: Map_File_Flags) -> (data: []
map_file_from_file_descriptor :: proc(fd: uintptr, flags: Map_File_Flags) -> (data: []byte, error: Map_File_Error) {
size, os_err := os.file_size(os.Handle(fd))
if os_err != 0 {
if os_err != nil {
return nil, .Stat_Failure
}
if size < 0 {