fuzzball-muck / fuzzball

Ongoing development of the Fuzzball MUCK server software and associated functionality.
Other
47 stars 27 forks source link

Move away from using convenience globals in primitive logic. #563

Closed wyld-sw closed 7 months ago

wyld-sw commented 4 years ago

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 7 months ago

This isn't done? I still see these all over the place, for ex. in p_db.c ?

wyld-sw commented 7 months ago

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.