Move away from using convenience globals in primitive logic.
Closed this issue · 2 comments
wyld-sw commented
All p_*.c files contain global variables at the top of the file, and are used frequently for convenience throughout each. This is both not thread-safe and can make the code difficult to follow.
We should use local copies of the following variables in these files whenever possible. Other globals in these files should be reviewed, but these may be more straightforward to address:
static char buf[BUFFER_LEN];
static char *pname;
static dbref ref;
static double fresult, t1, tf1, tf2;
static int tmp, result;
static struct inst *oper1, *oper2, *oper3, *oper4, temp1, temp2;
static struct tm *time_tm;
tanabi commented
This isn't done? I still see these all over the place, for ex. in p_db.c ?
wyld-sw commented
It's now a duplicate of one that's more recent. It certainly is still in the mix, I was rushed when I closed it, sorry.