Release calc version 2.11.0t4

This commit is contained in:
Landon Curt Noll
1999-09-30 02:01:00 -07:00
parent 1ce630ac19
commit 97e9429000
23 changed files with 225 additions and 106 deletions

14
const.c
View File

@@ -27,10 +27,11 @@ initconstants(void)
math_error("Unable to allocate constant table");
/*NOTREACHED*/
}
for (i = 0; i < 8; i++)
for (i = 0; i < INITCONSTCOUNT; i++)
consttable[i] = initnumbs[i];
constcount = 8;
constavail = CONSTALLOCSIZE - 8;
consttable[INITCONSTCOUNT] = NULL; /* firewall */
constcount = INITCONSTCOUNT;
constavail = CONSTALLOCSIZE - INITCONSTCOUNT;
}
@@ -187,10 +188,9 @@ freeconstant(unsigned long index)
void
trimconstants(void)
{
NUMBER **qp;
qp = &consttable[constcount];
while (constcount > 0 && (*--qp)->links == 0) {
while (constcount > 0 &&
(consttable[constcount-1] == NULL ||
consttable[constcount-1]->links == 0)) {
constcount--;
constavail++;
}