Created
December 12, 2014 21:58
-
-
Save zao/6301202690a820912f3c to your computer and use it in GitHub Desktop.
table building hack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define MAKE_TABLE \ | |
BUILD_TABLE_ENTRY(50, 1) \ | |
BUILD_TABLE_ENTRY(100, 2) \ | |
BUILD_TABLE_ENTRY(250, 5) \ | |
BUILD_TABLE_ENTRY(500, 10) \ | |
BUILD_TABLE_ENTRY(1500, 30) \ | |
BUILD_TABLE_ENTRY(3000, 1*60) \ | |
BUILD_TABLE_ENTRY(6000, 2*60) \ | |
BUILD_TABLE_ENTRY(15000, 5*60) \ | |
BUILD_TABLE_ENTRY(30000, 10*60) \ | |
BUILD_TABLE_ENTRY(90000, 30*60) | |
#define BUILD_TABLE_ENTRY(Duration, Skip) (Duration), | |
int64_t skip_durations[] = { | |
MAKE_TABLE | |
}; | |
#undef BUILD_TABLE_ENTRY | |
#define BUILD_TABLE_ENTRY(Duration, Skip) (Skip), | |
double skip_amount[] = { | |
MAKE_TABLE | |
}; | |
#undef BUILD_TABLE_ENTRY | |
#define BUILD_TABLE_ENTRY(Duration, Skip) 1+ | |
size_t num_entries = MAKE_TABLE 0; | |
#undef BUILD_TABLE_ENTRY | |
#undef MAKE_TABLE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment