aboutsummaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2017-07-18 18:58:41 +0100
committerGinger Bill <bill@gingerbill.org>2017-07-18 18:58:41 +0100
commit65f079ebc474f9decc7afb222630c04b4da32690 (patch)
tree789058f2ed95b8cf4433445f169435af1cc6707c /code
parentd16aa794921efd3c8e752645f3e5f922abc3aee8 (diff)
Remove `atomic`, `++`, and `--`
Diffstat (limited to 'code')
-rw-r--r--code/demo.odin44
1 files changed, 33 insertions, 11 deletions
diff --git a/code/demo.odin b/code/demo.odin
index cc3997435..9ecf20aef 100644
--- a/code/demo.odin
+++ b/code/demo.odin
@@ -1,4 +1,22 @@
-import "fmt.odin";
+import (
+ "fmt.odin";
+ "atomics.odin";
+ "bits.odin";
+ "hash.odin";
+ "math.odin";
+ "mem.odin";
+ "opengl.odin";
+ "os.odin";
+ "pool.odin";
+ "raw.odin";
+ "sort.odin";
+ "strconv.odin";
+ "strings.odin";
+ "sync.odin";
+ "types.odin";
+ "utf8.odin";
+ "utf16.odin";
+)
Table :: struct(Key, Value: type) {
Slot :: struct {
@@ -61,7 +79,7 @@ put :: proc(table: ^Table($Key, $Value), key: Key, value: Value) {
}
}
- table.count++;
+ table.count += 1;
}
slot := &table.slots[index];
@@ -95,8 +113,9 @@ find_index :: proc(table: ^Table($Key, $Value), key: Key, hash: u32) -> int {
}
}
- index++;
- if index >= cap(table.slots) do index = 0;
+ if index += 1; index >= cap(table.slots) {
+ index = 0;
+ }
}
return -1;
@@ -121,8 +140,8 @@ Vector :: struct(N: int, T: type) {
when N >= 3 do z: T;
when N >= 4 do w: T;
};
- }
- };
+
+} };
}
Vector3 :: Vector(3, f32);
@@ -137,15 +156,18 @@ add :: proc(a, b: $T/Vector) -> T {
foo1 :: proc(a: type/Vector) { fmt.println("foo1", a{}); }
// foo2 :: proc(a: type/Vector(3, f32)) {}
-foo3 :: proc(a: type/Vector(3, $T)) {fmt.println("foo3", a{}); }
+foo3 :: proc(a: type/Vector(3, $T)) { fmt.println("foo3", a{}); }
// foo4 :: proc(a: type/Vector3) {}
-
-
-
-
main :: proc() {
+ Foo :: struct {
+ a := 123;
+ b := true;
+ }
+ v1 := Foo{};
+ fmt.println(v1);
+
foo1(Vector(3, f32));
foo1(Vector3);
foo3(Vector(3, f32));