lower the code upkeep for mextra and oextra pointer additions
This commit is contained in:
@@ -1038,19 +1038,23 @@ int mndx;
|
||||
}
|
||||
}
|
||||
|
||||
static const struct mextra zeromextra = { DUMMY };
|
||||
|
||||
static void
|
||||
init_mextra(mex)
|
||||
struct mextra *mex;
|
||||
{
|
||||
*mex = zeromextra;
|
||||
mex->mcorpsenm = NON_PM;
|
||||
}
|
||||
|
||||
struct mextra *
|
||||
newmextra()
|
||||
{
|
||||
struct mextra *mextra;
|
||||
|
||||
mextra = (struct mextra *) alloc(sizeof(struct mextra));
|
||||
mextra->mname = 0;
|
||||
mextra->egd = 0;
|
||||
mextra->epri = 0;
|
||||
mextra->eshk = 0;
|
||||
mextra->emin = 0;
|
||||
mextra->edog = 0;
|
||||
mextra->mcorpsenm = NON_PM;
|
||||
init_mextra(mextra);
|
||||
return mextra;
|
||||
}
|
||||
|
||||
|
||||
14
src/mkobj.c
14
src/mkobj.c
@@ -67,16 +67,22 @@ static const struct icp hellprobs[] = { { 20, WEAPON_CLASS },
|
||||
{ 8, RING_CLASS },
|
||||
{ 4, AMULET_CLASS } };
|
||||
|
||||
static const struct oextra zerooextra = { DUMMY };
|
||||
|
||||
static void
|
||||
init_oextra(oex)
|
||||
struct oextra *oex;
|
||||
{
|
||||
*oex = zerooextra;
|
||||
}
|
||||
|
||||
struct oextra *
|
||||
newoextra()
|
||||
{
|
||||
struct oextra *oextra;
|
||||
|
||||
oextra = (struct oextra *) alloc(sizeof (struct oextra));
|
||||
oextra->oname = 0;
|
||||
oextra->omonst = 0;
|
||||
oextra->omailcmd = 0;
|
||||
oextra->omid = 0;
|
||||
init_oextra(oextra);
|
||||
return oextra;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user