mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
64-bit
This commit is contained in:
parent
c9ee9e62f6
commit
3fe9465ac9
14 changed files with 30 additions and 27 deletions
|
@ -41,7 +41,7 @@ nrep(void)
|
|||
|
||||
sym = symlook("NREP", S_VAR, 0);
|
||||
if(sym){
|
||||
w = (Word *) sym->value;
|
||||
w = sym->u.ptr;
|
||||
if (w && w->s && *w->s)
|
||||
nreps = atoi(w->s);
|
||||
}
|
||||
|
|
|
@ -55,15 +55,15 @@ atimeof(int force, char *name)
|
|||
t = mtime(archive);
|
||||
sym = symlook(archive, S_AGG, 0);
|
||||
if(sym){
|
||||
if(force || (t > (long)sym->value)){
|
||||
if(force || (t > sym->u.value)){
|
||||
atimes(archive);
|
||||
sym->value = (void *)t;
|
||||
sym->u.value = t;
|
||||
}
|
||||
}
|
||||
else{
|
||||
atimes(archive);
|
||||
/* mark the aggegate as having been done */
|
||||
symlook(strdup(archive), S_AGG, "")->value = (void *)t;
|
||||
symlook(strdup(archive), S_AGG, "")->u.value = t;
|
||||
}
|
||||
/* truncate long member name to sizeof of name field in archive header */
|
||||
if(dolong)
|
||||
|
@ -72,7 +72,7 @@ atimeof(int force, char *name)
|
|||
snprint(buf, sizeof(buf), "%s(%.*s)", archive, SARNAME, member);
|
||||
sym = symlook(buf, S_TIME, 0);
|
||||
if (sym)
|
||||
return (long)sym->value; /* uggh */
|
||||
return sym->u.value;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -196,7 +196,7 @@ atimes(char *ar)
|
|||
}
|
||||
snprint(buf, sizeof buf, "%s(%s)", ar, name);
|
||||
sym = symlook(strdup(buf), S_TIME, (void *)t);
|
||||
sym->value = (void *)t;
|
||||
sym->u.value = t;
|
||||
skip:
|
||||
t = atol(h.size);
|
||||
if(t&01) t++;
|
||||
|
|
|
@ -79,7 +79,7 @@ ecopy(Symtab *s)
|
|||
for(p = myenv; *p; p++)
|
||||
if(strcmp(*p, s->name) == 0)
|
||||
return;
|
||||
envinsert(s->name, (Word *) s->value);
|
||||
envinsert(s->name, s->u.ptr);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -23,7 +23,7 @@ timeof(char *name, int force)
|
|||
|
||||
sym = symlook(name, S_TIME, 0);
|
||||
if (sym)
|
||||
return (long) sym->value; /* uggh */
|
||||
return sym->u.value;
|
||||
|
||||
t = mtime(name);
|
||||
if(t == 0)
|
||||
|
@ -77,7 +77,7 @@ timeinit(char *s)
|
|||
} while(*s);
|
||||
c = *s;
|
||||
*s = 0;
|
||||
symlook(strdup(cp), S_TIME, (void *)t)->value = (void *)t;
|
||||
symlook(strdup(cp), S_TIME, (void *)t)->u.value = t;
|
||||
if (c)
|
||||
*s++ = c;
|
||||
while(*s){
|
||||
|
|
|
@ -40,14 +40,14 @@ applyrules(char *target, char *cnt)
|
|||
/* print("applyrules(%lux='%s')\n", target, target); */
|
||||
sym = symlook(target, S_NODE, 0);
|
||||
if(sym)
|
||||
return (Node *)(sym->value);
|
||||
return sym->u.ptr;
|
||||
target = strdup(target);
|
||||
node = newnode(target);
|
||||
head.n = 0;
|
||||
head.next = 0;
|
||||
sym = symlook(target, S_TARGET, 0);
|
||||
memset((char*)rmatch, 0, sizeof(rmatch));
|
||||
for(r = sym? (Rule *)(sym->value):0; r; r = r->chain){
|
||||
for(r = sym? sym->u.ptr:0; r; r = r->chain){
|
||||
if(r->attr&META) continue;
|
||||
if(strcmp(target, r->target)) continue;
|
||||
if((!r->recipe || !*r->recipe) && (!r->tail || !r->tail->s || !*r->tail->s)) continue; /* no effect; ignore */
|
||||
|
|
|
@ -221,11 +221,11 @@ outofdate(Node *node, Arc *arc, int eval)
|
|||
str = strdup(buf);
|
||||
ret = pcmp(arc->prog, node->name, arc->n->name, arc->r->shellt, arc->r->shellcmd);
|
||||
if(sym)
|
||||
sym->value = (void *)ret;
|
||||
sym->u.value = ret;
|
||||
else
|
||||
symlook(str, S_OUTOFDATE, (void *)ret);
|
||||
} else
|
||||
ret = (int)sym->value;
|
||||
ret = sym->u.value;
|
||||
return(ret-1);
|
||||
} else if(strchr(arc->n->name, '(') && arc->n->time == 0) /* missing archive member */
|
||||
return 1;
|
||||
|
|
|
@ -129,7 +129,10 @@ typedef struct Symtab
|
|||
{
|
||||
short space;
|
||||
char *name;
|
||||
void *value;
|
||||
union {
|
||||
void *ptr;
|
||||
uintptr value;
|
||||
} u;
|
||||
struct Symtab *next;
|
||||
} Symtab;
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ dorecipe(Node *node)
|
|||
aw = aw->next;
|
||||
if((s = symlook(buf, S_NODE, 0)) == 0)
|
||||
continue; /* not a node we are interested in */
|
||||
n = (Node *)s->value;
|
||||
n = s->u.ptr;
|
||||
if(aflag == 0 && n->time) {
|
||||
for(a = n->prereqs; a; a = a->next)
|
||||
if(a->n && outofdate(n, a, 0))
|
||||
|
|
|
@ -15,7 +15,7 @@ addrule(char *head, Word *tail, char *body, Word *ahead, int attr, int hline, ch
|
|||
r = 0;
|
||||
reuse = 0;
|
||||
if(sym = symlook(head, S_TARGET, 0)){
|
||||
for(r = (Rule *)sym->value; r; r = r->chain)
|
||||
for(r = sym->u.ptr; r; r = r->chain)
|
||||
if(rcmp(r, head, tail) == 0){
|
||||
reuse = 1;
|
||||
break;
|
||||
|
@ -35,7 +35,7 @@ addrule(char *head, Word *tail, char *body, Word *ahead, int attr, int hline, ch
|
|||
r->prog = prog;
|
||||
r->rule = nrules++;
|
||||
if(!reuse){
|
||||
rr = (Rule *)symlook(head, S_TARGET, (void *)r)->value;
|
||||
rr = symlook(head, S_TARGET, (void *)r)->u.ptr;
|
||||
if(rr != r){
|
||||
r->chain = rr->chain;
|
||||
rr->chain = r;
|
||||
|
|
|
@ -168,7 +168,7 @@ again: /* rogue processes */
|
|||
for(w = j->t; w; w = w->next){
|
||||
if((s = symlook(w->s, S_NODE, 0)) == 0)
|
||||
continue; /* not interested in this node */
|
||||
update(uarg, (Node *)s->value);
|
||||
update(uarg, s->u.ptr);
|
||||
}
|
||||
if(nrunning < nproclimit)
|
||||
sched();
|
||||
|
@ -182,7 +182,7 @@ nproc(void)
|
|||
Word *w;
|
||||
|
||||
if(sym = symlook("NPROC", S_VAR, 0)) {
|
||||
w = (Word *) sym->value;
|
||||
w = sym->u.ptr;
|
||||
if (w && w->s && w->s[0])
|
||||
nproclimit = atoi(w->s);
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ symlook(char *sym, int space, void *install)
|
|||
s = (Symtab *)Malloc(sizeof(Symtab));
|
||||
s->space = space;
|
||||
s->name = sym;
|
||||
s->value = install;
|
||||
s->u.ptr = install;
|
||||
s->next = hash[h];
|
||||
hash[h] = s;
|
||||
return(s);
|
||||
|
|
|
@ -41,7 +41,7 @@ readenv(void)
|
|||
continue;
|
||||
s = strdup(*p);
|
||||
setvar(s, (void *)w);
|
||||
symlook(s, S_EXPORTED, (void*)"")->value = (void*)"";
|
||||
symlook(s, S_EXPORTED, (void*)"")->u.ptr = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#include "mk.h"
|
||||
|
||||
void
|
||||
setvar(char *name, void *value)
|
||||
setvar(char *name, void *ptr)
|
||||
{
|
||||
symlook(name, S_VAR, value)->value = value;
|
||||
symlook(name, S_VAR, ptr)->u.ptr = ptr;
|
||||
symlook(name, S_MAKEVAR, (void*)"");
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@ print1(Symtab *s)
|
|||
Word *w;
|
||||
|
||||
Bprint(&bout, "\t%s=", s->name);
|
||||
for (w = (Word *) s->value; w; w = w->next)
|
||||
for (w = s->u.ptr; w; w = w->next)
|
||||
Bprint(&bout, "'%s'", w->s);
|
||||
Bprint(&bout, "\n");
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ varmatch(char *name, char **s)
|
|||
sym = symlook(name, S_VAR, 0);
|
||||
if(sym){
|
||||
/* check for at least one non-NULL value */
|
||||
for (w = (Word*)sym->value; w; w = w->next)
|
||||
for (w = sym->u.ptr; w; w = w->next)
|
||||
if(w->s && *w->s)
|
||||
return wdup(w);
|
||||
}
|
||||
|
@ -113,10 +113,10 @@ expandvar(char **s)
|
|||
*s = end+1;
|
||||
|
||||
sym = symlook(buf->start, S_VAR, 0);
|
||||
if(sym == 0 || sym->value == 0)
|
||||
if(sym == 0 || sym->u.ptr == 0)
|
||||
w = newword(buf->start);
|
||||
else
|
||||
w = subsub((Word*) sym->value, cp, end);
|
||||
w = subsub(sym->u.ptr, cp, end);
|
||||
freebuf(buf);
|
||||
return w;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue