diff --git a/platform_mac/mac_4ed.mm b/platform_mac/mac_4ed.mm index 3239cca2..6275f6d9 100644 --- a/platform_mac/mac_4ed.mm +++ b/platform_mac/mac_4ed.mm @@ -952,13 +952,13 @@ mac_toggle_fullscreen(void){ float dx = event.scrollingDeltaX; float dy = event.scrollingDeltaY; - i8 scroll_speed = 0; + i8 wheel_delta = 0; if (dy > 0){ - scroll_speed = -100; + wheel_delta = -100; } else if (dy < 0){ - scroll_speed = 100; + wheel_delta = 100; } - mac_vars.input_chunk.trans.mouse_wheel = scroll_speed; + mac_vars.input_chunk.trans.mouse_wheel = wheel_delta; system_signal_step(0); } diff --git a/platform_mac/mac_4ed_functions.mm b/platform_mac/mac_4ed_functions.mm index 85a6c0f4..dbfc11b0 100644 --- a/platform_mac/mac_4ed_functions.mm +++ b/platform_mac/mac_4ed_functions.mm @@ -29,12 +29,12 @@ system_get_path_sig(){ { local_persist b32 has_stashed_4ed_path = false; if (!has_stashed_4ed_path){ - local_const i32 binary_path_capacity = KB(32); + local_const u32 binary_path_capacity = PATH_MAX; u8 *memory = (u8*)system_memory_allocate(binary_path_capacity, file_name_line_number_lit_u8); pid_t pid = getpid(); i32 size = proc_pidpath(pid, memory, binary_path_capacity); - Assert(size <= binary_path_capacity - 1); + Assert(size < binary_path_capacity); mac_vars.binary_path = SCu8(memory, size); mac_vars.binary_path = string_remove_last_folder(mac_vars.binary_path); @@ -742,6 +742,7 @@ function void* mac_memory_allocate_extended(void *base, u64 size, String_Const_u8 location){ u64 adjusted_size = size + ALLOCATION_SIZE_ADJUSTMENT; void *memory = mmap(base, adjusted_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + Assert(memory != MAP_FAILED); Memory_Annotation_Tracker_Node *node = (Memory_Annotation_Tracker_Node*)memory;