src/chess/pgn.c

changeset 64
4eda5df55f86
parent 60
0c50aac49e55
child 65
dcc5bd2c56c0
     1.1 --- a/src/chess/pgn.c	Wed Aug 29 13:45:13 2018 +0200
     1.2 +++ b/src/chess/pgn.c	Wed Aug 29 13:55:18 2018 +0200
     1.3 @@ -61,7 +61,7 @@
     1.4      char tagkey[32];
     1.5      char tagvalue[128];
     1.6      
     1.7 -    // read tag pairs
     1.8 +    /* read tag pairs */
     1.9      _Bool readmoves = 0;
    1.10      while (!readmoves) {
    1.11          while (isspace(c = fgetc(stream)));
    1.12 @@ -99,7 +99,7 @@
    1.13          }
    1.14      }
    1.15      
    1.16 -    // read moves
    1.17 +    /* read moves */
    1.18      if (fgetc(stream) != '.') {
    1.19          return pgn_error_missing_dot;
    1.20      }
    1.21 @@ -109,7 +109,7 @@
    1.22      uint8_t curcol = WHITE;
    1.23      
    1.24      while (readmoves) {
    1.25 -        // move
    1.26 +        /* move */
    1.27          while (isspace(c = fgetc(stream)));
    1.28          i = 0;
    1.29          do {
    1.30 @@ -131,7 +131,7 @@
    1.31          // TODO: parse comments
    1.32          while (isspace(c = fgetc(stream)));
    1.33          
    1.34 -        // end of game data encountered
    1.35 +        /* end of game data encountered */
    1.36          if (c == EOF) {
    1.37              break;
    1.38          }
    1.39 @@ -144,15 +144,15 @@
    1.40                  gamestate->remis = !gamestate->stalemate;
    1.41                  break;
    1.42              } else {
    1.43 -                // oops, it was a move number, go back!
    1.44 +                /* oops, it was a move number, go back! */
    1.45                  fseek(stream, -1, SEEK_CUR);
    1.46              }
    1.47          }
    1.48          
    1.49 -        // we have eaten the next valuable byte, so go back
    1.50 +        /* we have eaten the next valuable byte, so go back */
    1.51          fseek(stream, -1, SEEK_CUR);
    1.52          
    1.53 -        // skip move number after black move
    1.54 +        /* skip move number after black move */
    1.55          if (curcol == BLACK) {
    1.56              while (isdigit(c = fgetc(stream)));
    1.57              if (c != '.') {
    1.58 @@ -169,7 +169,7 @@
    1.59      // TODO: tag pairs
    1.60      size_t bytes = 0;
    1.61      
    1.62 -    // Result
    1.63 +    /* Result */
    1.64      char *result;
    1.65      if (gamestate->stalemate || gamestate->remis) {
    1.66          result = "1/2-1/2";
    1.67 @@ -185,7 +185,7 @@
    1.68      }
    1.69      fprintf(stream, "[Result \"%s\"]\n\n", result);
    1.70      
    1.71 -    // moves
    1.72 +    /* moves */
    1.73      int i = 1;
    1.74      for (MoveList *movelist = gamestate->movelist ;
    1.75          movelist ; movelist = movelist->next) {
    1.76 @@ -198,7 +198,7 @@
    1.77          
    1.78          // TODO: move time and maybe other comments
    1.79          
    1.80 -        // line break every 10 moves
    1.81 +        /* line break every 10 moves */
    1.82          if (i % 20)  {
    1.83              fputc(' ', stream);
    1.84          } else {

mercurial