mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
Release calc version 2.11.0t4
This commit is contained in:
14
const.c
14
const.c
@@ -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++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user