From 5241ed2bc2c0a0553c75b628d16d3b588cdee685 Mon Sep 17 00:00:00 2001 From: wkj Date: Sat, 3 Jul 2004 17:48:02 +0000 Subject: Placate the Sun monster. --- src/libip/eipfmt.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/libip/eipfmt.c') diff --git a/src/libip/eipfmt.c b/src/libip/eipfmt.c index 8333225a..b3fc44c7 100644 --- a/src/libip/eipfmt.c +++ b/src/libip/eipfmt.c @@ -7,6 +7,9 @@ enum Isprefix= 16, }; +// XXX: manually initialize once to placate the Sun monster +uchar prefixvals[256]; +#ifdef NOTDEF uchar prefixvals[256] = { [0x00] 0 | Isprefix, @@ -19,6 +22,7 @@ uchar prefixvals[256] = [0xFE] 7 | Isprefix, [0xFF] 8 | Isprefix, }; +#endif int eipfmt(Fmt *f) @@ -31,6 +35,22 @@ eipfmt(Fmt *f) ushort s; int i, j, n, eln, eli; + static int once = 0; // XXX: placate the Sun monster + + if(!once){ + once = 1; + memset(prefixvals, 0, sizeof(prefixvals)); + prefixvals[0x00] = 0 | Isprefix; + prefixvals[0x80] = 1 | Isprefix; + prefixvals[0xC0] = 2 | Isprefix; + prefixvals[0xE0] = 3 | Isprefix; + prefixvals[0xF0] = 4 | Isprefix; + prefixvals[0xF8] = 5 | Isprefix; + prefixvals[0xFC] = 6 | Isprefix; + prefixvals[0xFE] = 7 | Isprefix; + prefixvals[0xFF] = 8 | Isprefix; + } + switch(f->r) { case 'E': /* Ethernet address */ p = va_arg(f->args, uchar*); -- cgit v1.2.3