Recently Written · git

sad

sad (2f30.org simple audio daemon) with a Cygwin/OSS port on branch cygwin

git clone https://github.com/equwal/sad

Log | Files | Refs


commit 72de2de7ffd46b5249a68c22a0fe8486cc120c6f
sin <sin@2f30.org>
2015-01-19 20:39:08 +0000

Use 'r' for return value instead of 'ok'

 cmd.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/cmd.c b/cmd.c
index 9bef844..bc9995d 100644
--- a/cmd.c
+++ b/cmd.c
@@ -16,7 +16,7 @@ static void
 cmdstatus(int fd, char *arg)
 {
 	Song *s;
-	int ok = 0;
+	int r = 0;
 
 	if (!arg[0]) {
 		dprintf(fd, "ERR expected argument\n");
@@ -24,16 +24,16 @@ cmdstatus(int fd, char *arg)
 	}
 
 	if (!strncmp(arg, "random", 7)) {
-		ok = 1;
+		r = 1;
 		dprintf(fd, "random: %d\n", getplaylistmode() & RANDOM == 1);
 	} else if (!strncmp(arg, "repeat", 7)) {
-		ok = 1;
+		r = 1;
 		dprintf(fd, "repeat: %d\n", getplaylistmode() & REPEAT == 1);
 	} else if (!strncmp(arg, "single", 7)) {
-		ok = 1;
+		r = 1;
 		dprintf(fd, "single: %d\n", getplaylistmode() & SINGLE == 1);
 	} else if (!strncmp(arg, "songid", 7)) {
-		ok = 1;
+		r = 1;
 		s = getcursong();
 
 		if (!s) {
@@ -43,7 +43,7 @@ cmdstatus(int fd, char *arg)
 
 		dprintf(fd, "songid: %d\n", s->id);
 	} else if (!strncmp(arg, "playback", 9)) {
-		ok = 1;
+		r = 1;
 		s = getcursong();
 
 		dprintf(fd, "playback: ");
@@ -64,7 +64,7 @@ cmdstatus(int fd, char *arg)
 			dprintf(fd, "stop\n");
 	}
 
-	if (ok) {
+	if (r) {
 		dprintf(fd, "OK\n");
 		return;
 	}