mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Merge pull request #4072 from laytan/fix-32-bit-math-round
fix type hint propagation for shift
This commit is contained in:
+1
-1
@@ -3038,7 +3038,7 @@ gb_internal void check_shift(CheckerContext *c, Operand *x, Operand *y, Ast *nod
|
|||||||
x->mode = Addressing_Value;
|
x->mode = Addressing_Value;
|
||||||
if (type_hint) {
|
if (type_hint) {
|
||||||
if (is_type_integer(type_hint)) {
|
if (is_type_integer(type_hint)) {
|
||||||
x->type = type_hint;
|
convert_to_typed(c, x, type_hint);
|
||||||
} else {
|
} else {
|
||||||
gbString x_str = expr_to_string(x->expr);
|
gbString x_str = expr_to_string(x->expr);
|
||||||
gbString to_type = type_to_string(type_hint);
|
gbString to_type = type_to_string(type_hint);
|
||||||
|
|||||||
+1
-7
@@ -65,14 +65,8 @@ ceil :: proc "c" (x: f64) -> f64 { return math.ceil(x) }
|
|||||||
sqrt :: proc "c" (x: f64) -> f64 { return math.sqrt(x) }
|
sqrt :: proc "c" (x: f64) -> f64 { return math.sqrt(x) }
|
||||||
@(require, linkage="strong", link_name="stbtt_pow")
|
@(require, linkage="strong", link_name="stbtt_pow")
|
||||||
pow :: proc "c" (x, y: f64) -> f64 { return math.pow(x, y) }
|
pow :: proc "c" (x, y: f64) -> f64 { return math.pow(x, y) }
|
||||||
|
|
||||||
@(require, linkage="strong", link_name="stbtt_fmod")
|
@(require, linkage="strong", link_name="stbtt_fmod")
|
||||||
fmod :: proc "c" (x, y: f64) -> f64 {
|
fmod :: proc "c" (x, y: f64) -> f64 { return math.mod(x, y) }
|
||||||
context = runtime.default_context()
|
|
||||||
// NOTE: only called in the `stbtt_GetGlyphSDF` code path.
|
|
||||||
panic("`math.round` is broken on 32 bit targets, see #3856")
|
|
||||||
}
|
|
||||||
|
|
||||||
@(require, linkage="strong", link_name="stbtt_cos")
|
@(require, linkage="strong", link_name="stbtt_cos")
|
||||||
cos :: proc "c" (x: f64) -> f64 { return math.cos(x) }
|
cos :: proc "c" (x: f64) -> f64 { return math.cos(x) }
|
||||||
@(require, linkage="strong", link_name="stbtt_acos")
|
@(require, linkage="strong", link_name="stbtt_acos")
|
||||||
|
|||||||
Reference in New Issue
Block a user