tPlacate the Sun monster. - plan9port - [fork] Plan 9 from user space
 (HTM) git clone git://src.adamsgaard.dk/plan9port
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 5241ed2bc2c0a0553c75b628d16d3b588cdee685
 (DIR) parent 13afc7e57c2dd8001f23a8875719d57db2a8633c
 (HTM) Author: wkj <devnull@localhost>
       Date:   Sat,  3 Jul 2004 17:48:02 +0000
       
       Placate the Sun monster.
       
       Diffstat:
         M src/cmd/9660/dump9660.c             |       8 ++++----
         M src/cmd/9660/unix.c                 |       2 +-
         M src/cmd/9term/SunOS.c               |       2 +-
         M src/libip/eipfmt.c                  |      20 ++++++++++++++++++++
       
       4 files changed, 26 insertions(+), 6 deletions(-)
       ---
 (DIR) diff --git a/src/cmd/9660/dump9660.c b/src/cmd/9660/dump9660.c
       t@@ -201,7 +201,7 @@ main(int argc, char **argv)
                        checknames(&iroot, isbadiso9660);
                        convertnames(&iroot, struprcpy);
                } else
       -                convertnames(&iroot, (void *) strcpy);
       +                convertnames(&iroot, (char* (*)(char*, char*))strcpy);
        
        //        isoabstract = findconform(&iroot, abstract);
        //        isobiblio = findconform(&iroot, biblio);
       t@@ -215,7 +215,7 @@ main(int argc, char **argv)
                //        jnotice = findconform(&jroot, notice);
        
                        checknames(&jroot, isbadjoliet);
       -                convertnames(&jroot, (void *) strcpy);
       +                convertnames(&jroot, (char* (*)(char*, char*))strcpy);
                        dsort(&jroot, jolietcmp);
                }
        
       t@@ -301,14 +301,14 @@ Dofix:
                         * Write dump tree at end.  We assume the name characters
                         * are all conforming, so everything is already sorted properly.
                         */
       -                convertnames(&idumproot, (info.flags & CDconform) ? (void *) struprcpy : (void *) strcpy);
       +                convertnames(&idumproot, (info.flags & CDconform) ? struprcpy : (char* (*)(char*, char*)) strcpy);
                        if(cd->nulldump) {
                                r = walkdirec(&idumproot, dumpname);
                                assert(r != nil);
                                copybutname(r, &iroot);
                        }
                        if(cd->flags & CDjoliet) {
       -                        convertnames(&jdumproot, (void *) strcpy);
       +                        convertnames(&jdumproot, (char* (*)(char*, char*))strcpy);
                                if(cd->nulldump) {
                                        r = walkdirec(&jdumproot, dumpname);
                                        assert(r != nil);
 (DIR) diff --git a/src/cmd/9660/unix.c b/src/cmd/9660/unix.c
       t@@ -41,7 +41,7 @@ dirtoxdir(XDir *xd, Dir *d)
                        //xd->symlink = atom(d->symlink);
                        xd->symlink = atom("symlink");                // XXX: rsc
                }
       -};
       +}
        
        void
        fdtruncate(int fd, ulong size)
 (DIR) diff --git a/src/cmd/9term/SunOS.c b/src/cmd/9term/SunOS.c
       t@@ -67,7 +67,7 @@ isecho(int fd)
                if(debug) fprint(2, "israw %c%c\n",
                        ttmode.c_lflag&ICANON ? 'c' : '-',
                        ttmode.c_lflag&ECHO ? 'e' : '-');
       -        return (ttmode.c_lflag&(ICANON|ECHO));
       +        return (ttmode.c_lflag&ICANON && ttmode.c_lflags&ECHO);
        }
        
        int
 (DIR) diff --git a/src/libip/eipfmt.c b/src/libip/eipfmt.c
       t@@ -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,
       t@@ -19,6 +22,7 @@ uchar prefixvals[256] =
        [0xFE] 7 | Isprefix,
        [0xFF] 8 | Isprefix,
        };
       +#endif
        
        int
        eipfmt(Fmt *f)
       t@@ -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*);