Add array sizes to math functions

This commit is contained in:
2025-04-29 18:17:00 +03:00
parent 1b6c858a1b
commit 7ee69fc397
17 changed files with 810 additions and 810 deletions

View File

@@ -1,9 +1,9 @@
#include <BH/Math.h>
void BH_Vec3iAdd(const int *a,
const int *b,
int *out)
void BH_Vec3iAdd(const int a[3],
const int b[3],
int out[3])
{
out[0] = a[0] + b[0];
out[1] = a[1] + b[1];
@@ -11,9 +11,9 @@ void BH_Vec3iAdd(const int *a,
}
void BH_Vec3iSub(const int *a,
const int *b,
int *out)
void BH_Vec3iSub(const int a[3],
const int b[3],
int out[3])
{
out[0] = a[0] - b[0];
out[1] = a[1] - b[1];
@@ -21,9 +21,9 @@ void BH_Vec3iSub(const int *a,
}
void BH_Vec3iMul(const int *a,
const int *b,
int *out)
void BH_Vec3iMul(const int a[3],
const int b[3],
int out[3])
{
out[0] = a[0] * b[0];
out[1] = a[1] * b[1];
@@ -31,9 +31,9 @@ void BH_Vec3iMul(const int *a,
}
void BH_Vec3iScale(const int *a,
void BH_Vec3iScale(const int a[3],
int b,
int *out)
int out[3])
{
out[0] = a[0] * b;
out[1] = a[1] * b;
@@ -41,10 +41,10 @@ void BH_Vec3iScale(const int *a,
}
void BH_Vec3iMulAdd(const int *a,
const int *b,
const int *c,
int *out)
void BH_Vec3iMulAdd(const int a[3],
const int b[3],
const int c[3],
int out[3])
{
out[0] = a[0] * b[0] + c[0];
out[1] = a[1] * b[1] + c[1];
@@ -52,8 +52,8 @@ void BH_Vec3iMulAdd(const int *a,
}
void BH_Vec3iNegate(const int *in,
int *out)
void BH_Vec3iNegate(const int in[3],
int out[3])
{
out[0] = -in[0];
out[1] = -in[1];
@@ -61,9 +61,9 @@ void BH_Vec3iNegate(const int *in,
}
void BH_Vec3iMin(const int *a,
const int *b,
int *out)
void BH_Vec3iMin(const int a[3],
const int b[3],
int out[3])
{
if (a[0] < b[0]) out[0] = a[0]; else out[0] = b[0];
if (a[1] < b[1]) out[1] = a[1]; else out[1] = b[1];
@@ -71,9 +71,9 @@ void BH_Vec3iMin(const int *a,
}
void BH_Vec3iMax(const int *a,
const int *b,
int *out)
void BH_Vec3iMax(const int a[3],
const int b[3],
int out[3])
{
if (a[0] > b[0]) out[0] = a[0]; else out[0] = b[0];
if (a[1] > b[1]) out[1] = a[1]; else out[1] = b[1];