src/z-dice.c
static void dice_reset(dice_t *dice)
{
	int i;

	dice->b = 0;
	dice->x = 0;
	dice->y = 0;
	dice->m = 0;

	dice->ex_b = FALSE;
	dice->ex_x = FALSE;
	dice->ex_y = FALSE;
	dice->ex_m = FALSE;

	if (dice->expressions == NULL)
		return;

	for (i = 0; i < DICE_MAX_EXPRESSIONS; i++) {
		if (dice->expressions[i].name != NULL) {
			string_free((char *)dice->expressions[i].name);
			dice->expressions[i].name = NULL;
		}

		if (dice->expressions[i].expression != NULL) {
			expression_free((expression_t *)dice->expressions[i].expression);
			dice->expressions[i].expression = NULL;
		}
	}
}
/**
 * Zero out the internal state of the dice object. This will only deallocate
 * entries in the expressions table; it will not deallocate the table itself.
 */
Zero out the internal state of the dice object. This will only deallocate
entries in the expressions table; it will not deallocate the table itself.
Zero out the internal state of the dice object . This will only deallocate entries in the expressions table ; it will not deallocate the table itself .
static void dice_reset(dice_t *dice)
{
	int i;
	dice->b = 0;
	dice->x = 0;
	dice->y = 0;
	dice->m = 0;
	dice->ex_b = FALSE;
	dice->ex_x = FALSE;
	dice->ex_y = FALSE;
	dice->ex_m = FALSE;
	if (dice->expressions == NULL)
		return;
	for (i = 0; i < DICE_MAX_EXPRESSIONS; i++) {
		if (dice->expressions[i].name != NULL) {
			string_free((char *)dice->expressions[i].name);
			dice->expressions[i].name = NULL;
		}
		if (dice->expressions[i].expression != NULL) {
			expression_free((expression_t *)dice->expressions[i].expression);
			dice->expressions[i].expression = NULL;
		}
	}
}
static void dice_reset ( dice_t * dice ) { int i ; dice -> b = 0 ; dice -> x = 0 ; dice -> y = 0 ; dice -> m = 0 ; dice -> ex_b = FALSE ; dice -> ex_x = FALSE ; dice -> ex_y = FALSE ; dice -> ex_m = FALSE ; if ( dice -> expressions == NULL ) return ; for ( i = 0 ; i < DICE_MAX_EXPRESSIONS ; i ++ ) { if ( dice -> expressions [ i ] . name != NULL ) { string_free ( ( char * ) dice -> expressions [ i ] . name ) ; dice -> expressions [ i ] . name = NULL ; } if ( dice -> expressions [ i ] . expression != NULL ) { expression_free ( ( expression_t * ) dice -> expressions [ i ] . expression ) ; dice -> expressions [ i ] . expression = NULL ; } } }
Zero out the internal state of the dice object.
Zero out the internal state of the dice object .