Cleanup use of macro inspection to use @typekind and @typeid macros.

This commit is contained in:
Christoffer Lerno
2023-11-18 23:35:11 +01:00
parent 87fdb5956e
commit d5281b10dd
13 changed files with 30 additions and 29 deletions

View File

@@ -156,7 +156,7 @@ macro atan2(x, y)
**/
macro sincos(x, y)
{
$if $typeof(y[0]).typeid == float.typeid:
$if @typeid(y[0]) == float.typeid:
return _sincosf(x, y);
$else
return _sincos(x, y);
@@ -168,7 +168,7 @@ macro sincos(x, y)
**/
macro atan(x)
{
$if $typeof(x).typeid == float.typeid:
$if @typeid(x) == float.typeid:
return _atanf(x);
$else
return _atan(x);
@@ -180,7 +180,7 @@ macro atan(x)
**/
macro atanh(x)
{
$if $typeof(x).typeid == float.typeid:
$if @typeid(x) == float.typeid:
return _atanhf(x);
$else
return _atanh(x);
@@ -192,7 +192,7 @@ macro atanh(x)
**/
macro acos(x)
{
$if $typeof(x).typeid == float.typeid:
$if @typeid(x) == float.typeid:
return _acosf(x);
$else
return _acos(x);
@@ -204,7 +204,7 @@ macro acos(x)
**/
macro acosh(x)
{
$if $typeof(x).typeid == float.typeid:
$if @typeid(x) == float.typeid:
return _acoshf(x);
$else
return _acosh(x);
@@ -216,7 +216,7 @@ macro acosh(x)
**/
macro asin(x)
{
$if $typeof(x).typeid == float.typeid:
$if @typeid(x) == float.typeid:
return _asinf(x);
$else
return _asin(x);
@@ -228,7 +228,7 @@ macro asin(x)
**/
macro asinh(x)
{
$if $typeof(x).typeid == float.typeid:
$if @typeid(x) == float.typeid:
return _asinhf(x);
$else
return _asinh(x);

View File

@@ -244,13 +244,13 @@ macro double __math_oflow(ulong sign) => __math_xflow(sign, 0x1p-767);
macro __math_xflow(sign, v)
{
$typeof(v) temp;
$typeof(v) temp @noinit;
@volatile_store(temp, (sign ? -v : v) * v);
return temp;
}
macro force_eval_add(x, v)
{
$typeof(x) temp;
$typeof(x) temp @noinit;
@volatile_store(temp, x + v);
}

View File

@@ -217,7 +217,7 @@ return v;
var view_proj = m1.mul(m2);
var invert = view_proj.invert();
// Create quaternion from source point
$if $typeof(v[0]).typeid == float.typeid:
$if @typeid(v[0]) == float.typeid:
Quaternionf quat = { v.x, v.y, v.z, 1 };
$else
Quaternion quat = { v.x, v.y, v.z, 1 };

View File

@@ -69,7 +69,7 @@ fn void seeder(char[] input, char[] out_buffer)
macro uint hash(value) @local
{
return fnv32a::encode(&&bitcast(value, char[$typeof(value).sizeof]));
return fnv32a::encode(&&bitcast(value, char[$sizeof(value)]));
}
fn char[8 * 4] entropy()