summaryrefslogtreecommitdiff
path: root/src/common/utils.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-07-09 20:19:32 -0300
committershennetsind <ind@henn.et>2013-07-09 20:19:32 -0300
commitb08910e828bd6f2029f2434572d8f84b30eb7d9c (patch)
tree28932ba60514fd0483aa5d88e0fa8a43200cac3c /src/common/utils.c
parent55d42874dcf24c466f0104123d9efe280c0fd03c (diff)
downloadhercules-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/utils.c')
-rw-r--r--src/common/utils.c15
1 files changed, 12 insertions, 3 deletions
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;