Make core and vendor adhere to -vet, -strict-style, and -disallow-do

This commit is contained in:
gingerBill
2021-09-11 16:40:19 +01:00
parent 93593f4721
commit 344abf2cb2
48 changed files with 218 additions and 189 deletions
+8 -6
View File
@@ -182,18 +182,20 @@ FP_SUBNORMAL :: 4
@(private)
_fpclassify :: #force_inline proc(x: double) -> int {
u := transmute(uint64_t)x
e := u >> 52 & 0x7ff
if e == 0 do return FP_SUBNORMAL if (u << 1) != 0 else FP_ZERO
if e == 0x7ff do return FP_NAN if (u << 12) != 0 else FP_INFINITE
switch e := u >> 52 & 0x7ff; e {
case 0: return FP_SUBNORMAL if (u << 1) != 0 else FP_ZERO
case 0x7ff: return FP_NAN if (u << 12) != 0 else FP_INFINITE
}
return FP_NORMAL
}
@(private)
_fpclassifyf :: #force_inline proc(x: float) -> int {
u := transmute(uint32_t)x
e := u >> 23 & 0xff
if e == 0 do return FP_SUBNORMAL if (u << 1) != 0 else FP_ZERO
if e == 0xff do return FP_NAN if (u << 9) != 0 else FP_INFINITE
switch e := u >> 23 & 0xff; e {
case 0: return FP_SUBNORMAL if (u << 1) != 0 else FP_ZERO
case 0xff: return FP_NAN if (u << 9) != 0 else FP_INFINITE
}
return FP_NORMAL
}
+4 -4
View File
@@ -191,7 +191,7 @@ atomic_exchange_explicit :: #force_inline proc(object: ^$T, desired: T, order: m
// [success = acq_rel, failure = relaxed] => acqrel_failrelaxed
atomic_compare_exchange_strong :: #force_inline proc(object, expected: ^$T, desired: T) {
value, ok := intrinsics.atomic_cxchg(object, expected^, desired)
if !ok do expected^ = value
if !ok { expected^ = value }
return ok
}
@@ -236,13 +236,13 @@ atomic_compare_exchange_strong_explicit :: #force_inline proc(object, expected:
value, ok := intrinsics.atomic_cxchg_failacq(object, expected^, desired)
}
if !ok do expected^ = value
if !ok { expected^ = value }
return ok
}
atomic_compare_exchange_weak :: #force_inline proc(object, expected: ^$T, desired: T) {
value, ok := intrinsics.atomic_cxchgweak(object, expected^, desired)
if !ok do expected^ = value
if !ok { expected^ = value }
return ok
}
@@ -287,7 +287,7 @@ atomic_compare_exchange_weak_explicit :: #force_inline proc(object, expected: ^$
value, ok := intrinsics.atomic_cxchgweak_failacq(object, expected^, desired)
}
if !ok do expected^ = value
if !ok { expected^ = value }
return ok
}