Fix naming convention

This commit is contained in:
Patrick Pelissier committed 2017-09-22 22:11:47 +02:00
1 parent 5b569e4811
commit 618c57d622
1 file changed
+6 -6
+6 -6
View File
@@ -718,11 +718,10 @@
/* Map a macro to all given arguments with one additional fixed data (non recursive version) */ /* 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) */ /* 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_MAP2(f, d, ...) M_MAP2I(M_C(M_MAP2B_, M_NARGS(__VA_ARGS__)), f, d, __VA_ARGS__)
#define M_MAP20(F,...) F (__VA_ARGS__) #define M_MAP2I(F,...) F (__VA_ARGS__)
/* Duplicate for GET_METHOD as it may be called in context where a M_MAP2 is in progress.
/* Duplicate of macros 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: 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. 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. This kind of approach seems ugly, but is in fact the fast one.
@@ -730,8 +729,9 @@
Generated by the following command: 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 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_MAP2B(f, d, ...) M_MAP2BI(M_C(M_MAP2B_, M_NARGS(__VA_ARGS__)), f, d, __VA_ARGS__)
#define M_MAP2B0(F,...) F (__VA_ARGS__) #define M_MAP2BI(F,...) F (__VA_ARGS__)
#define M_MAP2B_1(f, d, _1) f(d, _1) #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_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) #define M_MAP2B_3(f, d, _1, _2, _3) f(d, _1) f(d, _2) f(d, _3)