store(ini): some formatting and ordering
This commit is contained in:
parent
9bc22518fb
commit
8cd27274f0
@ -170,13 +170,14 @@ ini_parse_and_set_pointer_by_base_type :: proc(ptr: rawptr, str: string, type_in
|
||||
if type_info_variant.signed {
|
||||
value := strconv.parse_i128(str) or_return
|
||||
switch type_info.id {
|
||||
case int: (cast( ^int)ptr)^ = cast( int) bounded_int(value, cast(i128)min( int), cast(i128)max( int)) or_return
|
||||
case i8: (cast( ^i8)ptr)^ = cast( i8) bounded_int(value, cast(i128)min( i8), cast(i128)max( i8)) or_return
|
||||
case i16: (cast( ^i16)ptr)^ = cast( i16) bounded_int(value, cast(i128)min( i16), cast(i128)max( i16)) or_return
|
||||
case i32: (cast( ^i32)ptr)^ = cast( i32) bounded_int(value, cast(i128)min( i32), cast(i128)max( i32)) or_return
|
||||
case i64: (cast( ^i64)ptr)^ = cast( i64) bounded_int(value, cast(i128)min( i64), cast(i128)max( i64)) or_return
|
||||
case i128: (cast(^i128)ptr)^ = bounded_int(value, min(i128), max(i128)) or_return
|
||||
|
||||
case int: (cast(^int)ptr)^ = cast(int) bounded_int(value, cast(i128)min(int), cast(i128)max(int)) or_return
|
||||
|
||||
case i16be: (cast( ^i16be)ptr)^ = cast( i16be) bounded_int(value, cast(i128)min( i16be), cast(i128)max( i16be)) or_return
|
||||
case i32be: (cast( ^i32be)ptr)^ = cast( i32be) bounded_int(value, cast(i128)min( i32be), cast(i128)max( i32be)) or_return
|
||||
case i64be: (cast( ^i64be)ptr)^ = cast( i64be) bounded_int(value, cast(i128)min( i64be), cast(i128)max( i64be)) or_return
|
||||
@ -190,23 +191,24 @@ ini_parse_and_set_pointer_by_base_type :: proc(ptr: rawptr, str: string, type_in
|
||||
} else {
|
||||
value := strconv.parse_u128(str) or_return
|
||||
switch type_info.id {
|
||||
case uint: (cast( ^uint)ptr)^ = cast( uint) bounded_uint(value, cast(u128)max( uint)) or_return
|
||||
case u8: (cast( ^u8)ptr)^ = cast( u8) bounded_uint(value, cast(u128)max( u8)) or_return
|
||||
case u16: (cast( ^u16)ptr)^ = cast( u16) bounded_uint(value, cast(u128)max( u16)) or_return
|
||||
case u32: (cast( ^u32)ptr)^ = cast( u32) bounded_uint(value, cast(u128)max( u32)) or_return
|
||||
case u64: (cast( ^u64)ptr)^ = cast( u64) bounded_uint(value, cast(u128)max( u64)) or_return
|
||||
case u128: (cast( ^u128)ptr)^ = bounded_uint(value, max( u128)) or_return
|
||||
|
||||
case uint: (cast( ^uint)ptr)^ = cast( uint) bounded_uint(value, cast(u128)max( uint)) or_return
|
||||
case uintptr: (cast(^uintptr)ptr)^ = cast(uintptr) bounded_uint(value, cast(u128)max(uintptr)) or_return
|
||||
|
||||
case u16be: (cast( ^u16be)ptr)^ = cast( u16be) bounded_uint(value, cast(u128)max( u16be)) or_return
|
||||
case u32be: (cast( ^u32be)ptr)^ = cast( u32be) bounded_uint(value, cast(u128)max( u32be)) or_return
|
||||
case u64be: (cast( ^u64be)ptr)^ = cast( u64be) bounded_uint(value, cast(u128)max( u64be)) or_return
|
||||
case u128be: (cast(^u128be)ptr)^ = cast(u128be) bounded_uint(value, cast(u128)max(u128be)) or_return
|
||||
case u16be: (cast( ^u16be)ptr)^ = cast( u16be) bounded_uint(value, cast(u128)max( u16be)) or_return
|
||||
case u32be: (cast( ^u32be)ptr)^ = cast( u32be) bounded_uint(value, cast(u128)max( u32be)) or_return
|
||||
case u64be: (cast( ^u64be)ptr)^ = cast( u64be) bounded_uint(value, cast(u128)max( u64be)) or_return
|
||||
case u128be: (cast(^u128be)ptr)^ = cast(u128be) bounded_uint(value, cast(u128)max(u128be)) or_return
|
||||
|
||||
case u16le: (cast( ^u16le)ptr)^ = cast( u16le) bounded_uint(value, cast(u128)max( u16le)) or_return
|
||||
case u32le: (cast( ^u32le)ptr)^ = cast( u32le) bounded_uint(value, cast(u128)max( u32le)) or_return
|
||||
case u64le: (cast( ^u64le)ptr)^ = cast( u64le) bounded_uint(value, cast(u128)max( u64le)) or_return
|
||||
case u128le: (cast(^u128le)ptr)^ = cast(u128le) bounded_uint(value, cast(u128)max(u128le)) or_return
|
||||
case u16le: (cast( ^u16le)ptr)^ = cast( u16le) bounded_uint(value, cast(u128)max( u16le)) or_return
|
||||
case u32le: (cast( ^u32le)ptr)^ = cast( u32le) bounded_uint(value, cast(u128)max( u32le)) or_return
|
||||
case u64le: (cast( ^u64le)ptr)^ = cast( u64le) bounded_uint(value, cast(u128)max( u64le)) or_return
|
||||
case u128le: (cast(^u128le)ptr)^ = cast(u128le) bounded_uint(value, cast(u128)max(u128le)) or_return
|
||||
}
|
||||
}
|
||||
case runtime.Type_Info_String:
|
||||
|
Loading…
x
Reference in New Issue
Block a user