diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/core.c | 6 | ||||
-rw-r--r-- | src/common/utils.c | 15 | ||||
-rw-r--r-- | src/common/utils.h | 3 |
3 files changed, 15 insertions, 9 deletions
diff --git a/src/common/core.c b/src/common/core.c index d2f662551..1e5179448 100644 --- a/src/common/core.c +++ b/src/common/core.c @@ -150,11 +150,6 @@ void signals_init (void) { } #endif -#ifdef SVNVERSION -const char *get_svn_revision(void) { - return EXPAND_AND_QUOTE(SVNVERSION); -} -#else// not SVNVERSION const char* get_svn_revision(void) { static char svn_version_buffer[16] = ""; FILE *fp; @@ -241,7 +236,6 @@ const char* get_svn_revision(void) { svn_version_buffer[0] = HERC_UNKNOWN_VER; return svn_version_buffer; } -#endif /* whats our origin */ #define GIT_ORIGIN "refs/remotes/origin/master" /* Grabs the hash from the last time the user updated his working copy (last pull) */ diff --git a/src/common/utils.c b/src/common/utils.c index 4d6d35c5c..30649e2f5 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -344,8 +344,8 @@ FILE *HCache_open(const char *file, const char *opt) { if( opt[0] != 'r' ) { char dT[1] = "k";/* 1-byte key to ensure our method is the latest, we can modify to ensure the method matches */ - fwrite(dT,sizeof(dT),1,first); - fwrite(&HCache->recompile_time,sizeof(HCache->recompile_time),1,first); + hwrite(dT,sizeof(dT),1,first); + hwrite(&HCache->recompile_time,sizeof(HCache->recompile_time),1,first); } fseek(first, 20, SEEK_SET);/* skip first 20, might wanna store something else later */ @@ -365,10 +365,19 @@ void HCache_init(void) { } else ShowWarning("Unable to open '%s', caching capabilities have been disabled!\n",SERVER_NAME); } +/* transit to fread, shields vs warn_unused_result */ +size_t hread(void * ptr, size_t size, size_t count, FILE * stream) { + return fread(ptr, size, count, stream); +} +/* transit to fwrite, shields vs warn_unused_result */ +size_t hwrite(const void * ptr, size_t size, size_t count, FILE * stream) { + return fwrite(ptr, size, count, stream); +} + void HCache_defaults(void) { HCache = &HCache_s; - + HCache->init = HCache_init; HCache->check = HCache_check; diff --git a/src/common/utils.h b/src/common/utils.h index d245f94e2..b1fb4e3a0 100644 --- a/src/common/utils.h +++ b/src/common/utils.h @@ -31,6 +31,9 @@ extern uint16 GetWord(uint32 val, int idx); extern uint16 MakeWord(uint8 byte0, uint8 byte1); extern uint32 MakeDWord(uint16 word0, uint16 word1); +size_t hread(void * ptr, size_t size, size_t count, FILE * stream); +size_t hwrite(const void * ptr, size_t size, size_t count, FILE * stream); + /* [Ind/Hercules] Caching */ struct HCache_interface { void (*init) (void); |