shithub: riscv

Download patch

ref: 997c75bc9698306afac99208f76f049bdd25f873
parent: 78aa56ab320d75624bd19d079c32b58108357a90
parent: 8c20c6ec1933054386dd712158d2452da15d6ec7
author: qwx <qwx@sciops.net>
date: Wed Aug 9 14:52:01 EDT 2023

merge

--- a/sys/src/cmd/bar.c
+++ b/sys/src/cmd/bar.c
@@ -196,18 +196,18 @@
 static void
 auxproc(void *c)
 {
-	Biobuf *b;
+	Biobuf b;
 	char *s;
 
 	threadsetname("aux");
-	b = Bfdopen(0, OREAD);
+	Binit(&b, 0, OREAD);
 	for(;;){
-		s = Brdstr(b, '\n', 1);
+		s = Brdstr(&b, '\n', 1);
 		if(s == nil)
 			break;
 		sendp(c, s);
 	}
-	Bterm(b);
+	Bterm(&b);
 
 	threadexits(nil);
 }
--- a/sys/src/cmd/fontsel.c
+++ b/sys/src/cmd/fontsel.c
@@ -238,22 +238,21 @@
 static void
 loadtext(int f)
 {
-	Biobuf *b;
+	Biobuf b;
 	int i;
 
-	if(f < 0)
+	if(f < 0 || Binit(&b, f, OREAD) != 0)
 		sysfatal("loadtext: %r");
-	if((b = Bfdopen(f, OREAD)) == nil)
-		sysfatal("loadtext: %r");
+
 	text = nil;
 	for(i = 0; i < 256; i++){
 		if((text = realloc(text, (i+1)*sizeof(char*))) == nil)
 			sysfatal("memory");
-		if((text[i] = Brdstr(b, '\n', 1)) == nil)
+		if((text[i] = Brdstr(&b, '\n', 1)) == nil)
 			break;
 	}
 
-	Bterm(b);
+	close(f);
 }
 
 void
--- a/sys/src/games/doom/i_sound.c
+++ b/sys/src/games/doom/i_sound.c
@@ -16,7 +16,7 @@
 #define	AUDFREQ		44100
 #define	SFXFREQ		11025
 #define	SAMPLECOUNT	(AUDFREQ/TICRATE)
-#define	NUM_CHANNELS	8
+#define	NUM_CHANNELS	32
 
 /* The actual lengths of all sound effects. */
 int	lengths[NUMSFX];