# 2.11BSD#431 - /usr/src/games/hack/alloc.c

##### Functions

    alloc             X
    enlarge           X

       1: /* alloc.c - version 1.0.2 */
       2: #ifdef LINT
       3:
       4: /*
       5:    a ridiculous definition, suppressing
       6: 	"possible pointer alignment problem" for (long *) malloc()
       7: 	"enlarg defined but never used"
       8: 	"ftell defined (in <stdio.h>) but never used"
       9:    from lint
      10: */
      11: #include <stdio.h>
      12: long *
      13: alloc(n) unsigned n; {
      14: long dummy = ftell(stderr);
      15:     if(n) dummy = 0;    /* make sure arg is used */
      16:     return(&dummy);
      17: }
      18:
      19: #else
      20:
      21: extern char *malloc();
      22: extern char *realloc();
      23:
      24: long *
      25: alloc(lth)
      26: register unsigned lth;
      27: {
      28:     register char *ptr;
      29:
      30:     if(!(ptr = malloc(lth)))
      31:         panic("Cannot get %d bytes", lth);
      32:     return((long *) ptr);
      33: }
      34:
      35: long *
      36: enlarge(ptr,lth)
      37: register char *ptr;
      38: register unsigned lth;
      39: {
      40:     register char *nptr;
      41:
      42:     if(!(nptr = realloc(ptr,lth)))
      43:         panic("Cannot reallocate %d bytes", lth);
      44:     return((long *) nptr);
      45: }
      46:
      47: #endif LINT

#### Defined functions

alloc defined in line 24; used 21 times

- in /usr/src/games/hack/def.gen.h line 15
- in /usr/src/games/hack/def.gold.h line 12
- in /usr/src/games/hack/def.monst.h line 48
- in /usr/src/games/hack/def.obj.h line 46
- in /usr/src/games/hack/def.trap.h line 14
- in /usr/src/games/hack/def.wseg.h line 12
- in /usr/src/games/hack/hack.end.c line 195
- in /usr/src/games/hack/hack.engrave.c line 111, 237, 282
- in /usr/src/games/hack/hack.h line 37-42(2)
- in /usr/src/games/hack/hack.o_init.c line 98, 124
- in /usr/src/games/hack/hack.pager.c line 74, 211
- in /usr/src/games/hack/hack.rumors.c line 7, 19
- in /usr/src/games/hack/hack.termcap.c line 8, 28
- in /usr/src/games/hack/hack.topl.c line 51

enlarge defined in line 35; never used

Last modified: 1985-10-01 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 498 |