Annotation of researchv9/cmd/sun/pcc/flags2.c, revision 1.1

1.1     ! root        1: #ifndef lint
        !             2: static char sccsid[] = "@(#)flags2.c 1.1 86/02/03 Copyr 1985 Sun Micro";
        !             3: #endif
        !             4: 
        !             5: /*
        !             6:  * Copyright (c) 1985 by Sun Microsystems, Inc.
        !             7:  */
        !             8: 
        !             9: #include "cpass2.h"
        !            10: 
        !            11: /*
        !            12:  * process pass 2 flags from ccom/f1 command line
        !            13:  */
        !            14: 
        !            15: int use68020 = 0;
        !            16: int use68881 = 0;
        !            17: int usesky = 0;
        !            18: int usesoft = 0;
        !            19: int useswitch = 0;
        !            20: int usefpa = 0;
        !            21: int stmtprofflag = 0;
        !            22: FILE *dotd_fp;
        !            23: 
        !            24: struct machopts {
        !            25:     char *optname;
        !            26:     int *useflag;
        !            27: } machopts[] = {
        !            28:     "m68020",  &use68020,
        !            29:     "fpa",     &usefpa,
        !            30:     "f68881",  &use68881,
        !            31:     "fsky",    &usesky,
        !            32:     "fsoft",   &usesoft,
        !            33:     "fswitch", &useswitch,
        !            34: };
        !            35: 
        !            36: int chk_ovfl = 0;
        !            37: 
        !            38: myflags( c, cpp )
        !            39:     char c; 
        !            40:     register char **cpp;
        !            41: {
        !            42:        register struct machopts *fp;
        !            43:        register char *cp;
        !            44: 
        !            45:        switch( c ) {
        !            46:        case 'A':
        !            47:                cp = *cpp;
        !            48:                stmtprofflag = 1;
        !            49:                if((dotd_fp = fopen(cp+1, "w")) == NULL){
        !            50:                        perror(cp+1);
        !            51:                        cerror( "can't open statement profiling statistics file");
        !            52:                }
        !            53:                goto endswitch;
        !            54: 
        !            55:        case 'f':       
        !            56:        case 'm':
        !            57:                cp = *cpp;
        !            58:                for (fp = machopts; fp->optname; fp++) {
        !            59:                        if (!strcmp(fp->optname, cp)) {
        !            60:                                *(fp->useflag) = 1;
        !            61:                                goto endswitch;
        !            62:                        }
        !            63:                }
        !            64: #ifndef  FORT
        !            65: #ifdef FLOATMATH
        !            66:                if (!strcmp("fsingle", cp)) {
        !            67:                        FLOATMATH = 1;
        !            68:                        goto endswitch;
        !            69:                }
        !            70:                if (!strcmp("fsingle2", cp)) {
        !            71:                        FLOATMATH = 2;
        !            72:                        goto endswitch;
        !            73:                }
        !            74: #endif
        !            75: #endif
        !            76: 
        !            77:        endswitch:
        !            78:                /* recognized an option string; skip to its end */
        !            79:                while (cp[1]) cp++;
        !            80:                *cpp = cp;
        !            81:                return;
        !            82: 
        !            83:        case 'F': 
        !            84:                usesky = 1; 
        !            85:                use68881 = 0;
        !            86:                return;
        !            87:        case 'V':
        !            88:                chk_ovfl++;
        !            89:                return;
        !            90:        default: 
        !            91:                cerror( "Bad flag %c", c );
        !            92:        }
        !            93: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.