Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/games/tetris elide compiler stupidity.
details: https://anonhg.NetBSD.org/src/rev/969aa20cacbb
branches: trunk
changeset: 352202:969aa20cacbb
user: christos <christos%NetBSD.org@localhost>
date: Mon Mar 20 22:05:27 2017 +0000
description:
elide compiler stupidity.
diffstat:
games/tetris/screen.c | 24 +++++++++++++-----------
1 files changed, 13 insertions(+), 11 deletions(-)
diffs (48 lines):
diff -r 3081621a6ff8 -r 969aa20cacbb games/tetris/screen.c
--- a/games/tetris/screen.c Mon Mar 20 21:30:47 2017 +0000
+++ b/games/tetris/screen.c Mon Mar 20 22:05:27 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: screen.c,v 1.32 2016/03/03 21:38:55 nat Exp $ */
+/* $NetBSD: screen.c,v 1.33 2017/03/20 22:05:27 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -212,10 +212,11 @@
* We made it. We are now in screen mode, modulo TIstr
* (which we will fix immediately).
*/
- if (enter_ca_mode)
- putstr(enter_ca_mode);
- if (cursor_invisible)
- putstr(cursor_invisible);
+ const char *tstr;
+ if ((tstr = enter_ca_mode) != NULL)
+ putstr(tstr);
+ if ((tstr = cursor_invisible) != NULL)
+ putstr(tstr);
if (tstp != SIG_IGN)
(void) signal(SIGTSTP, scr_stop);
if (ttou != SIG_IGN)
@@ -239,15 +240,16 @@
sigaddset(&nsigset, SIGTTOU);
(void) sigprocmask(SIG_BLOCK, &nsigset, &osigset);
/* move cursor to last line */
- if (cursor_to_ll)
- putstr(cursor_to_ll);
+ const char *tstr;
+ if ((tstr = cursor_to_ll) != NULL)
+ putstr(tstr);
else
moveto(Rows - 1, 0);
/* exit screen mode */
- if (exit_ca_mode)
- putstr(exit_ca_mode);
- if (cursor_normal)
- putstr(cursor_normal);
+ if ((tstr = exit_ca_mode) != NULL)
+ putstr(tstr);
+ if ((tstr = cursor_normal) != NULL)
+ putstr(tstr);
(void) fflush(stdout);
(void) tcsetattr(0, TCSADRAIN, &oldtt);
isset = 0;
Home |
Main Index |
Thread Index |
Old Index