X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gnushogi%2Fcursesdsp.c;h=5d33790ad9901abcdcdfa70c278335519f2d89a6;hb=b1b9616a3147b835beaabfaaa8f2de0db6d12ee9;hp=a42bb26a06d1541f57928ec2f20b792887239b4b;hpb=9da823015c78c8e9131cf76f14598a1071d29192;p=gnushogi.git diff --git a/gnushogi/cursesdsp.c b/gnushogi/cursesdsp.c index a42bb26..5d33790 100644 --- a/gnushogi/cursesdsp.c +++ b/gnushogi/cursesdsp.c @@ -6,6 +6,7 @@ * ---------------------------------------------------------------------- * Copyright (c) 1993, 1994, 1995 Matthias Mutz * Copyright (c) 1999 Michael Vanier and the Free Software Foundation + * Copyright (c) 2008, 2013, 2014 Yann Dirson and the Free Software Foundation * * GNU SHOGI is based on GNU CHESS * @@ -30,10 +31,13 @@ * ---------------------------------------------------------------------- */ +/* request *snprintf prototypes*/ +#define _POSIX_C_SOURCE 200112L #include #include #include +#include #include #include @@ -58,17 +62,11 @@ #define FLUSH_SCANW fflush(stdout), scanw -int mycnt1, mycnt2; - #define TAB (58) #define VIR_C(s) ((flag.reverse) ? (NO_COLS - 1 - column(s)) : column(s)) #define VIR_R(s) ((flag.reverse) ? (NO_ROWS - 1 - row(s)) : row(s)) -unsigned short MV[MAXDEPTH]; -int MSCORE; -char *DRAW; - /**************************************** * forward declarations ****************************************/ @@ -79,6 +77,7 @@ static void DrawPiece(short sq); static void ShowScore(short score); void Curses_UpdateDisplay(short f, short t, short redraw, short isspec); void Curses_Die(int sig); +void Curses_ShowSidetoMove(void); /**************************************** * Trivial output functions. @@ -107,14 +106,6 @@ gotoXY(short x, short y) } -static void -ClearMessage(void) -{ - gotoXY(TAB, 6); - ClearEoln(); -} - - void Curses_ShowCurrentMove(short pnt, short f, short t) { @@ -773,10 +764,8 @@ DrawPiece(short sq) void Curses_ShowPostnValue(short sq) { - short score; - gotoXY(4 + 5 * VIR_C(sq), 5 + 2 * (7 - VIR_R(sq))); /* CHECKME */ - score = ScorePosition(color[sq]); + (void) ScorePosition(color[sq]); if (color[sq] != neutral) #if defined SAVE_SVALUE @@ -973,7 +962,7 @@ Curses_GiveHint(void) void -Curses_ChangeSearchDepth(void) +Curses_ChangeSearchDepth(char* sx) { Curses_ShowMessage("depth = "); FLUSH_SCANW("%hd", &MaxSearchDepth);