acme: sync against Plan 9, remove -$ option
This commit is contained in:
parent
7927fe8f9e
commit
734a96bd16
7 changed files with 38 additions and 281 deletions
|
|
@ -82,8 +82,6 @@ editthread(void *v)
|
|||
USED(v);
|
||||
threadsetname("editthread");
|
||||
while((cmdp=parsecmd(0)) != 0){
|
||||
/* ocurfile = curfile; */
|
||||
/* loaded = curfile && !curfile->unread; */
|
||||
if(cmdexec(curtext, cmdp) == 0)
|
||||
break;
|
||||
freecmd();
|
||||
|
|
@ -257,11 +255,11 @@ growlist(List *l)
|
|||
{
|
||||
if(l->u.listptr==0 || l->nalloc==0){
|
||||
l->nalloc = INCR;
|
||||
l->u.listptr = emalloc(INCR*sizeof(long));
|
||||
l->u.listptr = emalloc(INCR*sizeof(void*));
|
||||
l->nused = 0;
|
||||
}else if(l->nused == l->nalloc){
|
||||
l->u.listptr = erealloc(l->u.listptr, (l->nalloc+INCR)*sizeof(long));
|
||||
memset((void*)(l->u.longptr+l->nalloc), 0, INCR*sizeof(long));
|
||||
l->u.listptr = erealloc(l->u.listptr, (l->nalloc+INCR)*sizeof(void*));
|
||||
memset(l->u.ptr+l->nalloc, 0, INCR*sizeof(void*));
|
||||
l->nalloc += INCR;
|
||||
}
|
||||
}
|
||||
|
|
@ -272,7 +270,7 @@ growlist(List *l)
|
|||
void
|
||||
dellist(List *l, int i)
|
||||
{
|
||||
memmove(&l->u.longptr[i], &l->u.longptr[i+1], (l->nused-(i+1))*sizeof(long));
|
||||
memmove(&l->u.ptr[i], &l->u.ptr[i+1], (l->nused-(i+1))*sizeof(void*));
|
||||
l->nused--;
|
||||
}
|
||||
|
||||
|
|
@ -280,11 +278,11 @@ dellist(List *l, int i)
|
|||
* Add a new element, whose position is i, to the list
|
||||
*/
|
||||
void
|
||||
inslist(List *l, int i, long val)
|
||||
inslist(List *l, int i, void *v)
|
||||
{
|
||||
growlist(l);
|
||||
memmove(&l->u.longptr[i+1], &l->u.longptr[i], (l->nused-i)*sizeof(long));
|
||||
l->u.longptr[i] = val;
|
||||
memmove(&l->u.ptr[i+1], &l->u.ptr[i], (l->nused-i)*sizeof(void*));
|
||||
l->u.ptr[i] = v;
|
||||
l->nused++;
|
||||
}
|
||||
|
||||
|
|
@ -320,7 +318,7 @@ newcmd(void){
|
|||
Cmd *p;
|
||||
|
||||
p = emalloc(sizeof(Cmd));
|
||||
inslist(&cmdlist, cmdlist.nused, (long)p);
|
||||
inslist(&cmdlist, cmdlist.nused, p);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
|
@ -330,7 +328,7 @@ newstring(int n)
|
|||
String *p;
|
||||
|
||||
p = allocstring(n);
|
||||
inslist(&stringlist, stringlist.nused, (long)p);
|
||||
inslist(&stringlist, stringlist.nused, p);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
|
@ -340,7 +338,7 @@ newaddr(void)
|
|||
Addr *p;
|
||||
|
||||
p = emalloc(sizeof(Addr));
|
||||
inslist(&addrlist, addrlist.nused, (long)p);
|
||||
inslist(&addrlist, addrlist.nused, p);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue