qa: remove ALLOC() and ALLOCN() macros
This commit is contained in:
parent
ca9d65e40b
commit
550b6d1aad
2 changed files with 2 additions and 21 deletions
|
@ -23,25 +23,6 @@ typedef struct Hist Hist;
|
||||||
#define STRINGSZ 200
|
#define STRINGSZ 200
|
||||||
#define NMACRO 10
|
#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
|
struct Sym
|
||||||
{
|
{
|
||||||
Sym* link;
|
Sym* link;
|
||||||
|
|
|
@ -675,9 +675,9 @@ cinit(void)
|
||||||
s->type = itab[i].type;
|
s->type = itab[i].type;
|
||||||
s->value = itab[i].value;
|
s->value = itab[i].value;
|
||||||
}
|
}
|
||||||
ALLOCN(pathname, 0, 100);
|
pathname = allocn(pathname, 0, 100);
|
||||||
if(mygetwd(pathname, 99) == 0) {
|
if(mygetwd(pathname, 99) == 0) {
|
||||||
ALLOCN(pathname, 100, 900);
|
pathname = allocn(pathname, 100, 900);
|
||||||
if(mygetwd(pathname, 999) == 0)
|
if(mygetwd(pathname, 999) == 0)
|
||||||
strcpy(pathname, "/???");
|
strcpy(pathname, "/???");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue