From 4bda94f9bd420c0b23b4664c9ec994348aa59bfa Mon Sep 17 00:00:00 2001 From: rsc Date: Thu, 25 Mar 2004 23:15:55 +0000 Subject: Remove anonymous union. --- src/cmd/9sed.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3