From 26b4746f418098207df915e9b7cd26de7fc970a4 Mon Sep 17 00:00:00 2001 From: Masahiko AMANO Date: Fri, 23 Dec 2022 16:33:10 +0300 Subject: [PATCH] fix(core): change hole constants to static class --- include/core.h | 6 +++--- src/core/shoppyou.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/core.h b/include/core.h index 29b638b..b958cb9 100644 --- a/include/core.h +++ b/include/core.h @@ -77,13 +77,13 @@ typedef struct shoppyou { #define HOLE_ID (-1) // Hole sasa constant -const Sasa HOLE_SASA = {HOLE_ID}; +static const Sasa HOLE_SASA = {HOLE_ID}; // Hole tanzaku constant -const Tanzaku HOLE_TANZAKU = {HOLE_ID}; +static const Tanzaku HOLE_TANZAKU = {HOLE_ID}; // Hole kazari constant -const Kazari HOLE_KAZARI = {HOLE_ID}; +static const Kazari HOLE_KAZARI = {HOLE_ID}; // ==================== SASAHYOU SECTION ==================== // diff --git a/src/core/shoppyou.c b/src/core/shoppyou.c index 7ca461d..a2d9c84 100644 --- a/src/core/shoppyou.c +++ b/src/core/shoppyou.c @@ -66,7 +66,7 @@ int shoppyou_save(Shoppyou *shoppyou) { fwrite(&size, 8, 1, shoppyou->file); fflush(shoppyou->file); for (uint64_t i = 0; i < shoppyou->size; i++) { - if (shoppyou->database[i].sasa_id != 0 && shoppyou->database[i].tanzaku_id != 0) { + if (shoppyou->database[i].sasa_id != HOLE_ID && shoppyou->database[i].tanzaku_id != HOLE_ID) { fwrite(&shoppyou->database[i].created_ts, 8, 1, shoppyou->file); fwrite(&shoppyou->database[i].sasa_id, 8, 1, shoppyou->file); fwrite(&shoppyou->database[i].tanzaku_id, 8, 1, shoppyou->file);