use gi.invalid_obj instead of cg.zeroobj
cg.zeroobj was originally added (under its previous unprefixed name)
for providing a one-line way to zero out the fields of a struct obj.
struct obj tempobj;
tempobj = cg.zeroobj;
initfn(struct obj *otmp)
{
if (otmp)
*otmp = cg.zeroobj;
}
More recently, the address of cg.zeroobj began to be used as a return
flag to indicate some things, but the 'const struct obj zeroobj' wasn't
an ideal fit for the purpose and required a number of casts, including
casting away const.
Provide a better fitting variable (gi.invalid_obj) and eliminate a
number of casts.
This commit is contained in:
@@ -440,6 +440,8 @@ const struct instance_globals_i g_init_i = {
|
||||
UNDEFINED_PTR, /* id_map */
|
||||
/* sp_lev.c */
|
||||
FALSE, /* in_mk_themerooms */
|
||||
DUMMY, /* invalid_obj */
|
||||
|
||||
TRUE, /* havestate*/
|
||||
IVMAGIC /* i_magic to validate that structure layout has been preserved */
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user