aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/acme/edit.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2008-03-07 10:45:59 -0500
committerRuss Cox <rsc@swtch.com>2008-03-07 10:45:59 -0500
commit734a96bd1691395765ceae0bf9afa86bda8ab07b (patch)
tree5cb8eafe1b12ebdf759d268af47438ef054a39b0 /src/cmd/acme/edit.c
parent7927fe8f9efb61c7bcdfc63997a4e785c97c53ef (diff)
downloadplan9port-734a96bd1691395765ceae0bf9afa86bda8ab07b.tar.gz
plan9port-734a96bd1691395765ceae0bf9afa86bda8ab07b.tar.bz2
plan9port-734a96bd1691395765ceae0bf9afa86bda8ab07b.zip
acme: sync against Plan 9, remove -$ option
Diffstat (limited to 'src/cmd/acme/edit.c')
-rw-r--r--src/cmd/acme/edit.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/cmd/acme/edit.c b/src/cmd/acme/edit.c
index a6375f66..f1a7d67f 100644
--- a/src/cmd/acme/edit.c
+++ b/src/cmd/acme/edit.c
@@ -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;
}