mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-15 18:40:39 -08:00
Converting land finish methods to specialize instfinish.
Copied from Perforce Change: 191606 ServerID: perforce.ravenbrook.com
This commit is contained in:
parent
de1f3907cc
commit
ea53ac476e
5 changed files with 17 additions and 15 deletions
|
|
@ -289,8 +289,9 @@ static Res cbsInitZoned(Land land, Arena arena, Align alignment, ArgList args)
|
|||
* See <design/land/#function.finish>.
|
||||
*/
|
||||
|
||||
static void cbsFinish(Land land)
|
||||
static void cbsFinish(Inst inst)
|
||||
{
|
||||
Land land = MustBeA(Land, inst);
|
||||
CBS cbs = MustBeA(CBS, land);
|
||||
|
||||
METER_EMIT(&cbs->treeSearch);
|
||||
|
|
@ -301,7 +302,7 @@ static void cbsFinish(Land land)
|
|||
if (cbs->ownPool)
|
||||
PoolDestroy(cbsBlockPool(cbs));
|
||||
|
||||
NextMethod(Land, CBS, finish)(land);
|
||||
NextMethod(Inst, CBS, finish)(inst);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1133,9 +1134,9 @@ static Res cbsDescribe(Land land, mps_lib_FILE *stream, Count depth)
|
|||
DEFINE_CLASS(Land, CBS, klass)
|
||||
{
|
||||
INHERIT_CLASS(klass, CBS, Land);
|
||||
klass->protocol.finish = cbsFinish;
|
||||
klass->size = sizeof(CBSStruct);
|
||||
klass->init = cbsInit;
|
||||
klass->finish = cbsFinish;
|
||||
klass->sizeMethod = cbsSize;
|
||||
klass->insert = cbsInsert;
|
||||
klass->delete = cbsDelete;
|
||||
|
|
|
|||
|
|
@ -52,11 +52,12 @@ static Res failoverInit(Land land, Arena arena, Align alignment, ArgList args)
|
|||
}
|
||||
|
||||
|
||||
static void failoverFinish(Land land)
|
||||
static void failoverFinish(Inst inst)
|
||||
{
|
||||
Land land = MustBeA(Land, inst);
|
||||
Failover fo = MustBeA(Failover, land);
|
||||
fo->sig = SigInvalid;
|
||||
NextMethod(Land, Failover, finish)(land);
|
||||
NextMethod(Inst, Failover, finish)(inst);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -272,9 +273,9 @@ static Res failoverDescribe(Land land, mps_lib_FILE *stream, Count depth)
|
|||
DEFINE_CLASS(Land, Failover, klass)
|
||||
{
|
||||
INHERIT_CLASS(klass, Failover, Land);
|
||||
klass->protocol.finish = failoverFinish;
|
||||
klass->size = sizeof(FailoverStruct);
|
||||
klass->init = failoverInit;
|
||||
klass->finish = failoverFinish;
|
||||
klass->sizeMethod = failoverSize;
|
||||
klass->insert = failoverInsert;
|
||||
klass->delete = failoverDelete;
|
||||
|
|
|
|||
|
|
@ -212,12 +212,13 @@ static Res freelistInit(Land land, Arena arena, Align alignment, ArgList args)
|
|||
}
|
||||
|
||||
|
||||
static void freelistFinish(Land land)
|
||||
static void freelistFinish(Inst inst)
|
||||
{
|
||||
Land land = MustBeA(Land, inst);
|
||||
Freelist fl = MustBeA(Freelist, land);
|
||||
fl->sig = SigInvalid;
|
||||
fl->list = freelistEND;
|
||||
NextMethod(Land, Freelist, finish)(land);
|
||||
NextMethod(Inst, Freelist, finish)(inst);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -779,9 +780,9 @@ static Res freelistDescribe(Land land, mps_lib_FILE *stream, Count depth)
|
|||
DEFINE_CLASS(Land, Freelist, klass)
|
||||
{
|
||||
INHERIT_CLASS(klass, Freelist, Land);
|
||||
klass->protocol.finish = freelistFinish;
|
||||
klass->size = sizeof(FreelistStruct);
|
||||
klass->init = freelistInit;
|
||||
klass->finish = freelistFinish;
|
||||
klass->sizeMethod = freelistSize;
|
||||
klass->insert = freelistInsert;
|
||||
klass->delete = freelistDelete;
|
||||
|
|
|
|||
|
|
@ -90,11 +90,12 @@ static Res LandAbsInit(Land land, Arena arena, Align alignment, ArgList args)
|
|||
return ResOK;
|
||||
}
|
||||
|
||||
static void LandAbsFinish(Land land)
|
||||
static void LandAbsFinish(Inst inst)
|
||||
{
|
||||
Land land = MustBeA(Land, inst);
|
||||
AVERC(Land, land);
|
||||
land->sig = SigInvalid;
|
||||
InstFinish(CouldBeA(Inst, land));
|
||||
NextMethod(Inst, Land, finish)(inst);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -183,7 +184,7 @@ void LandFinish(Land land)
|
|||
AVERC(Land, land);
|
||||
landEnter(land);
|
||||
|
||||
Method(Land, land, finish)(land);
|
||||
Method(Inst, land, finish)(MustBeA(Inst, land));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -444,7 +445,6 @@ Bool LandClassCheck(LandClass klass)
|
|||
CHECKL(InstClassCheck(&klass->protocol));
|
||||
CHECKL(klass->size >= sizeof(LandStruct));
|
||||
CHECKL(FUNCHECK(klass->init));
|
||||
CHECKL(FUNCHECK(klass->finish));
|
||||
CHECKL(FUNCHECK(klass->insert));
|
||||
CHECKL(FUNCHECK(klass->delete));
|
||||
CHECKL(FUNCHECK(klass->findFirst));
|
||||
|
|
@ -575,10 +575,10 @@ DEFINE_CLASS(Inst, LandClass, klass)
|
|||
DEFINE_CLASS(Land, Land, klass)
|
||||
{
|
||||
INHERIT_CLASS(&klass->protocol, Land, Inst);
|
||||
klass->protocol.finish = LandAbsFinish;
|
||||
klass->size = sizeof(LandStruct);
|
||||
klass->init = LandAbsInit;
|
||||
klass->sizeMethod = landNoSize;
|
||||
klass->finish = LandAbsFinish;
|
||||
klass->insert = landNoInsert;
|
||||
klass->delete = landNoDelete;
|
||||
klass->iterate = landNoIterate;
|
||||
|
|
|
|||
|
|
@ -575,7 +575,6 @@ typedef struct LandClassStruct {
|
|||
size_t size; /* size of outer structure */
|
||||
LandSizeMethod sizeMethod; /* total size of ranges in land */
|
||||
LandInitMethod init; /* initialize the land */
|
||||
LandFinishMethod finish; /* finish the land */
|
||||
LandInsertMethod insert; /* insert a range into the land */
|
||||
LandDeleteMethod delete; /* delete a range from the land */
|
||||
LandIterateMethod iterate; /* iterate over ranges in the land */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue