devices/**/XXXdel.c, unify, rename variables
rename model, modPtr, instPtr --> inModel, model, fast rename inst --> here
This commit is contained in:
parent
ad3486e93e
commit
b7c2cf709a
|
|
@ -10,17 +10,17 @@ Author: 1987 Kanwar Jit Singh
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
ASRCdelete(GENmodel *model, IFuid name, GENinstance **kill)
|
ASRCdelete(GENmodel *inModel, IFuid name, GENinstance **kill)
|
||||||
{
|
{
|
||||||
ASRCinstance **instPtr = (ASRCinstance **) kill;
|
ASRCinstance **fast = (ASRCinstance **) kill;
|
||||||
ASRCmodel *modPtr = (ASRCmodel *) model;
|
ASRCmodel *model = (ASRCmodel *) inModel;
|
||||||
ASRCinstance **prev = NULL;
|
ASRCinstance **prev = NULL;
|
||||||
ASRCinstance *here;
|
ASRCinstance *here;
|
||||||
|
|
||||||
for (; modPtr; modPtr = modPtr->ASRCnextModel) {
|
for (; model; model = model->ASRCnextModel) {
|
||||||
prev = &(modPtr->ASRCinstances);
|
prev = &(model->ASRCinstances);
|
||||||
for (here = *prev; here; here = *prev) {
|
for (here = *prev; here; here = *prev) {
|
||||||
if (here->ASRCname == name || (instPtr && here == *instPtr)) {
|
if (here->ASRCname == name || (fast && here == *fast)) {
|
||||||
*prev = here->ASRCnextInstance;
|
*prev = here->ASRCnextInstance;
|
||||||
FREE(here);
|
FREE(here);
|
||||||
return OK;
|
return OK;
|
||||||
|
|
|
||||||
|
|
@ -20,17 +20,17 @@ NBJTdelete(GENmodel *inModel, IFuid name, GENinstance **kill)
|
||||||
NBJTmodel *model = (NBJTmodel *) inModel;
|
NBJTmodel *model = (NBJTmodel *) inModel;
|
||||||
NBJTinstance **fast = (NBJTinstance **) kill;
|
NBJTinstance **fast = (NBJTinstance **) kill;
|
||||||
NBJTinstance **prev = NULL;
|
NBJTinstance **prev = NULL;
|
||||||
NBJTinstance *inst;
|
NBJTinstance *here;
|
||||||
|
|
||||||
for (; model; model = model->NBJTnextModel) {
|
for (; model; model = model->NBJTnextModel) {
|
||||||
prev = &(model->NBJTinstances);
|
prev = &(model->NBJTinstances);
|
||||||
for (inst = *prev; inst; inst = *prev) {
|
for (here = *prev; here; here = *prev) {
|
||||||
if (inst->NBJTname == name || (fast && inst == *fast)) {
|
if (here->NBJTname == name || (fast && here == *fast)) {
|
||||||
*prev = inst->NBJTnextInstance;
|
*prev = here->NBJTnextInstance;
|
||||||
FREE(inst);
|
FREE(here);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
prev = &(inst->NBJTnextInstance);
|
prev = &(here->NBJTnextInstance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,17 +20,17 @@ NBJT2delete(GENmodel *inModel, IFuid name, GENinstance **kill)
|
||||||
NBJT2model *model = (NBJT2model *) inModel;
|
NBJT2model *model = (NBJT2model *) inModel;
|
||||||
NBJT2instance **fast = (NBJT2instance **) kill;
|
NBJT2instance **fast = (NBJT2instance **) kill;
|
||||||
NBJT2instance **prev = NULL;
|
NBJT2instance **prev = NULL;
|
||||||
NBJT2instance *inst;
|
NBJT2instance *here;
|
||||||
|
|
||||||
for (; model; model = model->NBJT2nextModel) {
|
for (; model; model = model->NBJT2nextModel) {
|
||||||
prev = &(model->NBJT2instances);
|
prev = &(model->NBJT2instances);
|
||||||
for (inst = *prev; inst; inst = *prev) {
|
for (here = *prev; here; here = *prev) {
|
||||||
if (inst->NBJT2name == name || (fast && inst == *fast)) {
|
if (here->NBJT2name == name || (fast && here == *fast)) {
|
||||||
*prev = inst->NBJT2nextInstance;
|
*prev = here->NBJT2nextInstance;
|
||||||
FREE(inst);
|
FREE(here);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
prev = &(inst->NBJT2nextInstance);
|
prev = &(here->NBJT2nextInstance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,17 +15,17 @@ NUMDdelete(GENmodel *inModel, IFuid name, GENinstance **kill)
|
||||||
NUMDmodel *model = (NUMDmodel *) inModel;
|
NUMDmodel *model = (NUMDmodel *) inModel;
|
||||||
NUMDinstance **fast = (NUMDinstance **) kill;
|
NUMDinstance **fast = (NUMDinstance **) kill;
|
||||||
NUMDinstance **prev = NULL;
|
NUMDinstance **prev = NULL;
|
||||||
NUMDinstance *inst;
|
NUMDinstance *here;
|
||||||
|
|
||||||
for (; model; model = model->NUMDnextModel) {
|
for (; model; model = model->NUMDnextModel) {
|
||||||
prev = &(model->NUMDinstances);
|
prev = &(model->NUMDinstances);
|
||||||
for (inst = *prev; inst; inst = *prev) {
|
for (here = *prev; here; here = *prev) {
|
||||||
if (inst->NUMDname == name || (fast && inst == *fast)) {
|
if (here->NUMDname == name || (fast && here == *fast)) {
|
||||||
*prev = inst->NUMDnextInstance;
|
*prev = here->NUMDnextInstance;
|
||||||
FREE(inst);
|
FREE(here);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
prev = &(inst->NUMDnextInstance);
|
prev = &(here->NUMDnextInstance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,17 +15,17 @@ NUMD2delete(GENmodel *inModel, IFuid name, GENinstance **kill)
|
||||||
NUMD2model *model = (NUMD2model *) inModel;
|
NUMD2model *model = (NUMD2model *) inModel;
|
||||||
NUMD2instance **fast = (NUMD2instance **) kill;
|
NUMD2instance **fast = (NUMD2instance **) kill;
|
||||||
NUMD2instance **prev = NULL;
|
NUMD2instance **prev = NULL;
|
||||||
NUMD2instance *inst;
|
NUMD2instance *here;
|
||||||
|
|
||||||
for (; model; model = model->NUMD2nextModel) {
|
for (; model; model = model->NUMD2nextModel) {
|
||||||
prev = &(model->NUMD2instances);
|
prev = &(model->NUMD2instances);
|
||||||
for (inst = *prev; inst; inst = *prev) {
|
for (here = *prev; here; here = *prev) {
|
||||||
if (inst->NUMD2name == name || (fast && inst == *fast)) {
|
if (here->NUMD2name == name || (fast && here == *fast)) {
|
||||||
*prev = inst->NUMD2nextInstance;
|
*prev = here->NUMD2nextInstance;
|
||||||
FREE(inst);
|
FREE(here);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
prev = &(inst->NUMD2nextInstance);
|
prev = &(here->NUMD2nextInstance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,17 +20,17 @@ NUMOSdelete(GENmodel *inModel, IFuid name, GENinstance **kill)
|
||||||
NUMOSmodel *model = (NUMOSmodel *) inModel;
|
NUMOSmodel *model = (NUMOSmodel *) inModel;
|
||||||
NUMOSinstance **fast = (NUMOSinstance **) kill;
|
NUMOSinstance **fast = (NUMOSinstance **) kill;
|
||||||
NUMOSinstance **prev = NULL;
|
NUMOSinstance **prev = NULL;
|
||||||
NUMOSinstance *inst;
|
NUMOSinstance *here;
|
||||||
|
|
||||||
for (; model; model = model->NUMOSnextModel) {
|
for (; model; model = model->NUMOSnextModel) {
|
||||||
prev = &(model->NUMOSinstances);
|
prev = &(model->NUMOSinstances);
|
||||||
for (inst = *prev; inst; inst = *prev) {
|
for (here = *prev; here; here = *prev) {
|
||||||
if (inst->NUMOSname == name || (fast && inst == *fast)) {
|
if (here->NUMOSname == name || (fast && here == *fast)) {
|
||||||
*prev = inst->NUMOSnextInstance;
|
*prev = here->NUMOSnextInstance;
|
||||||
FREE(inst);
|
FREE(here);
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
prev = &(inst->NUMOSnextInstance);
|
prev = &(here->NUMOSnextInstance);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue