Closed Sebanisu closed 3 years ago
If you can do this via regex I will merge it. I think replacing A & J will have to happen gradually.
The following regex can be used to find this kind of definitions, there seems to be total of 30 different.
grep -rE '^\s*#define\s+\w+\(([^,]+)(,\w+)*\)\s+\w+\s+\1\(' jsrc/
When I did a replace all the code wouldn't compile anymore. So I'm taking it slow one line at a time. Though I was thinking notepad++ might work better at searching. Clion caps searches at 100 results. Or I could spend an afternoon setting up vscode.
Update: Notepad++ is doing a great job at regex_replace for all the files in jsrc. :) I've removed F1 and F2. Waiting for tests to run before I goto the next macro.
Maybe it's better to keep these? Till after we replace
A
andJ
names? It bothered me because I was looking for a function definition and it was hidden in a macro.Known such macros: (using @juntuu's grep)
#define FMTF(f,T)
#define DF1(f)
#define DF2(f)
#define F1(f)
#define F2(f)
#define KF1(f)
#define KF1F(f)
#define KF2(f)
#define TACT(f)
#define F1X(f)
#define DF1X(f)
#define F2X(f)
#define AHDR1(f,Tz,Tx)
#define ADECL1 AHDR1
#define AHDR2(f,Tz,Tx,Ty)
#define ADECL2 AHDR2
#define AHDRP(f,Tz,Tx)
#define ADECLP AHDRP
#define AHDRR(f,Tz,Tx)
#define ADECLR AHDRR
#define AHDRS(f,Tz,Tx)
#define ADECLS AHDRS
#define GF(f)
#define CF(f)
#define SF(f)
#define IOF(f)
#define IOCOLF(f)
#define REPF(f)
#define QF1(f)
#define QF2(f)
#define XF1(f)
#define XF2(f)
#define ZF1(f)
#define ZF2(f)
#define NUMH(f)
Example from j.h:
In
j.h
there are many of these wrapper macros. They take the name of a function and generate functions with the all same arguments. I'm currently experimenting on a branch of removingF1
. I'm using a Regex replace:to: