summaryrefslogtreecommitdiff
path: root/src/map/chrif.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-01-07 16:47:24 +0100
committerHaru <haru@dotalux.com>2016-02-24 21:00:26 +0100
commit3188738be5ee78651e31c1340fac7fed81bbefb5 (patch)
tree97ea854a3c77884e817c02dc069b980ccc42ee74 /src/map/chrif.c
parenta79ab6c3d11c7d6fcd1f04400f50b93f72e570e1 (diff)
downloadhercules-3188738be5ee78651e31c1340fac7fed81bbefb5.tar.gz
hercules-3188738be5ee78651e31c1340fac7fed81bbefb5.tar.bz2
hercules-3188738be5ee78651e31c1340fac7fed81bbefb5.tar.xz
hercules-3188738be5ee78651e31c1340fac7fed81bbefb5.zip
Removed several unnecessary RFIFOP typecasts
- While this is arguable, those explicit typecasts are potentially dangerous/misleading (for example, a const specifier might get accidentally dropped without even generating a compiler warning, or a variable type might change during code changes, and any related warning would get silenced by the explicit typecast). - As a reminder Hercules is written in C, and not in C++ (and there's no such thing as "compiling in C++ mode" - they're two different languages.) As such, it is legal to let the compiler automatically promote void* from/to any non-const pointer type, as well as const void* from/to any const pointer type. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/chrif.c')
-rw-r--r--src/map/chrif.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c
index e14684e54..343892782 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -611,7 +611,7 @@ void chrif_authok(int fd) {
expiration_time = (time_t)(int32)RFIFOL(fd,16);
group_id = RFIFOL(fd,20);
changing_mapservers = (RFIFOB(fd,24));
- charstatus = (struct mmo_charstatus*)RFIFOP(fd,25);
+ charstatus = RFIFOP(fd,25);
char_id = charstatus->char_id;
//Check if we don't already have player data in our server
@@ -1221,7 +1221,7 @@ bool chrif_load_scdata(int fd) {
count = RFIFOW(fd,12); //sc_count
for (i = 0; i < count; i++) {
- const struct status_change_data *data = (struct status_change_data*)RFIFOP(fd,14 + i*sizeof(struct status_change_data));
+ const struct status_change_data *data = RFIFOP(fd,14 + i*sizeof(struct status_change_data));
status->change_start(NULL, &sd->bl, (sc_type)data->type, 10000, data->val1, data->val2, data->val3, data->val4,
data->tick, SCFLAG_NOAVOID|SCFLAG_FIXEDTICK|SCFLAG_LOADED|SCFLAG_FIXEDRATE);
}
@@ -1436,10 +1436,10 @@ int chrif_parse(int fd) {
case 0x2b03: clif->charselectok(RFIFOL(fd,2), RFIFOB(fd,6)); break;
case 0x2b04: chrif->recvmap(fd); break;
case 0x2b06: chrif->changemapserverack(RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOL(fd,14), RFIFOW(fd,18), RFIFOW(fd,20), RFIFOW(fd,22), RFIFOL(fd,24), RFIFOW(fd,28)); break;
- case 0x2b09: map->addnickdb(RFIFOL(fd,2), (char*)RFIFOP(fd,6)); break;
+ case 0x2b09: map->addnickdb(RFIFOL(fd,2), RFIFOP(fd,6)); break;
case 0x2b0a: sockt->datasync(fd, false); break;
case 0x2b0d: chrif->changedsex(fd); break;
- case 0x2b0f: chrif->char_ask_name_answer(RFIFOL(fd,2), (char*)RFIFOP(fd,6), RFIFOW(fd,30), RFIFOW(fd,32)); break;
+ case 0x2b0f: chrif->char_ask_name_answer(RFIFOL(fd,2), RFIFOP(fd,6), RFIFOW(fd,30), RFIFOW(fd,32)); break;
case 0x2b12: chrif->divorceack(RFIFOL(fd,2), RFIFOL(fd,6)); break;
case 0x2b14: chrif->idbanned(fd); break;
case 0x2b1b: chrif->recvfamelist(fd); break;