tRemove anonymous union. - plan9port - [fork] Plan 9 from user space | |
git clone git://src.adamsgaard.dk/plan9port | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 4bda94f9bd420c0b23b4664c9ec994348aa59bfa | |
parent f6b7705a546e567179867419d71a355fb771540d | |
Author: rsc <devnull@localhost> | |
Date: Thu, 25 Mar 2004 23:15:55 +0000 | |
Remove anonymous union. | |
Diffstat: | |
M src/cmd/9sed.c | 20 ++++++++++---------- | |
1 file changed, 10 insertions(+), 10 deletions(-) | |
--- | |
diff --git a/src/cmd/9sed.c b/src/cmd/9sed.c | |
t@@ -32,7 +32,7 @@ typedef struct { | |
union { | |
long line; /* Line # */ | |
Reprog *rp; /* Compiled R.E. */ | |
- }; | |
+ } u; | |
} Addr; | |
typedef struct SEDCOM { | |
t@@ -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; | |
t@@ -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; | |
t@@ -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--; | |
t@@ -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 */ | |
t@@ -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; | |
} |