Annotation of 43BSD/contrib/icon/rt/defshort.c, revision 1.1.1.1

1.1       root        1: #include "../h/rt.h"
                      2: 
                      3: /*
                      4:  * defshort - if dp is null, default to def; otherwise, convert to short
                      5:  *  integer.  The result is an integer value in *dp.
                      6:  */
                      7: 
                      8: defshort(dp, def)
                      9: struct descrip *dp;
                     10: int def;
                     11:    {
                     12:    long l;
                     13: 
                     14:    DeRef(*dp)
                     15:    if (NULLDESC(*dp)) {
                     16:       dp->type = D_INTEGER;
                     17:       INTVAL(*dp) = def;
                     18:       return 1;
                     19:       }
                     20:    switch (cvint(dp, &l)) {
                     21:       case T_INTEGER:
                     22:          dp->type = D_INTEGER;
                     23:          INTVAL(*dp) = (int)l;
                     24:          break;
                     25: #ifdef LONGS
                     26:       case T_LONGINT:
                     27:          runerr(205, dp);
                     28: #endif LONGS
                     29:       default:
                     30:          runerr(101, dp);
                     31:       }
                     32:    return 0;
                     33:    }

unix.superglobalmegacorp.com

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