src/chess/pgn.c

changeset 64
4eda5df55f86
parent 60
0c50aac49e55
child 65
dcc5bd2c56c0
--- a/src/chess/pgn.c	Wed Aug 29 13:45:13 2018 +0200
+++ b/src/chess/pgn.c	Wed Aug 29 13:55:18 2018 +0200
@@ -61,7 +61,7 @@
     char tagkey[32];
     char tagvalue[128];
     
-    // read tag pairs
+    /* read tag pairs */
     _Bool readmoves = 0;
     while (!readmoves) {
         while (isspace(c = fgetc(stream)));
@@ -99,7 +99,7 @@
         }
     }
     
-    // read moves
+    /* read moves */
     if (fgetc(stream) != '.') {
         return pgn_error_missing_dot;
     }
@@ -109,7 +109,7 @@
     uint8_t curcol = WHITE;
     
     while (readmoves) {
-        // move
+        /* move */
         while (isspace(c = fgetc(stream)));
         i = 0;
         do {
@@ -131,7 +131,7 @@
         // TODO: parse comments
         while (isspace(c = fgetc(stream)));
         
-        // end of game data encountered
+        /* end of game data encountered */
         if (c == EOF) {
             break;
         }
@@ -144,15 +144,15 @@
                 gamestate->remis = !gamestate->stalemate;
                 break;
             } else {
-                // oops, it was a move number, go back!
+                /* oops, it was a move number, go back! */
                 fseek(stream, -1, SEEK_CUR);
             }
         }
         
-        // we have eaten the next valuable byte, so go back
+        /* we have eaten the next valuable byte, so go back */
         fseek(stream, -1, SEEK_CUR);
         
-        // skip move number after black move
+        /* skip move number after black move */
         if (curcol == BLACK) {
             while (isdigit(c = fgetc(stream)));
             if (c != '.') {
@@ -169,7 +169,7 @@
     // TODO: tag pairs
     size_t bytes = 0;
     
-    // Result
+    /* Result */
     char *result;
     if (gamestate->stalemate || gamestate->remis) {
         result = "1/2-1/2";
@@ -185,7 +185,7 @@
     }
     fprintf(stream, "[Result \"%s\"]\n\n", result);
     
-    // moves
+    /* moves */
     int i = 1;
     for (MoveList *movelist = gamestate->movelist ;
         movelist ; movelist = movelist->next) {
@@ -198,7 +198,7 @@
         
         // TODO: move time and maybe other comments
         
-        // line break every 10 moves
+        /* line break every 10 moves */
         if (i % 20)  {
             fputc(' ', stream);
         } else {

mercurial