File:  [CSRG BSD Unix] / 43BSD / contrib / icon / rt / mkint.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 16:12:55 2018 UTC (8 years, 1 month ago) by root
Branches: MAIN, BSD
CVS tags: HEAD, BSD43
BSD 4.3

#include "../h/rt.h"

/*
 * mkint - make an integer descriptor for l in *d.  A long integer is used
 *  if the value is too large for a regular integer.
 */

mkint(l, d)
long l;
register struct descrip *d;
   {
#ifdef LONGS
   extern struct b_int *alclint();

   if (l < (long)(int)MINSHORT || l > (long)(int)MAXSHORT) {
      hneed(sizeof(struct b_int));
      d->type = D_LONGINT;
      BLKLOC(*d) = alclint(l);
      }
   else {
      d->type = D_INTEGER;
      INTVAL(*d) = (int)l;
      }
#else LONGS
   d->type = D_INTEGER;
   INTVAL(*d) = (int)l;
#endif LONGS
   }

unix.superglobalmegacorp.com

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