mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Cleanup use of macro inspection to use @typekind and @typeid macros.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -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 };
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user