1
+ module builtin
2
+
3
+ import strconv
4
+ import strings
5
+
1
6
/* =============================================================================
2
7
Copyright (c) 2019-2021 Dario Deledda. All rights reserved.
3
8
Use of this source code is governed by an MIT license
@@ -6,11 +11,6 @@ that can be found in the LICENSE file.
6
11
This file contains string interpolation V functions
7
12
=============================================================================*/
8
13
9
- module builtin
10
-
11
- import strconv
12
- import strings
13
-
14
14
// =============================================================================
15
15
// Enum format types max 0x1F => 32 types
16
16
// =============================================================================
@@ -60,35 +60,6 @@ pub fn (x StrIntpType) str() string {
60
60
}
61
61
}
62
62
63
- /*
64
- pub fn (x StrIntpType) data_str() string {
65
- match x {
66
- .si_no_str{ return "no_str" }
67
- .si_c { return "d_c" }
68
-
69
- .si_u8 { return "d_u8" }
70
- .si_i8 { return "d_i8" }
71
- .si_u16 { return "d_u16" }
72
- .si_i16 { return "d_i16" }
73
- .si_u32 { return "d_u32" }
74
- .si_i32 { return "d_i32" }
75
- .si_u64 { return "d_u64" }
76
- .si_i64 { return "d_i64" }
77
-
78
- .si_f32 { return "d_f32" }
79
- .si_f64 { return "d_f64" }
80
- .si_g32 { return "d_f32" } // g32 format use f32 data
81
- .si_g64 { return "d_f64" } // g64 format use f64 data
82
- .si_e32 { return "d_f32" } // e32 format use f32 data
83
- .si_e64 { return "d_f64" } // e64 format use f64 data
84
-
85
- .si_s { return "d_s" }
86
- .si_p { return "d_p" }
87
- .si_vp { return "d_vp" }
88
- }
89
- }
90
- */
91
-
92
63
// =============================================================================
93
64
// Union data
94
65
// =============================================================================
@@ -110,25 +81,19 @@ pub mut:
110
81
d_vp voidptr
111
82
}
112
83
113
- fn fabs64 (x f64 ) f64 {
114
- if x < 0 {
115
- return - x
116
- }
117
- return x
84
+ [inline ]
85
+ fn fabs32 (x f32 ) f32 {
86
+ return if x < 0 { - x } else { x }
118
87
}
119
88
120
- fn fabs32 (x f32 ) f32 {
121
- if x < 0 {
122
- return - x
123
- }
124
- return x
89
+ [inline ]
90
+ fn fabs64 (x f64 ) f64 {
91
+ return if x < 0 { - x } else { x }
125
92
}
126
93
94
+ [inline ]
127
95
fn abs64 (x i64 ) u64 {
128
- if x < 0 {
129
- return u64 (- x)
130
- }
131
- return u64 (x)
96
+ return if x < 0 { u64 (- x) } else { u64 (x) }
132
97
}
133
98
134
99
// =========================================
0 commit comments