diff options
author | Haru <haru@dotalux.com> | 2013-12-10 19:48:55 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2013-12-17 01:11:33 +0100 |
commit | 15a0f6dea6f4f3c5adc9a1bc9e7e8be81cc49c48 (patch) | |
tree | c5dd5b25003f8c21381c7a2e1f010dba71e40b90 /src/map/itemdb.c | |
parent | a23d072a66d2569ba13921522be3c82ae9aad576 (diff) | |
download | hercules-15a0f6dea6f4f3c5adc9a1bc9e7e8be81cc49c48.tar.gz hercules-15a0f6dea6f4f3c5adc9a1bc9e7e8be81cc49c48.tar.bz2 hercules-15a0f6dea6f4f3c5adc9a1bc9e7e8be81cc49c48.tar.xz hercules-15a0f6dea6f4f3c5adc9a1bc9e7e8be81cc49c48.zip |
Fixed several compiler warnings
- Warnings detected thanks to Xcode's compiler settings (more strict by
default) and clang, warnings mostly but not only related to data sizes
on 64 bit systems, that were silenced until now by very lax compiler
settings.
- This also decreases by a great deal the amount of warnings produced by
MSVC in x64 mode (for the adventurous ones who tried that)
- Also fixed (or silenced in case of false positives) the potential
issues pointed out by the (awesome) clang static analyzer.
- Patch co-produced with Ind, I'm merging and committing in his place!
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/itemdb.c')
-rw-r--r-- | src/map/itemdb.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 30f81c354..3f7d06e36 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -806,7 +806,7 @@ bool itemdb_read_cached_packages(const char *config_filename) { for( i = 0; i < pcount; i++ ) { unsigned short id = 0, random_qty = 0, must_qty = 0; - struct item_data *data; + struct item_data *pdata; struct item_package *package = &itemdb->packages[i]; unsigned short c; @@ -817,10 +817,10 @@ bool itemdb_read_cached_packages(const char *config_filename) { //next 2 bytes = random count hread(&random_qty,sizeof(random_qty),1,file); - if( !(data = itemdb->exists(id)) ) + if( !(pdata = itemdb->exists(id)) ) ShowWarning("itemdb_read_packages: unknown package item '%d', skipping..\n",id); else - data->package = &itemdb->packages[i]; + pdata->package = &itemdb->packages[i]; package->id = id; package->random_qty = random_qty; @@ -1022,7 +1022,6 @@ void itemdb_read_packages(void) { for(r = 0; r < highest_gcount; r++) { prev[r] = NULL; } - r = 0; data->package = &itemdb->packages[count]; @@ -1300,7 +1299,7 @@ bool itemdb_read_stack(char* fields[], int columns, int current) } amount = (unsigned short)strtoul(fields[1], NULL, 10); - type = strtoul(fields[2], NULL, 10); + type = (unsigned int)strtoul(fields[2], NULL, 10); if( !amount ) {// ignore |