Fix issue #31; Removed down_cast

This commit is contained in:
Ginger Bill
2017-04-04 21:54:55 +01:00
parent 382a5ca6a2
commit 3e80411d37
7 changed files with 70 additions and 75 deletions
+2 -6
View File
@@ -194,9 +194,6 @@ last_write_time_by_name :: proc(name: string) -> File_Time {
}
read_entire_file :: proc(name: string) -> ([]byte, bool) {
buf: [300]byte;
copy(buf[..], cast([]byte)name);
@@ -208,13 +205,12 @@ read_entire_file :: proc(name: string) -> ([]byte, bool) {
defer close(fd);
length: i64;
file_size_ok := win32.GetFileSizeEx(cast(win32.Handle)fd, ^length) != 0;
if !file_size_ok {
if ok := win32.GetFileSizeEx(cast(win32.Handle)fd, ^length) != 0; !ok {
return nil, false;
}
data := make([]byte, length);
if ^data[0] == nil {
if data == nil {
return nil, false;
}