Reduce global status constants

The constants:

	9, 9/10, 10/9, 24, 360, 400

are used by func.c only, so there were moved
from {q,z}math.{c,h} to func.c.

The constants:

	3, 4

are used by zrandom.c only, so there were moved
from {q,z}math.{c,h} to zrandom.c.
This commit is contained in:
Landon Curt Noll
2021-12-01 22:50:52 -08:00
parent bd990cef1f
commit f794b8d859
6 changed files with 27 additions and 59 deletions

14
func.c
View File

@@ -154,6 +154,20 @@ STATIC int env_pool_max = 0; /* number of env_pool elements allocated */
STATIC struct env_pool *e_pool = NULL; /* env_pool elements */
/*
* constants used for hours or degrees conversion functions
*/
STATIC HALF _nineval_[] = { 9 };
STATIC HALF _twentyfourval_[] = { 24 };
STATIC HALF _threesixtyval_[] = { 360 };
STATIC HALF _fourhundredval_[] = { 400 };
STATIC NUMBER _qtendivnine_ = { { _tenval_, 1, 0 }, { _nineval_, 1, 0 }, 1, NULL };
STATIC NUMBER _qninedivten_ = { { _nineval_, 1, 0 }, { _tenval_, 1, 0 }, 1, NULL };
STATIC NUMBER _qtwentyfour = { { _twentyfourval_, 1, 0 }, { _oneval_, 1, 0 }, 1, NULL };
STATIC NUMBER _qthreesixty = { { _threesixtyval_, 1, 0 }, { _oneval_, 1, 0 }, 1, NULL };
STATIC NUMBER _qfourhundred = { { _fourhundredval_, 1, 0 }, { _oneval_, 1, 0 }, 1, NULL };
/*
* user-defined error strings
*/