commit - cb3041d16021d46c9d5d0ec1d848ce91702212b4
commit + 854327fe7565ed4ee89ca68b063386fe18154156
blob - 7f5e645fe8251100962ee816376ec3fe9f169e02
blob + 19f0dc70f9fdb00cf2684905d82f079f03e73e9d
--- FICS/gamedb.c
+++ FICS/gamedb.c
Markus Uhlin 25/04/06 Fixed Clang Tidy warnings.
Markus Uhlin 25/07/28 Fixed use of potentially
dangerous functions.
+ Markus Uhlin 25/07/29 Usage of 'int64_t'.
*/
#include "stdinclude.h"
#include <err.h>
#include <errno.h>
+#include <inttypes.h>
#include <limits.h>
+#include <stdint.h>
#include "command.h"
#include "config.h"
ReadV1GameFmt(game *g, FILE *fp, const char *file, int version)
{
int ret[3];
- long int lval;
+ int64_t lval;
_Static_assert(17 < ARRAY_SIZE(g->white_name), "Unexpected array size");
_Static_assert(17 < ARRAY_SIZE(g->black_name), "Unexpected array size");
if (version < 3 && !g->bInitTime)
g->bInitTime = g->wInitTime;
- if (fscanf(fp, "%ld", &lval) != 1) {
+ if (fscanf(fp, "%" SCNd64, &lval) != 1) {
warnx("%s: %s: failed to get time of start", __func__, file);
return -1;
} else
WriteGameFile(FILE *fp, int g)
{
game *gg = &garray[g];
- long int lval;
+ int64_t lval;
player *bp = &parray[gg->black];
player *wp = &parray[gg->white];
gg->bInitTime, gg->bIncrement);
lval = gg->timeOfStart;
- fprintf(fp, "%ld\n", lval);
+ fprintf(fp, "%" PRId64 "\n", lval);
#ifdef TIMESEAL
fprintf(fp, "%d %d\n",