From aeba5e4b071ce0a470bd007f084a417d1572a607 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 26 Mar 2019 04:20:20 -1100 Subject: [PATCH] Fetch --- src/cc/dapps/dappstd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cc/dapps/dappstd.c b/src/cc/dapps/dappstd.c index 80b651b45..a5ef379db 100644 --- a/src/cc/dapps/dappstd.c +++ b/src/cc/dapps/dappstd.c @@ -22,7 +22,6 @@ #include #include #include -#include extern struct games_state globalR; void *gamesiterate(struct games_state *rs); @@ -1012,7 +1011,7 @@ int32_t games_replay(uint64_t seed,int32_t sleeptime) char games_readchar(struct games_state *rs) { - char c,ch = -1; + char ch = -1; int32_t c; if ( rs != 0 && rs->guiflag == 0 ) { static uint32_t counter; @@ -1040,8 +1039,8 @@ char games_readchar(struct games_state *rs) } if ( rs == 0 || rs->guiflag != 0 ) { - ch = (char) getch(); - switch ( ch ) + c = getch(); + switch ( c ) { case KEY_LEFT: c = 'h'; @@ -1056,6 +1055,7 @@ char games_readchar(struct games_state *rs) c = 'j'; break; } + ch = c; if (ch == 3) { //_quit(); @@ -1065,7 +1065,7 @@ char games_readchar(struct games_state *rs) { if ( rs->num < sizeof(rs->buffered) ) { - rs->buffered[rs->num++] = ch; + rs->buffered[rs->num++] = c; if ( rs->num > (sizeof(rs->buffered)*9)/10 && rs->needflush == 0 ) { rs->needflush = (uint32_t)time(NULL); @@ -1075,7 +1075,7 @@ char games_readchar(struct games_state *rs) } else fprintf(stderr,"buffer filled without flushed\n"); } } else fprintf(stderr,"readchar rs.%p non-gui error?\n",rs); - return(ch); + return(c); } int32_t games_setplayerdata(struct games_state *rs,char *gametxidstr)