src/game.c

changeset 80
b980a7192b5a
parent 78
ceb9197b3c6d
child 83
ead00609e5e6
--- a/src/game.c	Tue Jun 03 08:43:17 2025 +0200
+++ b/src/game.c	Wed Jun 04 23:56:40 2025 +0200
@@ -75,7 +75,7 @@
 
 static void draw_board(GameState *gamestate,
 		       uint8_t perspective,
-		       _Bool unicode) {
+		       bool unicode) {
     char fen[90];
     compute_fen(fen, gamestate);
     mvaddstr(0, 0, fen);
@@ -98,7 +98,7 @@
                 piecestr[1] = '\0';
             }
             
-            _Bool boardblack = (y&1)==(x&1);
+            bool boardblack = (y&1)==(x&1);
             attrset((col==WHITE ? A_BOLD : A_DIM)|
                 COLOR_PAIR(col == WHITE ?
                     (boardblack ? COL_WB : COL_WW) :
@@ -135,7 +135,7 @@
     }
     
     while (logelem) {
-        _Bool iswhite = (logelem->move.piece & COLOR_MASK) == WHITE;
+        bool iswhite = (logelem->move.piece & COLOR_MASK) == WHITE;
         if (iswhite) {
             logi++;
             printw("%d. ", logi);
@@ -276,7 +276,7 @@
     
     size_t bufpos = 0;
     char movestr[MOVESTR_BUFLEN];
-    _Bool remisrejected = FALSE;
+    bool remisrejected = false;
     uint8_t code;
     
     flushinp();
@@ -328,7 +328,7 @@
                         refresh();
                         return 1;
                     } else {
-                        remisrejected = TRUE;
+                        remisrejected = true;
                     }
                 }
             } else {
@@ -528,7 +528,7 @@
         }
     }
 
-    _Bool running;
+    bool running;
     do {
         clear();
         draw_board(&gamestate, curcol, settings->unicode);
@@ -546,10 +546,10 @@
     uint8_t mycolor = is_server(settings) ? settings->gameinfo.servercolor :
         opponent_color(settings->gameinfo.servercolor);
     
-    _Bool myturn = (gamestate->lastmove ?
+    bool myturn = (gamestate->lastmove ?
         (gamestate->lastmove->move.piece & COLOR_MASK) : BLACK) != mycolor;
     
-    _Bool running;
+    bool running;
     do {
         clear();
         draw_board(gamestate, mycolor, settings->unicode);
@@ -559,7 +559,7 @@
         } else {
             running = !recvmove(gamestate, &(settings->gameinfo), opponent);
         }
-        myturn ^= TRUE;
+        myturn ^= true;
     }  while (running);
     
     post_game(settings, gamestate);

mercurial