Convert more stuff from #ifdef to dspwrappers: AlwaysShowMessage.
[gnushogi.git] / gnushogi / commondsp.c
index ea38293..7987307 100644 (file)
@@ -298,20 +298,7 @@ VerifyMove(char *s, VerifyMove_mode iop, unsigned short *mv)
         if (SqAttacked(PieceList[opponent][0], computer, &blocked))
         {
             UnmakeMove(opponent, &xnode, &tempb, &tempc, &tempsf, &tempst);
-
-            if (NOT_CURSES)
-            {
-                /* Illegal move in check */
-                printf(CP[77], mvstr[0]);
-                printf("\n");
-            }
-            else
-            {
-                /* Illegal move in check */
-                sprintf(buffer, CP[77], s);
-                ShowMessage(buffer);
-            }
-
+            AlwaysShowMessage(CP[77], s);
             return false;
         }
         else
@@ -353,17 +340,7 @@ VerifyMove(char *s, VerifyMove_mode iop, unsigned short *mv)
         }
     }
 
-    if (NOT_CURSES)
-    {
-        /* Illegal move */
-        printf (CP[75], s);
-    }
-    else /* Curses. */
-    {
-        /* Illegal move */
-        sprintf(buffer, CP[76], s);
-        ShowMessage(buffer);
-    }
+    AlwaysShowMessage(CP[76], s);
 
     if (!barebones && (cnt > 1))
     {
@@ -1385,7 +1362,7 @@ TestSpeed(void(*f)(short side, short ply,
 #endif
 
     unsigned i;
-    long cnt, rate, t1, t2;
+    long cnt, t1, t2;
 
 #ifdef HAVE_GETTIMEOFDAY
     struct timeval tv;
@@ -1425,17 +1402,7 @@ TestSpeed(void(*f)(short side, short ply,
     else
         et = 1;
 
-    rate = (((et) ? ((cnt * 100) / et) : 0));
-
-#ifdef DYNAMIC_ZNODES
-    if (rate > 0)
-        znodes = rate;
-#endif
-
-    if (NOT_CURSES)
-        printf(CP[91], cnt, rate);
-    else
-        ShowNodeCnt(cnt);
+    ShowNodeCnt(cnt);
 }
 
 
@@ -1444,7 +1411,7 @@ void
 TestPSpeed(short(*f) (short side), unsigned j)
 {
     short i;
-    long cnt, rate, t1, t2;
+    long cnt, t1, t2;
 #ifdef HAVE_GETTIMEOFDAY
     struct timeval tv;
 #endif
@@ -1473,14 +1440,7 @@ TestPSpeed(short(*f) (short side), unsigned j)
     else
         et = 1;
 
-    rate = (et) ? ((cnt * 100) / et) : 0;
-
-    /* printf("Nodes= %ld Nodes/sec= %ld\n", cnt, rate); */
-
-    if (NOT_CURSES)
-        printf(CP[91], cnt, rate);
-    else
-        ShowNodeCnt(cnt);
+    ShowNodeCnt(cnt);
 }