Fix use of (COL|ROW)_NAME macros to compute numbers from names.
[gnushogi.git] / gnushogi / gnushogi.h
index 677d22c..48408d7 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
  *
@@ -181,6 +182,8 @@ extern void movealgbr(short m, char *s);
 
 #define ROW_NAME(n) ('a' + NO_ROWS - 1 - n)
 #define COL_NAME(n) ('1' + NO_COLS - 1 - n)
+#define ROW_NUM(c) ('a' + NO_ROWS - 1 - c)
+#define COL_NUM(c) ('1' + NO_COLS - 1 - c)
 
 #if defined HASHFILE || defined CACHE
 #  define PTBLBDSIZE (NO_SQUARES + NO_PIECES)