Skip to content

Commit f90b18a

Browse files
committed
up
1 parent 9d67fda commit f90b18a

File tree

2 files changed

+45
-45
lines changed

2 files changed

+45
-45
lines changed

src/main/kotlin/glm_/vec2/Vec2l.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package glm_.vec2
22

33
import glm_.*
4-
import glm_.vec2.operators.vec2l_operators
4+
import glm_.vec2.operators.opVec2l
55
import glm_.vec3.Vec3bool
66
import glm_.vec3.Vec3t
77
import glm_.vec4.Vec4bool
@@ -126,7 +126,7 @@ class Vec2l(x: Long, y: Long) : Vec2t<Long>(x, y) {
126126
}
127127

128128

129-
companion object : vec2l_operators {
129+
companion object : opVec2l {
130130
@JvmField
131131
val length = 2
132132
@JvmField

src/main/kotlin/glm_/vec2/operators/vec2l_operators.kt renamed to src/main/kotlin/glm_/vec2/operators/opVec2l.kt

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -12,165 +12,165 @@ import glm_.vec2.Vec2l.Companion.times
1212
/**
1313
* Created by GBarbieri on 08.11.2016.
1414
*/
15-
interface vec2l_operators {
15+
open class opVec2l {
1616

17-
fun plus(res: Vec2l, a: Vec2l, bX: Int, bY: Int): Vec2l {
17+
inline fun plus(res: Vec2l, a: Vec2l, bX: Int, bY: Int): Vec2l {
1818
res.x = a.x + bX
1919
res.y = a.y + bY
2020
return res
2121
}
2222

23-
fun plus(res: Vec2l, a: Vec2l, bX: Long, bY: Long): Vec2l {
23+
inline fun plus(res: Vec2l, a: Vec2l, bX: Long, bY: Long): Vec2l {
2424
res.x = a.x + bX
2525
res.y = a.y + bY
2626
return res
2727
}
2828

29-
fun minus(res: Vec2l, a: Vec2l, bX: Int, bY: Int): Vec2l {
29+
inline fun minus(res: Vec2l, a: Vec2l, bX: Int, bY: Int): Vec2l {
3030
res.x = a.x - bX
3131
res.y = a.y - bY
3232
return res
3333
}
3434

35-
fun minus(res: Vec2l, a: Vec2l, bX: Long, bY: Long): Vec2l {
35+
inline fun minus(res: Vec2l, a: Vec2l, bX: Long, bY: Long): Vec2l {
3636
res.x = a.x - bX
3737
res.y = a.y - bY
3838
return res
3939
}
4040

41-
fun minus(res: Vec2l, aX: Int, aY: Int, b: Vec2l): Vec2l {
41+
inline fun minus(res: Vec2l, aX: Int, aY: Int, b: Vec2l): Vec2l {
4242
res.x = aX - b.x
4343
res.y = aY - b.y
4444
return res
4545
}
4646

47-
fun minus(res: Vec2l, aX: Long, aY: Long, b: Vec2l): Vec2l {
47+
inline fun minus(res: Vec2l, aX: Long, aY: Long, b: Vec2l): Vec2l {
4848
res.x = aX - b.x
4949
res.y = aY - b.y
5050
return res
5151
}
5252

53-
fun times(res: Vec2l, a: Vec2l, bX: Int, bY: Int): Vec2l {
53+
inline fun times(res: Vec2l, a: Vec2l, bX: Int, bY: Int): Vec2l {
5454
res.x = a.x * bX
5555
res.y = a.y * bY
5656
return res
5757
}
5858

59-
fun times(res: Vec2l, a: Vec2l, bX: Long, bY: Long): Vec2l {
59+
inline fun times(res: Vec2l, a: Vec2l, bX: Long, bY: Long): Vec2l {
6060
res.x = a.x * bX
6161
res.y = a.y * bY
6262
return res
6363
}
6464

65-
fun div(res: Vec2l, a: Vec2l, bX: Int, bY: Int): Vec2l {
65+
inline fun div(res: Vec2l, a: Vec2l, bX: Int, bY: Int): Vec2l {
6666
res.x = a.x / bX
6767
res.y = a.y / bY
6868
return res
6969
}
7070

71-
fun div(res: Vec2l, a: Vec2l, bX: Long, bY: Long): Vec2l {
71+
inline fun div(res: Vec2l, a: Vec2l, bX: Long, bY: Long): Vec2l {
7272
res.x = a.x / bX
7373
res.y = a.y / bY
7474
return res
7575
}
7676

77-
fun div(res: Vec2l, aX: Int, aY: Int, b: Vec2l): Vec2l {
77+
inline fun div(res: Vec2l, aX: Int, aY: Int, b: Vec2l): Vec2l {
7878
res.x = aX / b.x
7979
res.y = aY / b.y
8080
return res
8181
}
8282

83-
fun div(res: Vec2l, aX: Long, aY: Long, b: Vec2l): Vec2l {
83+
inline fun div(res: Vec2l, aX: Long, aY: Long, b: Vec2l): Vec2l {
8484
res.x = aX / b.x
8585
res.y = aY / b.y
8686
return res
8787
}
8888

89-
fun rem(res: Vec2l, a: Vec2l, bX: Int, bY: Int): Vec2l {
89+
inline fun rem(res: Vec2l, a: Vec2l, bX: Int, bY: Int): Vec2l {
9090
res.x = a.x % bX
9191
res.y = a.y % bY
9292
return res
9393
}
9494

95-
fun rem(res: Vec2l, a: Vec2l, bX: Long, bY: Long): Vec2l {
95+
inline fun rem(res: Vec2l, a: Vec2l, bX: Long, bY: Long): Vec2l {
9696
res.x = a.x % bX
9797
res.y = a.y % bY
9898
return res
9999
}
100100

101-
fun rem(res: Vec2l, aX: Int, aY: Int, b: Vec2l): Vec2l {
101+
inline fun rem(res: Vec2l, aX: Int, aY: Int, b: Vec2l): Vec2l {
102102
res.x = aX % b.x
103103
res.y = aY % b.y
104104
return res
105105
}
106106

107-
fun rem(res: Vec2l, aX: Long, aY: Long, b: Vec2l): Vec2l {
107+
inline fun rem(res: Vec2l, aX: Long, aY: Long, b: Vec2l): Vec2l {
108108
res.x = aX % b.x
109109
res.y = aY % b.y
110110
return res
111111
}
112112

113-
fun and(res: Vec2l, a: Vec2l, bX: Int, bY: Int): Vec2l {
113+
inline fun and(res: Vec2l, a: Vec2l, bX: Int, bY: Int): Vec2l {
114114
res.x = a.x and bX
115115
res.y = a.y and bY
116116
return res
117117
}
118118

119-
fun and(res: Vec2l, a: Vec2l, bX: Long, bY: Long): Vec2l {
119+
inline fun and(res: Vec2l, a: Vec2l, bX: Long, bY: Long): Vec2l {
120120
res.x = a.x and bX
121121
res.y = a.y and bY
122122
return res
123123
}
124124

125-
fun or(res: Vec2l, a: Vec2l, bX: Int, bY: Int): Vec2l {
125+
inline fun or(res: Vec2l, a: Vec2l, bX: Int, bY: Int): Vec2l {
126126
res.x = a.x or bX
127127
res.y = a.y or bY
128128
return res
129129
}
130130

131-
fun or(res: Vec2l, a: Vec2l, bX: Long, bY: Long): Vec2l {
131+
inline fun or(res: Vec2l, a: Vec2l, bX: Long, bY: Long): Vec2l {
132132
res.x = a.x or bX
133133
res.y = a.y or bY
134134
return res
135135
}
136136

137-
fun xor(res: Vec2l, a: Vec2l, bX: Int, bY: Int): Vec2l {
137+
inline fun xor(res: Vec2l, a: Vec2l, bX: Int, bY: Int): Vec2l {
138138
res.x = a.x xor bX
139139
res.y = a.y xor bY
140140
return res
141141
}
142142

143-
fun xor(res: Vec2l, a: Vec2l, bX: Long, bY: Long): Vec2l {
143+
inline fun xor(res: Vec2l, a: Vec2l, bX: Long, bY: Long): Vec2l {
144144
res.x = a.x xor bX
145145
res.y = a.y xor bY
146146
return res
147147
}
148148

149-
fun shl(res: Vec2l, a: Vec2l, bX: Long, bY: Long): Vec2l {
149+
inline fun shl(res: Vec2l, a: Vec2l, bX: Long, bY: Long): Vec2l {
150150
res.x = a.x shl bX.i
151151
res.y = a.y shl bY.i
152152
return res
153153
}
154154

155-
fun shl(res: Vec2l, a: Vec2l, bX: Int, bY: Int): Vec2l {
155+
inline fun shl(res: Vec2l, a: Vec2l, bX: Int, bY: Int): Vec2l {
156156
res.x = a.x shl bX
157157
res.y = a.y shl bY
158158
return res
159159
}
160160

161-
fun shr(res: Vec2l, a: Vec2l, bX: Long, bY: Long): Vec2l {
161+
inline fun shr(res: Vec2l, a: Vec2l, bX: Long, bY: Long): Vec2l {
162162
res.x = a.x shr bX.i
163163
res.y = a.y shr bY.i
164164
return res
165165
}
166166

167-
fun shr(res: Vec2l, a: Vec2l, bX: Int, bY: Int): Vec2l {
167+
inline fun shr(res: Vec2l, a: Vec2l, bX: Int, bY: Int): Vec2l {
168168
res.x = a.x shr bX
169169
res.y = a.y shr bY
170170
return res
171171
}
172172

173-
fun inv(res: Vec2l, a: Vec2l): Vec2l {
173+
inline fun inv(res: Vec2l, a: Vec2l): Vec2l {
174174
res.x = a.x.inv()
175175
res.y = a.y.inv()
176176
return res
@@ -182,64 +182,64 @@ interface vec2l_operators {
182182

183183
infix operator fun Long.plus(b: Vec2l) = plus(Vec2l(), b, this, this)
184184
fun Long.plus(b: Vec2l, res: Vec2l) = plus(res, b, this, this)
185-
infix fun Long.plus_(b: Vec2l) = plus(b, b, this, this)
185+
infix fun Long.plusAssign(b: Vec2l) = plus(b, b, this, this)
186186

187187
infix operator fun Long.minus(b: Vec2l) = minus(Vec2l(), this, this, b)
188188
fun Long.minus(b: Vec2l, res: Vec2l) = minus(res, b, this, this)
189-
infix fun Long.minus_(b: Vec2l) = minus(b, this, this, b)
189+
infix fun Long.minusAssign(b: Vec2l) = minus(b, this, this, b)
190190

191191
infix operator fun Long.times(b: Vec2l) = times(Vec2l(), b, this, this)
192192
fun Long.times(b: Vec2l, res: Vec2l) = times(res, b, this, this)
193-
infix fun Long.times_(b: Vec2l) = times(b, b, this, this)
193+
infix fun Long.timesAssign(b: Vec2l) = times(b, b, this, this)
194194

195195
infix operator fun Long.div(b: Vec2l) = div(Vec2l(), this, this, b)
196196
fun Long.div(b: Vec2l, res: Vec2l) = div(res, b, this, this)
197-
infix fun Long.div_(b: Vec2l) = div(b, this, this, b)
197+
infix fun Long.divAssign(b: Vec2l) = div(b, this, this, b)
198198

199199
infix operator fun Long.rem(b: Vec2l) = rem(Vec2l(), this, this, b)
200200
fun Long.rem(b: Vec2l, res: Vec2l) = rem(res, b, this, this)
201-
infix fun Long.rem_(b: Vec2l) = rem(b, this, this, b)
201+
infix fun Long.remAssign(b: Vec2l) = rem(b, this, this, b)
202202

203203

204204
infix operator fun Int.plus(b: Vec2l) = plus(Vec2l(), b, this, this)
205205
fun Int.plus(b: Vec2l, res: Vec2l) = plus(res, b, this, this)
206-
infix fun Int.plus_(b: Vec2l) = plus(b, b, this, this)
206+
infix fun Int.plusAssign(b: Vec2l) = plus(b, b, this, this)
207207

208208
infix operator fun Int.minus(b: Vec2l) = minus(Vec2l(), this, this, b)
209209
fun Int.minus(b: Vec2l, res: Vec2l) = minus(res, b, this, this)
210-
infix fun Int.minus_(b: Vec2l) = minus(b, this, this, b)
210+
infix fun Int.minusAssign(b: Vec2l) = minus(b, this, this, b)
211211

212212
infix operator fun Int.times(b: Vec2l) = times(Vec2l(), b, this, this)
213213
fun Int.times(b: Vec2l, res: Vec2l) = times(res, b, this, this)
214-
infix fun Int.times_(b: Vec2l) = times(b, b, this, this)
214+
infix fun Int.timesAssign(b: Vec2l) = times(b, b, this, this)
215215

216216
infix operator fun Int.div(b: Vec2l) = div(Vec2l(), this, this, b)
217217
fun Int.div(b: Vec2l, res: Vec2l) = div(res, b, this, this)
218-
infix fun Int.div_(b: Vec2l) = div(b, this, this, b)
218+
infix fun Int.divAssign(b: Vec2l) = div(b, this, this, b)
219219

220220
infix operator fun Int.rem(b: Vec2l) = rem(Vec2l(), this, this, b)
221221
fun Int.rem(b: Vec2l, res: Vec2l) = rem(res, b, this, this)
222-
infix fun Int.rem_(b: Vec2l) = rem(b, this, this, b)
222+
infix fun Int.remAssign(b: Vec2l) = rem(b, this, this, b)
223223

224224

225225
// -- Generic binary arithmetic operators --
226226

227227
infix operator fun Number.plus(b: Vec2l) = plus(Vec2l(), b, this.L, this.L)
228228
fun Number.plus(b: Vec2l, res: Vec2l) = plus(res, b, this.L, this.L)
229-
infix fun Number.plus_(b: Vec2l) = plus(b, b, this.L, this.L)
229+
infix fun Number.plusAssign(b: Vec2l) = plus(b, b, this.L, this.L)
230230

231231
infix operator fun Number.minus(b: Vec2l) = minus(Vec2l(), this.L, this.L, b)
232232
fun Number.minus(b: Vec2l, res: Vec2l) = minus(res, b, this.L, this.L)
233-
infix fun Number.minus_(b: Vec2l) = minus(b, this.L, this.L, b)
233+
infix fun Number.minusAssign(b: Vec2l) = minus(b, this.L, this.L, b)
234234

235235
infix operator fun Number.times(b: Vec2l) = times(Vec2l(), b, this.L, this.L)
236236
fun Number.times(b: Vec2l, res: Vec2l) = times(res, b, this.L, this.L)
237-
infix fun Number.times_(b: Vec2l) = times(b, b, this.L, this.L)
237+
infix fun Number.timesAssign(b: Vec2l) = times(b, b, this.L, this.L)
238238

239239
infix operator fun Number.div(b: Vec2l) = div(Vec2l(), this.L, this.L, b)
240240
fun Number.div(b: Vec2l, res: Vec2l) = div(res, b, this.L, this.L)
241-
infix fun Number.div_(b: Vec2l) = div(b, this.L, this.L, b)
241+
infix fun Number.divAssign(b: Vec2l) = div(b, this.L, this.L, b)
242242

243243
infix operator fun Number.rem(b: Vec2l) = rem(Vec2l(), this.L, this.L, b)
244244
fun Number.rem(b: Vec2l, res: Vec2l) = rem(res, b, this.L, this.L)
245-
infix fun Number.rem_(b: Vec2l) = rem(b, this.L, this.L, b)
245+
infix fun Number.remAssign(b: Vec2l) = rem(b, this.L, this.L, b)

0 commit comments

Comments
 (0)