Remove while loop and readd c-style for loops i.e. all loops are just for

This commit is contained in:
Ginger Bill
2017-01-27 17:43:42 +00:00
parent 832009f33a
commit 92453369c5
11 changed files with 201 additions and 139 deletions
+2 -3
View File
@@ -75,14 +75,13 @@ allocation_header_fill :: proc(header: ^Allocation_Header, data: rawptr, size: i
header.size = size;
ptr := cast(^int)(header+1);
while i := 0; cast(rawptr)ptr < data {
for i := 0; cast(rawptr)ptr < data; i += 1 {
(ptr+i)^ = -1;
i += 1;
}
}
allocation_header :: proc(data: rawptr) -> ^Allocation_Header {
p := cast(^int)data;
while (p-1)^ == -1 {
for (p-1)^ == -1 {
p = (p-1);
}
return cast(^Allocation_Header)p-1;