aboutsummaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-01-28 20:16:18 +0000
committerGinger Bill <bill@gingerbill.org>2017-01-28 20:16:18 +0000
commite86c990b75bb30f0116430453b42a59317e3fead (patch)
tree2645005099bd2cf744299d6a3538408ed5728d39 /code
parent31aacd5bf435224c7d8f9b19359175d3e6d25660 (diff)
Overloaded `free`; 3 dotted ellipsisv0.0.6a
Diffstat (limited to 'code')
-rw-r--r--code/demo.odin12
-rw-r--r--code/punity.odin3
2 files changed, 9 insertions, 6 deletions
diff --git a/code/demo.odin b/code/demo.odin
index a8e7b0726..5c05259b6 100644
--- a/code/demo.odin
+++ b/code/demo.odin
@@ -72,6 +72,12 @@ syntax :: proc() {
// `odin build_dll demo.odin`
+ // New vector syntax
+ v: [vector 3]f32;
+ v[0] = 123;
+ v.x = 123; // valid for all vectors with count 1 to 4
+
+
// Next part
prefixes();
}
@@ -189,14 +195,14 @@ loops :: proc() {
for i in 0..<123 { // 123 exclusive
}
- for i in 0..122 { // 122 inclusive
+ for i in 0...122 { // 122 inclusive
}
for val, idx in 12..<16 {
fmt.println(val, idx);
}
- primes := [..]int{2, 3, 5, 7, 11, 13, 17, 19};
+ primes := [...]int{2, 3, 5, 7, 11, 13, 17, 19};
for p in primes {
fmt.println(p);
@@ -224,8 +230,6 @@ loops :: proc() {
}
}
-
-
procedure_overloading();
}
diff --git a/code/punity.odin b/code/punity.odin
index d5ef3ec19..838bf2638 100644
--- a/code/punity.odin
+++ b/code/punity.odin
@@ -398,8 +398,7 @@ run :: proc(user_init, user_step: proc(c: ^Core)) {
ShowWindow(win32_window, SW_SHOW);
window_buffer := new_slice(u32, CANVAS_WIDTH * CANVAS_HEIGHT);
- assert(window_buffer.data != nil);
- defer free(window_buffer.data);
+ defer free(window_buffer);
for i := 0; i < window_buffer.count; i += 1 {