Annotation of coherent/b/lib/libc/gen/ctol.c, revision 1.1

1.1     ! root        1: /*
        !             2:  * Convert a comp_t style number to a long.
        !             3:  * A comp_t contains 3 bits of base-8 exponent
        !             4:  * and a 13-bit mantissa.  Only unsigned
        !             5:  * numbers can be comp_t numbers.
        !             6:  */
        !             7: 
        !             8: #include <sys/types.h>
        !             9: #include <acct.h>
        !            10: #define        MAXMANT         017777          /* 2^13-1 - largest mantissa */
        !            11: 
        !            12: long
        !            13: ctol(c)
        !            14: comp_t c;
        !            15: {
        !            16:        register exp;
        !            17:        long mant;
        !            18: 
        !            19:        mant = c&MAXMANT;
        !            20:        exp = (c>>13)&07;
        !            21:        while (exp--)
        !            22:                mant <<= 3;
        !            23:        return (mant);
        !            24: }

unix.superglobalmegacorp.com

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