"especially of late" means "more than usual right now".BTW, what means "especially of late you are not making me eager to help you or to implement items from your NXC wish list"? why am I late?
John Hansen
"especially of late" means "more than usual right now".BTW, what means "especially of late you are not making me eager to help you or to implement items from your NXC wish list"? why am I late?
Code: Select all
void MatrixUntermatrix(float A[][], float R, float S, float R_, float S_, float &B[][])
{
int r, s;
for (s = 0; s < S-1; s++)
{
for (r = 0; r < R-1; r++)
{
B[s][r] = A[s + (s >= S_)][r + (r >= R_)];
}
}
}
float MatrixDeterminanteAllgemein(float A[][], int R)
{
int r;
float U[][];
float det = 0;
if (R == 0) return 1;
else
{
for (r = 0; r < R; r++)
{
MatrixUntermatrix(A, R, R, 0, r, U);
det += (r%2 ? -1 : +1) * A[0][r] * MatrixDeterminante(U, R-1);
}
return det;
}
}
Code: Select all
#define ArrayInitExp(_aout, _val, _cnt) { \
unsigned int _cnt_eval = _cnt; \
asm { arrinit _aout, _val, _cnt_eval } \
}
Code: Select all
#define ArrayInitExpType(_type, _aout, _val, _cnt) { \
_type _val_eval = _val; \
unsigned int _cnt_eval = _cnt; \
asm { arrinit _aout, _val_eval, _cnt_eval } \
}
inline
functions don't count towards the 256 limit. Code: Select all
int arr[];
int a = 4;
int b = 5;
ArrayInitExp(arr, 42, a * b);
// arr[20];
// ArrayInitExpType(int, arr, a / 2 * 21, a * b);
#define
code in my previous post into your program.Please give an example of what you want. (The implementation.)doc-helmut wrote:The point is, passing it directly, without having to produce spaghetti (or obfuscated asm) code.
ArrayInit()
to become the compiler's job? (i.e. "direct" translation, with no #define
s) I don't see what's wrong with using #define
s. What difference does it make? NXC will never be "a real C compiler".ArrayInitExp()
code to replace the current ArrayInit()
? Would that be sufficient? I can't see any other ways of doing this. (Excluding void*
s, malloc()
, and that sort of stuff. Function overloading wouldn't work too well with multi-dimensional arrays, I believe.)Users browsing this forum: Semrush [Bot] and 6 guests