Remove more duplicate variable declarations.
[gnushogi.git] / gnushogi / cursesdsp.c
index a42bb26..5d33790 100644 (file)
@@ -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
  *
  * ----------------------------------------------------------------------
  */
 
+/* request *snprintf prototypes*/
+#define _POSIX_C_SOURCE 200112L
 
 #include <ctype.h>
 #include <signal.h>
 #include <stdio.h>
+#include <stdarg.h>
 
 #include <sys/param.h>
 #include <sys/types.h>
 
 #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);