Module Name:    src
Committed By:   mrg
Date:           Sun Feb  4 08:48:05 UTC 2018

Modified Files:
        src/games/battlestar: command3.c command7.c
        src/games/tetris: scores.c

Log Message:
fix issues found by GCC 6.4:

battlestar was missing some {} in its insane printf()+puts() usage.
this is a literal code sequence i found:

        printf("The blast catches ");
        printf("the goddess in the ");
        printf("stomach, knocking ");
        puts("her to the ground.");
        printf("She writhes in the ");
        printf("dirt as the agony of ");
        puts("death taunts her.");
        puts("She has stopped moving.");

no lines inserted or removed.

tetris' checkscores() had wrong and missing {} usage.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/games/battlestar/command3.c \
    src/games/battlestar/command7.c
cvs rdiff -u -r1.22 -r1.23 src/games/tetris/scores.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/games/battlestar/command3.c
diff -u src/games/battlestar/command3.c:1.3 src/games/battlestar/command3.c:1.4
--- src/games/battlestar/command3.c:1.3	Fri Jul  1 06:04:54 2005
+++ src/games/battlestar/command3.c	Sun Feb  4 08:48:05 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: command3.c,v 1.3 2005/07/01 06:04:54 jmc Exp $	*/
+/*	$NetBSD: command3.c,v 1.4 2018/02/04 08:48:05 mrg Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)com3.c	8.2 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: command3.c,v 1.3 2005/07/01 06:04:54 jmc Exp $");
+__RCSID("$NetBSD: command3.c,v 1.4 2018/02/04 08:48:05 mrg Exp $");
 #endif
 #endif				/* not lint */
 
@@ -306,9 +306,10 @@ shoot(void)
 						if (wintime)
 							live();
 						break;
-					} else
+					} else {
 						printf("I don't see any ");
 						puts("goddess around here.");
+					}
 				break;
 
 			case TIMER:
Index: src/games/battlestar/command7.c
diff -u src/games/battlestar/command7.c:1.3 src/games/battlestar/command7.c:1.4
--- src/games/battlestar/command7.c:1.3	Fri Jul  1 06:04:54 2005
+++ src/games/battlestar/command7.c	Sun Feb  4 08:48:05 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: command7.c,v 1.3 2005/07/01 06:04:54 jmc Exp $	*/
+/*	$NetBSD: command7.c,v 1.4 2018/02/04 08:48:05 mrg Exp $	*/
 
 /*
  * Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)com7.c	8.2 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: command7.c,v 1.3 2005/07/01 06:04:54 jmc Exp $");
+__RCSID("$NetBSD: command7.c,v 1.4 2018/02/04 08:48:05 mrg Exp $");
 #endif
 #endif				/* not lint */
 
@@ -273,9 +273,10 @@ fighton:
 	}
 	if (lifeline >= strength) {
 		printf("You have killed the %s.\n", objsht[enemy]);
-		if (enemy == ELF || enemy == DARK)
+		if (enemy == ELF || enemy == DARK) {
 			printf("A watery black smoke consumes his body and ");
 			puts("then vanishes with a peal of thunder!");
+		}
 		clearbit(location[position].objects, enemy);
 		power += 2;
 		notes[JINXED]++;

Index: src/games/tetris/scores.c
diff -u src/games/tetris/scores.c:1.22 src/games/tetris/scores.c:1.23
--- src/games/tetris/scores.c:1.22	Sat Mar 22 19:05:30 2014
+++ src/games/tetris/scores.c	Sun Feb  4 08:48:05 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: scores.c,v 1.22 2014/03/22 19:05:30 dholland Exp $	*/
+/*	$NetBSD: scores.c,v 1.23 2018/02/04 08:48:05 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -830,7 +830,8 @@ checkscores(struct highscore *hs, int nu
 				continue;
 			}
 		}
-        if (sp->hs_level < NLEVELS && sp->hs_level >= 0)
+	}
+        if (sp->hs_level < NLEVELS && sp->hs_level >= 0) {
     		levelfound[sp->hs_level] = 1;
 		i++, sp++;
 	}

Reply via email to