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);