File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed
Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change 4040# define IGRAPH_ASSUME (expr ) /* empty */
4141#endif
4242
43+ /* IGRAPH_I_STRINGIFY(X) evaluates X and converts the result to a string. */
44+ #define IGRAPH_I_STRINGIFY_I (X ) #X
45+ #define IGRAPH_I_STRINGIFY (X ) IGRAPH_I_STRINGIFY_I(X)
46+
4347/* Include the definition of macros controlling symbol visibility */
4448#include "igraph_export.h"
4549
Original file line number Diff line number Diff line change 5252 */
5353#ifdef DBL_DIG
5454 /* Use DBL_DIG to determine the maximum precision used for %g */
55- #define STRINGIFY_HELPER (x ) #x
56- #define STRINGIFY (x ) STRINGIFY_HELPER(x)
57- #define IGRAPH_REAL_PRINTF_PRECISE_FORMAT "%." STRINGIFY(DBL_DIG) "g"
55+ #define IGRAPH_REAL_PRINTF_PRECISE_FORMAT "%." IGRAPH_I_STRINGIFY(DBL_DIG) "g"
5856#else
5957 /* Assume a precision of 15 digits for %g, which is what IEEE-754 doubles require. */
6058 #define IGRAPH_REAL_PRINTF_PRECISE_FORMAT "%.15g"
Original file line number Diff line number Diff line change 44
55/* This program benchmarks igraph_qsort() indirectly through vector_sort() */
66
7- #define STRINGIFY (x ) #x
8- #define TOSTRING (x ) STRINGIFY(x)
9-
107int main (void ) {
118 igraph_vector_int_t vec ;
129
@@ -24,7 +21,7 @@ int main(void) {
2421 for (igraph_integer_t i = 0 ; i < N ; i ++ ) {
2522 VECTOR (vec )[i ] = RNG_INTEGER (0 , N - 1 );
2623 }
27- BENCH ("Sort vector of length " TOSTRING (N ), igraph_vector_int_sort (& vec ));
24+ BENCH ("Sort vector of length " IGRAPH_I_STRINGIFY (N ), igraph_vector_int_sort (& vec ));
2825
2926#undef N
3027#define N 1000000
@@ -33,7 +30,7 @@ int main(void) {
3330 for (igraph_integer_t i = 0 ; i < N ; i ++ ) {
3431 VECTOR (vec )[i ] = RNG_INTEGER (0 , N - 1 );
3532 }
36- BENCH ("Sort vector of length " TOSTRING (N ), igraph_vector_int_sort (& vec ));
33+ BENCH ("Sort vector of length " IGRAPH_I_STRINGIFY (N ), igraph_vector_int_sort (& vec ));
3734
3835#undef N
3936#define N 100000
@@ -42,7 +39,7 @@ int main(void) {
4239 for (igraph_integer_t i = 0 ; i < N ; i ++ ) {
4340 VECTOR (vec )[i ] = RNG_INTEGER (0 , N - 1 );
4441 }
45- BENCH ("Sort vector of length " TOSTRING (N ), igraph_vector_int_sort (& vec ));
42+ BENCH ("Sort vector of length " IGRAPH_I_STRINGIFY (N ), igraph_vector_int_sort (& vec ));
4643
4744 RNG_END ();
4845
You can’t perform that action at this time.
0 commit comments