Skip to content

Instantly share code, notes, and snippets.

@stesla
Created October 22, 2008 21:28
Show Gist options
  • Select an option

  • Save stesla/18806 to your computer and use it in GitHub Desktop.

Select an option

Save stesla/18806 to your computer and use it in GitHub Desktop.
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