diff options
author | shennetsind <ind@henn.et> | 2013-07-09 20:19:32 -0300 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2013-07-09 20:19:32 -0300 |
commit | b08910e828bd6f2029f2434572d8f84b30eb7d9c (patch) | |
tree | 28932ba60514fd0483aa5d88e0fa8a43200cac3c /src/common | |
parent | 55d42874dcf24c466f0104123d9efe280c0fd03c (diff) | |
download | hercules-b08910e828bd6f2029f2434572d8f84b30eb7d9c.tar.gz hercules-b08910e828bd6f2029f2434572d8f84b30eb7d9c.tar.bz2 hercules-b08910e828bd6f2029f2434572d8f84b30eb7d9c.tar.xz hercules-b08910e828bd6f2029f2434572d8f84b30eb7d9c.zip |
Travis Report Fixes
warn_unused_result shielding, dropped unused variables and fixed battle_calc_return_damage delay behavior (pointer was unchaged; resulting in the var afterwards always as 0)
Special Thanks to Xgear.
Signed-off-by: shennetsind <ind@henn.et>
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); |