Change uses for parapoly records to use $ always

This commit is contained in:
gingerBill
2021-06-14 11:43:35 +01:00
parent d4df325e0a
commit 3e7aabe6d8
13 changed files with 20 additions and 19 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ package container
import "core:mem"
import "core:runtime"
Array :: struct(T: typeid) {
Array :: struct($T: typeid) {
data: ^T,
len: int,
cap: int,
+2 -2
View File
@@ -4,12 +4,12 @@ import "intrinsics"
_ :: intrinsics;
Map :: struct(Key, Value: typeid) where intrinsics.type_is_valid_map_key(Key) {
Map :: struct($Key, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {
hash: Array(int),
entries: Array(Map_Entry(Key, Value)),
}
Map_Entry :: struct(Key, Value: typeid) where intrinsics.type_is_valid_map_key(Key) {
Map_Entry :: struct($Key, $Value: typeid) where intrinsics.type_is_valid_map_key(Key) {
hash: uintptr,
next: int,
key: Key,
+1 -1
View File
@@ -1,6 +1,6 @@
package container
Priority_Queue :: struct(T: typeid) {
Priority_Queue :: struct($T: typeid) {
data: Array(T),
len: int,
priority: proc(item: T) -> int,
+1 -1
View File
@@ -1,6 +1,6 @@
package container
Queue :: struct(T: typeid) {
Queue :: struct($T: typeid) {
data: Array(T),
len: int,
offset: int,
+1 -1
View File
@@ -1,7 +1,7 @@
package container
Ring :: struct(T: typeid) {
Ring :: struct($T: typeid) {
next, prev: ^Ring(T),
value: T,
}
+1 -1
View File
@@ -1,6 +1,6 @@
package container
Small_Array :: struct(N: int, T: typeid) where N >= 0 {
Small_Array :: struct($N: int, $T: typeid) where N >= 0 {
data: [N]T,
len: int,
}
+1 -1
View File
@@ -6,7 +6,7 @@ import "core:strconv"
import "intrinsics"
_ :: intrinsics;
Fixed :: struct($Backing: typeid, Fraction_Width: uint)
Fixed :: struct($Backing: typeid, $Fraction_Width: uint)
where
intrinsics.type_is_integer(Backing),
0 <= Fraction_Width,
+1 -1
View File
@@ -919,7 +919,7 @@ tracking_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode,
// Small_Allocator primary allocates memory from its local buffer of size BUFFER_SIZE
// If that buffer's memory is exhausted, it will use the backing allocator (a scratch allocator is recommended)
// Memory allocated with Small_Allocator cannot be freed individually using 'free' and must be freed using 'free_all'
Small_Allocator :: struct(BUFFER_SIZE: int)
Small_Allocator :: struct($BUFFER_SIZE: int)
where
BUFFER_SIZE >= 2*size_of(uintptr),
BUFFER_SIZE & (BUFFER_SIZE-1) == 0 {
+1 -1
View File
@@ -5,7 +5,7 @@ import "core:mem"
_ :: runtime;
_ :: mem;
Map_Entry_Info :: struct(Key, Value: typeid) {
Map_Entry_Info :: struct($Key, $Value: typeid) {
hash: uintptr,
key: Key,
value: Value,
+1 -1
View File
@@ -3,7 +3,7 @@ package runtime
import "intrinsics"
@builtin
Maybe :: union(T: typeid) #maybe {T};
Maybe :: union($T: typeid) #maybe {T};
@thread_local global_default_temp_allocator_data: Default_Temp_Allocator;
+2 -2
View File
@@ -27,12 +27,12 @@ map_values :: proc(m: $M/map[$K]$V, allocator := context.allocator) -> (values:
return;
}
Map_Entry :: struct(Key, Value: typeid) {
Map_Entry :: struct($Key, $Value: typeid) {
key: Key,
value: Value,
}
Map_Entry_Info :: struct(Key, Value: typeid) {
Map_Entry_Info :: struct($Key, $Value: typeid) {
hash: uintptr,
key: Key,
value: Value,
+1 -1
View File
@@ -13,7 +13,7 @@ Channel_Direction :: enum i8 {
Recv = -1,
}
Channel :: struct(T: typeid, Direction := Channel_Direction.Both) {
Channel :: struct($T: typeid, $Direction := Channel_Direction.Both) {
using _internal: ^Raw_Channel,
}