Created
October 22, 2008 21:28
-
-
Save stesla/18806 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| static int *ir_init_temp() | |
| { | |
| static int ir_temp_ctr = 0; | |
| return &ir_temp_ctr; | |
| } | |
| int ir_make_temp() | |
| { | |
| static int *ctr = NULL; | |
| if (ctr = NULL) | |
| ctr = ir_init_temp(); | |
| return *ctr++; | |
| } | |
| void ir_reset_temp() | |
| { | |
| static int *ctr = NULL; | |
| if (ctr = NULL) | |
| ctr = ir_init_temp(); | |
| *ctr = 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment