# HG changeset patch # User Mike Becker # Date 1776420018 -7200 # Node ID 463c648e6a9bcea564da9b0b3e55d00f209ae8b4 # Parent d4f19182fdc23375f8592627f44d5955746b0e8d 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. diff -r d4f19182fdc2 -r 463c648e6a9b src/chess/pgn.c --- 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) { diff -r d4f19182fdc2 -r 463c648e6a9b src/chess/pgn.h --- 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);