Fix naming convention
This commit is contained in:
1 parent
5b569e4811
commit
618c57d622
1 file changed
+6
-6
@@ -718,11 +718,10 @@
|
||||
|
||||
/* Map a macro to all given arguments with one additional fixed data (non recursive version) */
|
||||
/* Example: M_MAP2(f, data, a, b, c) ==> f(data,a) f(data,b) f(data,c) */
|
||||
#define M_MAP2(f, d, ...) M_MAP20(M_C(M_MAP2B_, M_NARGS(__VA_ARGS__)), f, d, __VA_ARGS__)
|
||||
#define M_MAP20(F,...) F (__VA_ARGS__)
|
||||
#define M_MAP2(f, d, ...) M_MAP2I(M_C(M_MAP2B_, M_NARGS(__VA_ARGS__)), f, d, __VA_ARGS__)
|
||||
#define M_MAP2I(F,...) F (__VA_ARGS__)
|
||||
|
||||
|
||||
/* Duplicate of macros for GET_METHOD as it may be called in context where a M_MAP2 is in progress.
|
||||
/* Duplicate for GET_METHOD as it may be called in context where a M_MAP2 is in progress.
|
||||
NOTE: Increase number of arguments to 52 due to the number of available methods.
|
||||
NOTE: Rewrite with another approach much more verbose but also much faster for the compiler.
|
||||
This kind of approach seems ugly, but is in fact the fast one.
|
||||
@@ -730,8 +729,9 @@
|
||||
Generated by the following command:
|
||||
for i in $(seq 1 52) ; do printf "#define M_MAP2B_%d(f, d" $i ; for j in $(seq 1 $i) ; do printf ", _%d" $j ; done ; printf ") " ; for j in $(seq 1 $i) ; do printf "f(d, _%d) " $j ; done ; printf "\n"; done
|
||||
*/
|
||||
#define M_MAP2B(f, d, ...) M_MAP2B0(M_C(M_MAP2B_, M_NARGS(__VA_ARGS__)), f, d, __VA_ARGS__)
|
||||
#define M_MAP2B0(F,...) F (__VA_ARGS__)
|
||||
#define M_MAP2B(f, d, ...) M_MAP2BI(M_C(M_MAP2B_, M_NARGS(__VA_ARGS__)), f, d, __VA_ARGS__)
|
||||
#define M_MAP2BI(F,...) F (__VA_ARGS__)
|
||||
|
||||
#define M_MAP2B_1(f, d, _1) f(d, _1)
|
||||
#define M_MAP2B_2(f, d, _1, _2) f(d, _1) f(d, _2)
|
||||
#define M_MAP2B_3(f, d, _1, _2, _3) f(d, _1) f(d, _2) f(d, _3)
|
||||
|
||||
Reference in new issue
Block a user