Closed Sebanisu closed 3 years ago
This should replace all the macros we found using this regex from (https://github.com/codereport/jsource/issues/60#issuecomment-769230825)
^\s*#define\s+\w+\(([^,]+)(,\w+)*\)\s+\w+\s+\1\(
There could be more if they don't match the expression.
Getting rid of the rest of the function argument macros.
#define AHDR1(f,Tz,Tx)
and#define ADECL1 AHDR1
I f(JST * RESTRICT jt,I n,Tz* z,Tx* x)
//must match VA1F, AHDR1FN
(^\|[ \t]+)(AHDR1\|ADECL1)\(([^\,]+?)\,([^\,]+?)\,([^\)]+?)\)
I $3\(JST * RESTRICT jt,I n,$4* z,$5* x\)
#define AHDR2(f,Tz,Tx,Ty)
and#define ADECL2 AHDR2
I f(I n,I m,Tx* RESTRICTI x,Ty* RESTRICTI y,Tz* RESTRICTI z,J jt)
//must match VF, AHDR2FN;
Parameter order changes from(1,2,3)
to(2,3,1)
(^\|[ \t]+)(AHDR2\|ADECL2)\(([^\,]+?)\,([^\,]+?)\,([^\,]+?)\,([^\)]+?)\)
I $3\(I n,I m,$5* RESTRICTI x,$6* RESTRICTI y,$4* RESTRICTI z,J jt\)
#define AHDRP(f,Tz,Tx)
,#define ADECLP AHDRP
,#define AHDRR(f,Tz,Tx)
,#define ADECLR AHDRR
,#define ADECLS AHDRS
,#define AHDRS(f,Tz,Tx)
I f(I d,I n,I m,Tx* RESTRICTI x,Tz* RESTRICTI z,J jt)
(1,2)
to(2,1)
(^\|[ \t]+)A(DECL[PRS]\|HDR[PRS])\(([^\,]+?)\,([^\,]+?)\,([^\)]+?)\)
I $3\(I d,I n,I m,$5* RESTRICTI x,$4* RESTRICTI z,J jt\)
#define XF1(f)
X f(J jt, X w)
(^\|[ \t]+)(XF1)\(([^\)]+?)\)
X $3\(J jt, X w\)
#define XF2(f)
X f(J jt,X a,X w)
(^\|[ \t]+)(XF2)\(([^\)]+?)\)
X $3\(J jt,X a,X w\)
#define ZF1(f)
Z f(J jt,Z v)
(^\|[ \t]+)(ZF1)\(([^\)]+?)\)
Z $3\(J jt,Z v\)
#define ZF2(f)
Z f(J jt,Z u,Z v)
(^\|[ \t]+)(ZF2)\(([^\)]+?)\)
Z $3\(J jt,Z u,Z v\)
#define NUMH(f)
B f(J jt,I n,C*s,void*vv)
(^\|[ \t]+)(NUMH)\(([^\)]+?)\)
B $3\(J jt,I n,C*s,void*vv\)
resumes https://github.com/codereport/jsource/pull/71
resolves https://github.com/codereport/jsource/issues/60