obj->oextra->{omid,olong}
Change obj->oextra->omid from a usually-Null pointer field in oextra to a simple 'unsigned' that doesn't need any allocation beyond obj->oextra itself. Value 0 means that it is not in use; it is used to hold a monst.m_id and those are always non-zero. Delete unused obj->oextra->olong. 'olong' used to be the last field in struct obj, put there to force alignment of anything which followed it back when obj structures were over-allocated to append extra information. It had a comment about being used for temporary gold but whatever that was, temporary gold was gone long before obj->oextra got introduced. Bump EDITLEVEL since this invalidates existing 3.7 save files. Remove a bunch of tabs from obj.h and save.c.
This commit is contained in:
@@ -2295,12 +2295,9 @@ struct obj *otmp;
|
||||
sz += (int) strlen(ONAME(otmp)) + 1;
|
||||
if (OMONST(otmp))
|
||||
sz += size_monst(OMONST(otmp), FALSE);
|
||||
if (OMID(otmp))
|
||||
sz += (int) sizeof (unsigned);
|
||||
if (OLONG(otmp))
|
||||
sz += (int) sizeof (long);
|
||||
if (OMAILCMD(otmp))
|
||||
sz += (int) strlen(OMAILCMD(otmp)) + 1;
|
||||
/* sz += (int) sizeof (unsigned); -- now part of oextra itself */
|
||||
}
|
||||
return sz;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user