Starting from scratch on smaller scale, typechecking global and constant variables, compound expressions for arrays
This commit is contained in:
17
os_win32.c
17
os_win32.c
@@ -1,23 +1,6 @@
|
||||
function S32 os_main();
|
||||
const SizeU page_size = 4096;
|
||||
|
||||
function String
|
||||
os_read_file(Arena *arena, String name){
|
||||
String result = {0};
|
||||
FILE *f = fopen((char *)name.str, "rb");
|
||||
assert(f);
|
||||
fseek(f, 0, SEEK_END);
|
||||
result.len = ftell(f);
|
||||
fseek(f, 0, SEEK_SET);
|
||||
|
||||
result.str = (U8 *)arena_push_size(arena, result.len + 1);
|
||||
fread(result.str, result.len, 1, f);
|
||||
fclose(f);
|
||||
|
||||
result.str[result.len] = 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
function SizeU
|
||||
get_align_offset(SizeU size, SizeU align){
|
||||
SizeU mask = align - 1;
|
||||
|
||||
Reference in New Issue
Block a user