mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-03 22:28:46 +00:00
-vet flag to do basic vetting of code
This commit is contained in:
+3
-4
@@ -843,7 +843,6 @@ fmt_bit_set :: proc(fi: ^Fmt_Info, v: any, name: string = "") {
|
||||
case runtime.Type_Info_Bit_Set:
|
||||
bits: u64;
|
||||
bit_size := u64(8*type_info.size);
|
||||
verb := 'b';
|
||||
|
||||
switch bit_size {
|
||||
case 0: bits = 0;
|
||||
@@ -886,7 +885,7 @@ fmt_bit_set :: proc(fi: ^Fmt_Info, v: any, name: string = "") {
|
||||
}
|
||||
}
|
||||
}
|
||||
fmt_bit_field :: proc(fi: ^Fmt_Info, v: any, name: string = "") {
|
||||
fmt_bit_field :: proc(fi: ^Fmt_Info, v: any, bit_field_name: string = "") {
|
||||
type_info := type_info_of(v.id);
|
||||
switch info in type_info.variant {
|
||||
case runtime.Type_Info_Named:
|
||||
@@ -902,8 +901,8 @@ fmt_bit_field :: proc(fi: ^Fmt_Info, v: any, name: string = "") {
|
||||
case 8: data = cast(u64)(^u64)(v.data)^;
|
||||
}
|
||||
|
||||
if name != "" {
|
||||
write_string(fi.buf, name);
|
||||
if bit_field_name != "" {
|
||||
write_string(fi.buf, bit_field_name);
|
||||
write_byte(fi.buf, '{');
|
||||
} else {
|
||||
write_string(fi.buf, "bit_field{");
|
||||
|
||||
+2
-2
@@ -226,9 +226,9 @@ scratch_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode,
|
||||
case Allocator_Mode.Free:
|
||||
last_ptr := rawptr(&scratch.data[scratch.prev_offset]);
|
||||
if old_memory == last_ptr {
|
||||
size := scratch.curr_offset - scratch.prev_offset;
|
||||
full_size := scratch.curr_offset - scratch.prev_offset;
|
||||
scratch.curr_offset = scratch.prev_offset;
|
||||
zero(last_ptr, size);
|
||||
zero(last_ptr, full_size);
|
||||
return nil;
|
||||
}
|
||||
// NOTE(bill): It's scratch memory, don't worry about freeing
|
||||
|
||||
Reference in New Issue
Block a user