mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Reduce number of range and slice operators #239
Replace .. and ... with : and ..
This commit is contained in:
+1
-1
@@ -37,7 +37,7 @@ read_entire_file :: proc(name: string) -> (data: []byte, success: bool) {
|
||||
delete(data);
|
||||
return nil, false;
|
||||
}
|
||||
return data[0..bytes_read], true;
|
||||
return data[0:bytes_read], true;
|
||||
}
|
||||
|
||||
write_entire_file :: proc(name: string, data: []byte, truncate := true) -> (success: bool) {
|
||||
|
||||
@@ -49,7 +49,7 @@ OS_Node_Information :: struct {
|
||||
ntype: OS_Node_Type,
|
||||
size: i64,
|
||||
|
||||
// Our additions...
|
||||
// Our additions..
|
||||
position: i64,
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ Stat :: struct {
|
||||
_reserve1,
|
||||
_reserve2,
|
||||
_reserve3: i64,
|
||||
serial_numbe: u64, // File serial number...? Maybe.
|
||||
serial_numbe: u64, // File serial number..? Maybe.
|
||||
_reserve4: i64,
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ Stat :: struct {
|
||||
blocks: i64, // Number of blocks allocated for the file
|
||||
block_size: i32, // Optimal blocksize for I/O
|
||||
flags: u32, // User-defined flags for the file
|
||||
gen_num: u32, // File generation number ...?
|
||||
gen_num: u32, // File generation number ..?
|
||||
_spare: i32, // RESERVED
|
||||
_reserve1,
|
||||
_reserve2: i64, // RESERVED
|
||||
|
||||
@@ -100,7 +100,7 @@ open :: proc(path: string, mode: int = O_RDONLY, perm: u32 = 0) -> (Handle, Errn
|
||||
}
|
||||
|
||||
buf: [300]byte;
|
||||
copy(buf[..], cast([]byte)path);
|
||||
copy(buf[:], cast([]byte)path);
|
||||
|
||||
handle := Handle(win32.create_file_a(cstring(&buf[0]), access, share_mode, sa, create_mode, win32.FILE_ATTRIBUTE_NORMAL, nil));
|
||||
if handle != INVALID_HANDLE do return handle, ERROR_NONE;
|
||||
@@ -221,7 +221,7 @@ last_write_time_by_name :: proc(name: string) -> File_Time {
|
||||
|
||||
assert(len(buf) > len(name));
|
||||
|
||||
copy(buf[..], cast([]byte)name);
|
||||
copy(buf[:], cast([]byte)name);
|
||||
|
||||
if win32.get_file_attributes_ex_a(cstring(&buf[0]), win32.GetFileExInfoStandard, &data) {
|
||||
last_write_time = data.last_write_time;
|
||||
@@ -279,7 +279,7 @@ _alloc_command_line_arguments :: proc() -> []string {
|
||||
if n > 0 {
|
||||
n -= 1;
|
||||
}
|
||||
arg_list[i] = string(buf[..n]);
|
||||
arg_list[i] = string(buf[:n]);
|
||||
}
|
||||
|
||||
return arg_list;
|
||||
|
||||
Reference in New Issue
Block a user