From 550b6d1aad832fc6155c776a8192cb457d2b1175 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sat, 11 Apr 2020 14:20:13 +0200 Subject: qa: remove ALLOC() and ALLOCN() macros --- sys/src/cmd/qa/a.h | 19 ------------------- sys/src/cmd/qa/lex.c | 4 ++-- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/sys/src/cmd/qa/a.h b/sys/src/cmd/qa/a.h index 3dbb478b1..d2a231557 100644 --- a/sys/src/cmd/qa/a.h +++ b/sys/src/cmd/qa/a.h @@ -23,25 +23,6 @@ typedef struct Hist Hist; #define STRINGSZ 200 #define NMACRO 10 -#define ALLOC(lhs, type)\ - while(nhunk < sizeof(type))\ - gethunk();\ - lhs = (type*)hunk;\ - nhunk -= sizeof(type);\ - hunk += sizeof(type); - -#define ALLOCN(lhs, len, n)\ - if(lhs+len != hunk || nhunk < n) {\ - while(nhunk <= len)\ - gethunk();\ - memmove(hunk, lhs, len);\ - lhs = hunk;\ - hunk += len;\ - nhunk -= len;\ - }\ - hunk += n;\ - nhunk -= n; - struct Sym { Sym* link; diff --git a/sys/src/cmd/qa/lex.c b/sys/src/cmd/qa/lex.c index e1af336a2..85f530fa0 100644 --- a/sys/src/cmd/qa/lex.c +++ b/sys/src/cmd/qa/lex.c @@ -675,9 +675,9 @@ cinit(void) s->type = itab[i].type; s->value = itab[i].value; } - ALLOCN(pathname, 0, 100); + pathname = allocn(pathname, 0, 100); if(mygetwd(pathname, 99) == 0) { - ALLOCN(pathname, 100, 900); + pathname = allocn(pathname, 100, 900); if(mygetwd(pathname, 999) == 0) strcpy(pathname, "/???"); } -- cgit v1.2.3