Fri, 17 Apr 2026 12:00:18 +0200
change return type of write_pgn to void
The return value was always unused and zero.
Then intention apparently was to return the number
of written bytes, but that never happened.
| src/chess/pgn.c | file | annotate | diff | comparison | revisions | |
| src/chess/pgn.h | file | annotate | diff | comparison | revisions |
--- a/src/chess/pgn.c Thu Apr 16 19:59:08 2026 +0200 +++ b/src/chess/pgn.c Fri Apr 17 12:00:18 2026 +0200 @@ -177,10 +177,9 @@ return 0; } -size_t write_pgn(FILE* stream, GameState *gamestate, GameInfo *gameinfo) { +void write_pgn(FILE* stream, GameState *gamestate, GameInfo *gameinfo) { // TODO: tag pairs - size_t bytes = 0; - + /* Result */ char *result; if (gamestate->stalemate || gamestate->remis) { @@ -228,9 +227,6 @@ } else { fprintf(stream, "%s\n", result); } - - - return bytes; } static size_t fen_pieces(char *str, GameState *gamestate) {
--- a/src/chess/pgn.h Thu Apr 16 19:59:08 2026 +0200 +++ b/src/chess/pgn.h Fri Apr 17 12:00:18 2026 +0200 @@ -39,7 +39,7 @@ #endif int read_pgn(FILE *stream, GameState *gamestate, GameInfo *gameinfo); -size_t write_pgn(FILE* stream, GameState *gamestate, GameInfo *gameinfo); +void write_pgn(FILE* stream, GameState *gamestate, GameInfo *gameinfo); void compute_fen(char *str, GameState *gamestate); const char* pgn_error_str(int code);