Fix use of (COL|ROW)_NAME macros to compute numbers from names.
[gnushogi.git] / gnushogi / cursesdsp.c
index b32181b..3e85a94 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
  *
@@ -30,6 +31,8 @@
  * ----------------------------------------------------------------------
  */
 
+/* request *snprintf prototypes*/
+#define _POSIX_C_SOURCE 200112L
 
 #include <ctype.h>
 #include <signal.h>
@@ -511,8 +514,8 @@ Curses_EditBoard(void)
         }
         else
         {
-            c = COL_NAME(s[1]);
-            r = ROW_NAME(s[2]);
+            c = COL_NUM(s[1]);
+            r = ROW_NUM(s[2]);
         }
 
         if ((c >= 0) && (c < NO_COLS) && (r >= 0) && (r < NO_ROWS))
@@ -854,10 +857,17 @@ Curses_UpdateDisplay(short f, short t, short redraw, short isspec)
         gotoXY(3, 4 + 2*NO_ROWS);
         printw("    ");
 
+#ifndef MINISHOGI
         if (flag.reverse)
             printw("  1    2    3    4    5    6    7    8    9");
         else
             printw("  9    8    7    6    5    4    3    2    1");
+#else
+        if (flag.reverse)
+            printw("  1    2    3    4    5");
+        else
+            printw("  1    2    3    4    5");
+#endif
 
         for (sq = 0; sq < NO_SQUARES; sq++)
             DrawPiece(sq);