shithub: pplay

Download patch

ref: c898b9cdb26ed6ac53982b945a548b746de783a2
parent: a969a06590d24e86258898866999ad2a1328f66e
author: qwx <qwx@sciops.net>
date: Sat Sep 16 15:58:44 EDT 2023

don't set size of -1

--- a/chunk.c
+++ b/chunk.c
@@ -377,7 +377,7 @@
 	usize off;
 	Chunk *p1, *l, *r;
 
-	assert(d->off != -1ULL);
+	assert(d->off != -1);
 	p1 = p2c(d->off, &off, d);
 	l = splitchunk(p1, 0, off);
 	r = splitchunk(p1, off, p1->len);
@@ -406,7 +406,7 @@
 	}
 	dprint(d->norris, "cpaste dot=%Δ hold=%Δ\n", d, &hold.Dot);
 	c = clone(hold.c, hold.c->left);
-	return d->off == -1ULL ? creplace(d, c) : cinsert(d, c);
+	return d->off == -1 ? creplace(d, c) : cinsert(d, c);
 }
 
 void
--- a/cmd.c
+++ b/cmd.c
@@ -140,7 +140,7 @@
 	Chunk *c;
 
 	d = *current;
-	d.off = -1ULL;
+	d.off = -1;
 	fd = (intptr)efd;
 	if((c = loadfile(fd, &cd)) == nil){
 		fprint(2, "failed reading from pipe: %r");
--- a/draw.c
+++ b/draw.c
@@ -428,7 +428,7 @@
 	current->to = to;
 	if(current->cur < from || current->cur >= to)
 		current->cur = from;
-	current->off = -1ULL;
+	current->off = -1;
 	stalerender = 1;
 	if(paused)
 		refresh();