#include <math.h>
#include "states.h"
Go to the source code of this file.
Define Documentation
#define free_hash_table |
( |
|
table | ) |
memfree(table) |
Typedef Documentation
Function Documentation
Definition at line 50 of file closed.cpp.
{
int x;
int i = 0;
int table_limit = TABLE_SIZE;
x = state->part2 % table_limit;
while (i < table_limit) {
assert (0 <= x && x < table_limit);
if ((state_table[x].part2 == state->part2) &&
(state_table[x].part1 == state->part1)) {
return (FALSE);
}
else if (state_table[x].part1 == NO_STATE) {
state_table[x].part2 = state->part2;
state_table[x].part1 = state->part1;
return (TRUE);
}
i++;
if (++x >= table_limit)
x = 0;
}
cprintf("warning: hash table is full");
abort();
return 0;
}
Definition at line 86 of file closed.cpp.
{
int x;
int i = 0;
int table_limit = TABLE_SIZE;
x = state->part2 % table_limit;
while (i < table_limit) {
assert (0 <= x && x < table_limit);
if ((state_table[x].part2 == state->part2) &&
(state_table[x].part1 == state->part1)) {
return (TRUE);
}
else if (state_table[x].part1 == NO_STATE) {
return (FALSE);
}
i++;
if (++x >= table_limit)
x = 0;
}
cprintf ("warning: fell off end of hash table (%x) %x\n",
state->part2, state->part2 % table_limit);
abort();
return 0;
}