rename none to null
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
mem :: import "@std/mem"
|
||||
|
||||
raw_allocator_test func() i32 {
|
||||
resized ?*mut u8 = mem.raw_realloc(mem.c_allocator, none, 0, 4, 1)
|
||||
resized ?*mut u8 = mem.raw_realloc(mem.c_allocator, null, 0, 4, 1)
|
||||
if resized |bytes| {
|
||||
bytes[0] = 10
|
||||
bytes[1] = 20
|
||||
|
||||
@@ -11,9 +11,9 @@ TaskList :: struct {
|
||||
|
||||
task_list_init func(allocator mem.Allocator) TaskList {
|
||||
return TaskList {
|
||||
ids = none,
|
||||
priorities = none,
|
||||
durations = none,
|
||||
ids = null,
|
||||
priorities = null,
|
||||
durations = null,
|
||||
len = 0,
|
||||
capacity = 0,
|
||||
allocator = allocator,
|
||||
@@ -27,7 +27,7 @@ alloc_i32s func(allocator mem.Allocator, count usize) ?[]mut i32 {
|
||||
failed = true
|
||||
yield (&fallback).ptr[..0]
|
||||
}
|
||||
if (failed) return none
|
||||
if (failed) return null
|
||||
return values
|
||||
}
|
||||
|
||||
@@ -144,9 +144,9 @@ task_list_deinit func(list @mut TaskList) void {
|
||||
free_i32s(list.allocator, list.ids)
|
||||
free_i32s(list.allocator, list.priorities)
|
||||
free_i32s(list.allocator, list.durations)
|
||||
list.ids = none
|
||||
list.priorities = none
|
||||
list.durations = none
|
||||
list.ids = null
|
||||
list.priorities = null
|
||||
list.durations = null
|
||||
list.len = 0
|
||||
list.capacity = 0
|
||||
}
|
||||
|
||||
@@ -9,12 +9,12 @@ hide probe_count func(context ?@mut anyopaque) void {
|
||||
|
||||
hide probe_alloc func(context ?@mut anyopaque, _ usize, _ usize) ?*mut u8 {
|
||||
probe_count(context)
|
||||
return none
|
||||
return null
|
||||
}
|
||||
|
||||
hide probe_realloc func(context ?@mut anyopaque, _ ?*mut u8, _ usize, _ usize, _ usize) ?*mut u8 {
|
||||
probe_count(context)
|
||||
return none
|
||||
return null
|
||||
}
|
||||
|
||||
hide probe_free func(context ?@mut anyopaque, _ ?*mut u8, _ usize, _ usize) void {
|
||||
@@ -42,8 +42,8 @@ typed_allocator_test func() i32 {
|
||||
}
|
||||
|
||||
_ = mem.raw_alloc(first_allocator, 1, 1)
|
||||
_ = mem.raw_realloc(first_allocator, none, 0, 1, 1)
|
||||
mem.raw_free(first_allocator, none, 0, 1)
|
||||
_ = mem.raw_realloc(first_allocator, null, 0, 1, 1)
|
||||
mem.raw_free(first_allocator, null, 0, 1)
|
||||
_ = mem.raw_alloc(second_allocator, 1, 1)
|
||||
if (first_calls[0] != 3 or second_calls[0] != 1) return 32
|
||||
|
||||
|
||||
Reference in New Issue
Block a user