Remove anonymous union.
This commit is contained in:
parent
f6b7705a54
commit
4bda94f9bd
1 changed files with 10 additions and 10 deletions
|
|
@ -32,7 +32,7 @@ typedef struct {
|
||||||
union {
|
union {
|
||||||
long line; /* Line # */
|
long line; /* Line # */
|
||||||
Reprog *rp; /* Compiled R.E. */
|
Reprog *rp; /* Compiled R.E. */
|
||||||
};
|
} u;
|
||||||
} Addr;
|
} Addr;
|
||||||
|
|
||||||
typedef struct SEDCOM {
|
typedef struct SEDCOM {
|
||||||
|
|
@ -290,14 +290,14 @@ comploop:
|
||||||
if (!lastre)
|
if (!lastre)
|
||||||
quit("First RE may not be null", 0);
|
quit("First RE may not be null", 0);
|
||||||
rep->ad1.type = A_RE;
|
rep->ad1.type = A_RE;
|
||||||
rep->ad1.rp = lastre;
|
rep->ad1.u.rp = lastre;
|
||||||
}
|
}
|
||||||
if(*cp == ',' || *cp == ';') {
|
if(*cp == ',' || *cp == ';') {
|
||||||
cp++;
|
cp++;
|
||||||
address(&rep->ad2);
|
address(&rep->ad2);
|
||||||
if (rep->ad2.type == A_LAST) {
|
if (rep->ad2.type == A_LAST) {
|
||||||
rep->ad1.type = A_RE;
|
rep->ad1.type = A_RE;
|
||||||
rep->ad2.rp = lastre;
|
rep->ad2.u.rp = lastre;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
rep->ad2.type = A_NONE;
|
rep->ad2.type = A_NONE;
|
||||||
|
|
@ -738,7 +738,7 @@ address(Addr *ap)
|
||||||
ap->type = A_DOL;
|
ap->type = A_DOL;
|
||||||
else if(c == '/') {
|
else if(c == '/') {
|
||||||
seof = c;
|
seof = c;
|
||||||
if (ap->rp = compile())
|
if (ap->u.rp = compile())
|
||||||
ap->type = A_RE;
|
ap->type = A_RE;
|
||||||
else
|
else
|
||||||
ap->type = A_LAST;
|
ap->type = A_LAST;
|
||||||
|
|
@ -750,7 +750,7 @@ address(Addr *ap)
|
||||||
if(!lno)
|
if(!lno)
|
||||||
quit("line number 0 is illegal",0);
|
quit("line number 0 is illegal",0);
|
||||||
ap->type = A_LINE;
|
ap->type = A_LINE;
|
||||||
ap->line = lno;
|
ap->u.line = lno;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
cp--;
|
cp--;
|
||||||
|
|
@ -943,15 +943,15 @@ executable(SedCom *ipc)
|
||||||
case A_DOL: /* Accept everything */
|
case A_DOL: /* Accept everything */
|
||||||
return !ipc->negfl;
|
return !ipc->negfl;
|
||||||
case A_LINE: /* Line at end of range? */
|
case A_LINE: /* Line at end of range? */
|
||||||
if (lnum <= ipc->ad2.line) {
|
if (lnum <= ipc->ad2.u.line) {
|
||||||
if (ipc->ad2.line == lnum)
|
if (ipc->ad2.u.line == lnum)
|
||||||
ipc->active = 0;
|
ipc->active = 0;
|
||||||
return !ipc->negfl;
|
return !ipc->negfl;
|
||||||
}
|
}
|
||||||
ipc->active = 0; /* out of range */
|
ipc->active = 0; /* out of range */
|
||||||
return ipc->negfl;
|
return ipc->negfl;
|
||||||
case A_RE: /* Check for matching R.E. */
|
case A_RE: /* Check for matching R.E. */
|
||||||
if (match(ipc->ad2.rp, linebuf))
|
if (match(ipc->ad2.u.rp, linebuf))
|
||||||
ipc->active = 0;
|
ipc->active = 0;
|
||||||
return !ipc->negfl;
|
return !ipc->negfl;
|
||||||
default: /* internal error */
|
default: /* internal error */
|
||||||
|
|
@ -966,13 +966,13 @@ executable(SedCom *ipc)
|
||||||
return !ipc->negfl;
|
return !ipc->negfl;
|
||||||
break;
|
break;
|
||||||
case A_LINE: /* Check line number */
|
case A_LINE: /* Check line number */
|
||||||
if (ipc->ad1.line == lnum) {
|
if (ipc->ad1.u.line == lnum) {
|
||||||
ipc->active = 1; /* In range */
|
ipc->active = 1; /* In range */
|
||||||
return !ipc->negfl;
|
return !ipc->negfl;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case A_RE: /* Check R.E. */
|
case A_RE: /* Check R.E. */
|
||||||
if (match(ipc->ad1.rp, linebuf)) {
|
if (match(ipc->ad1.u.rp, linebuf)) {
|
||||||
ipc->active = 1; /* In range */
|
ipc->active = 1; /* In range */
|
||||||
return !ipc->negfl;
|
return !ipc->negfl;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue