shithub: neinchat

Download patch

ref: 62f992b9b69dc0d2d4c95364def709eb5ad15ac7
parent: b8cc5e02b3662d1e98953e35034f33fff9715e7f
author: Peter Mikkelsen <petermikkelsen10@gmail.com>
date: Fri Feb 12 18:37:46 EST 2021

Remove two global variables

--- a/main.c
+++ b/main.c
@@ -35,15 +35,6 @@
 Neinfile	*findfile(uvlong);
 void	fillstat(Dir*, Neinfile);
 
-Srv fs = {
-	.attach = fsattach,
-	.walk1 = fswalk1,
-	.clone = fsclone,
-	.stat = fsstat,
-	.read = fsread,
-	.write = fswrite,
-};
-
 char *username;
 
 Neinfile qroot[] = {
@@ -53,11 +44,18 @@
 
 Neinfile root = {"/", {Qroot, 0, QTDIR}, 555 | DMDIR};
 
-int nicknamecount;
-
 void
-main()
+main(void)
 {
+	Srv fs = {
+		.attach = fsattach,
+		.walk1 = fswalk1,
+		.clone = fsclone,
+		.stat = fsstat,
+		.read = fsread,
+		.write = fswrite,
+	};
+
 	chatty9p = 1;
 	char *mountpoint = "/mnt/neinchat";
 	username = getuser();
@@ -69,6 +67,7 @@
 void
 fsattach(Req *r)
 {
+	static int nicknamecount;
 	NeinAux *aux;
 
 	r->fid->qid = root.qid;