aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-03-25 23:15:55 +0000
committerrsc <devnull@localhost>2004-03-25 23:15:55 +0000
commit4bda94f9bd420c0b23b4664c9ec994348aa59bfa (patch)
treea724a938b55dfd8e63d8ffc2b09d4fd01b8df331 /src
parentf6b7705a546e567179867419d71a355fb771540d (diff)
downloadplan9port-4bda94f9bd420c0b23b4664c9ec994348aa59bfa.tar.gz
plan9port-4bda94f9bd420c0b23b4664c9ec994348aa59bfa.tar.bz2
plan9port-4bda94f9bd420c0b23b4664c9ec994348aa59bfa.zip
Remove anonymous union.
Diffstat (limited to 'src')
-rw-r--r--src/cmd/9sed.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/cmd/9sed.c b/src/cmd/9sed.c
index 49e78b89..597c968c 100644
--- a/src/cmd/9sed.c
+++ b/src/cmd/9sed.c
@@ -32,7 +32,7 @@ typedef struct {
union {
long line; /* Line # */
Reprog *rp; /* Compiled R.E. */
- };
+ } u;
} Addr;
typedef struct SEDCOM {
@@ -290,14 +290,14 @@ comploop:
if (!lastre)
quit("First RE may not be null", 0);
rep->ad1.type = A_RE;
- rep->ad1.rp = lastre;
+ rep->ad1.u.rp = lastre;
}
if(*cp == ',' || *cp == ';') {
cp++;
address(&rep->ad2);
if (rep->ad2.type == A_LAST) {
rep->ad1.type = A_RE;
- rep->ad2.rp = lastre;
+ rep->ad2.u.rp = lastre;
}
} else
rep->ad2.type = A_NONE;
@@ -738,7 +738,7 @@ address(Addr *ap)
ap->type = A_DOL;
else if(c == '/') {
seof = c;
- if (ap->rp = compile())
+ if (ap->u.rp = compile())
ap->type = A_RE;
else
ap->type = A_LAST;
@@ -750,7 +750,7 @@ address(Addr *ap)
if(!lno)
quit("line number 0 is illegal",0);
ap->type = A_LINE;
- ap->line = lno;
+ ap->u.line = lno;
}
else {
cp--;
@@ -943,15 +943,15 @@ executable(SedCom *ipc)
case A_DOL: /* Accept everything */
return !ipc->negfl;
case A_LINE: /* Line at end of range? */
- if (lnum <= ipc->ad2.line) {
- if (ipc->ad2.line == lnum)
+ if (lnum <= ipc->ad2.u.line) {
+ if (ipc->ad2.u.line == lnum)
ipc->active = 0;
return !ipc->negfl;
}
ipc->active = 0; /* out of range */
return ipc->negfl;
case A_RE: /* Check for matching R.E. */
- if (match(ipc->ad2.rp, linebuf))
+ if (match(ipc->ad2.u.rp, linebuf))
ipc->active = 0;
return !ipc->negfl;
default: /* internal error */
@@ -966,13 +966,13 @@ executable(SedCom *ipc)
return !ipc->negfl;
break;
case A_LINE: /* Check line number */
- if (ipc->ad1.line == lnum) {
+ if (ipc->ad1.u.line == lnum) {
ipc->active = 1; /* In range */
return !ipc->negfl;
}
break;
case A_RE: /* Check R.E. */
- if (match(ipc->ad1.rp, linebuf)) {
+ if (match(ipc->ad1.u.rp, linebuf)) {
ipc->active = 1; /* In range */
return !ipc->negfl;
}