Added mass and remove unecesary private

This commit is contained in:
Zachary Levy
2026-07-14 13:31:33 -07:00
parent 10f90e30e2
commit 399a0c2534
6 changed files with 828 additions and 46 deletions
+7 -7
View File
@@ -7,7 +7,7 @@ Volts :: struct($V: typeid) where intrinsics.type_is_numeric(V) {
v: V,
}
@(private = "file")
// Prefer the to_milli_volts procedure group.
volts_to_milli_volts :: #force_inline proc "contextless" (
volts: Volts($V),
) -> Milli_Volts(V) where intrinsics.type_is_numeric(V) {
@@ -19,7 +19,7 @@ Milli_Volts :: struct($V: typeid) where intrinsics.type_is_numeric(V) {
v: V,
}
@(private = "file")
// Prefer the to_volts procedure group.
milli_volts_to_volts :: #force_inline proc "contextless" (
milli_volts: Milli_Volts($V),
) -> Volts(V) where intrinsics.type_is_numeric(V) {
@@ -30,11 +30,11 @@ milli_volts_to_volts :: #force_inline proc "contextless" (
// ----- Conversion Overloads ------------------------
// ---------------------------------------------------------------------------------------------------------------------
to_volts :: proc {
milli_volts_to_volts,
milli_volts_to_volts,
}
to_milli_volts :: proc {
volts_to_milli_volts,
volts_to_milli_volts,
}
// ---------------------------------------------------------------------------------------------------------------------
@@ -52,8 +52,8 @@ test_volts_to_milli_volts :: proc(t: ^testing.T) {
@(test)
test_milli_volts_to_volts :: proc(t: ^testing.T) {
milli_volts := Milli_Volts(int){1000}
volts := to_volts(milli_volts)
milli_volts := Milli_Volts(int){1000}
volts := to_volts(milli_volts)
testing.expect_value(t, volts, Volts(int){1})
testing.expect_value(t, volts, Volts(int){1})
}