aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-03-27 20:32:36 +0100
committerGinger Bill <bill@gingerbill.org>2017-03-27 20:32:36 +0100
commita75ccb6fbc529d2fee00f9b456ca7c0c830548ee (patch)
treecbe963045fb415f9470c0a84fbdbbe6e75f350ff /core
parent188b290dd50664aa8a89955ac2ab7dbebf7a653d (diff)
v0.1.3v0.1.3
Diffstat (limited to 'core')
-rw-r--r--core/fmt.odin12
-rw-r--r--core/math.odin4
2 files changed, 7 insertions, 9 deletions
diff --git a/core/fmt.odin b/core/fmt.odin
index ae2d340e8..0f26b82fc 100644
--- a/core/fmt.odin
+++ b/core/fmt.odin
@@ -946,11 +946,9 @@ bprintf :: proc(b: ^[]byte, fmt: string, args: ..any) -> int {
// Process a "verb"
i++;
-
+ #label prefix_loop
for ; i < end; i++ {
- skip_loop := false;
- c := fmt[i];
- match c {
+ match fmt[i] {
case '+':
fi.plus = true;
case '-':
@@ -963,11 +961,7 @@ bprintf :: proc(b: ^[]byte, fmt: string, args: ..any) -> int {
case '0':
fi.zero = !fi.minus;
default:
- skip_loop = true;
- }
-
- if skip_loop {
- break;
+ break prefix_loop;
}
}
diff --git a/core/math.odin b/core/math.odin
index dc5b7ba76..6ba540ac0 100644
--- a/core/math.odin
+++ b/core/math.odin
@@ -36,6 +36,10 @@ cos :: proc(x: f64) -> f64 #foreign __llvm_core "llvm.cos.f64";
tan :: proc(x: f32) -> f32 #inline { return sin(x)/cos(x); }
tan :: proc(x: f64) -> f64 #inline { return sin(x)/cos(x); }
+pow :: proc(x, power: f32) -> f32 #foreign __llvm_core "llvm.pow.f32";
+pow :: proc(x, power: f64) -> f64 #foreign __llvm_core "llvm.pow.f64";
+
+
lerp :: proc(a, b, t: f32) -> f32 { return a*(1-t) + b*t; }
lerp :: proc(a, b, t: f64) -> f64 { return a*(1-t) + b*t; }