From: ceriel Date: Mon, 11 Jan 1988 18:24:34 +0000 (+0000) Subject: some fixes X-Git-Tag: release-5-5~3665 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=a58740c4ee3139fadb1160cbf377375bd028526f;p=ack.git some fixes --- diff --git a/util/led/memory.c b/util/led/memory.c index 78af0db2a..dd94e66da 100644 --- a/util/led/memory.c +++ b/util/led/memory.c @@ -422,6 +422,7 @@ hard_alloc(piece, size) case ALLOSYMB: case ALLOARCH: case ALLOMODL: + case ALLORANL: break; /* Do not try to deallocate this. */ default: dealloc(i); @@ -499,8 +500,16 @@ core_free(piece, p) char *q = address(piece, mems[piece].mem_full); assert(p < q); - mems[piece].mem_full -= ((ind_t)q - (ind_t)p); - mems[piece].mem_left += ((ind_t)q - (ind_t)p); + switch(sizeof(unsigned) == sizeof(char *)) { + case 1: + mems[piece].mem_full -= (unsigned) (q - p); + mems[piece].mem_left += (unsigned) (q - p); + break; + default: + mems[piece].mem_full -= (ind_t) q - (ind_t) p; + mems[piece].mem_left += (ind_t) q - (ind_t) p; + break; + } } /* diff --git a/util/led/memory.h b/util/led/memory.h index 61595383f..761783575 100644 --- a/util/led/memory.h +++ b/util/led/memory.h @@ -21,9 +21,10 @@ #define ALLORANL (ALLOMODL + 1) /* Ranlib information. */ #define NMEMS (ALLORANL + 1) -typedef long ind_t; #define BADOFF ((ind_t)-1) +typedef long ind_t; + struct memory { char *mem_base; ind_t mem_full;