summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-02-19 12:43:43 +0100
committerHaru <haru@dotalux.com>2016-02-24 21:00:33 +0100
commit1723d1d8cd0684c01e4f48d4dc1ea426c750e2ca (patch)
tree179bca6aa45cf1f1db7139ab7e7b806669587905 /src
parent9ee166316cded9aad0ace7e13f43a406f0e5400c (diff)
downloadhercules-1723d1d8cd0684c01e4f48d4dc1ea426c750e2ca.tar.gz
hercules-1723d1d8cd0684c01e4f48d4dc1ea426c750e2ca.tar.bz2
hercules-1723d1d8cd0684c01e4f48d4dc1ea426c750e2ca.tar.xz
hercules-1723d1d8cd0684c01e4f48d4dc1ea426c750e2ca.zip
Removed various redundant typecasts
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src')
-rw-r--r--src/char/int_elemental.c6
-rw-r--r--src/char/int_homun.c13
-rw-r--r--src/char/int_mercenary.c7
-rw-r--r--src/login/login.c12
-rw-r--r--src/map/clif.c16
5 files changed, 26 insertions, 28 deletions
diff --git a/src/char/int_elemental.c b/src/char/int_elemental.c
index fe8bab0de..d4b8dfea6 100644
--- a/src/char/int_elemental.c
+++ b/src/char/int_elemental.c
@@ -211,10 +211,10 @@ void inter_elemental_sql_final(void) {
int inter_elemental_parse_frommap(int fd) {
unsigned short cmd = RFIFOW(fd,0);
- switch( cmd ) {
+ switch (cmd) {
case 0x307c: mapif->parse_elemental_create(fd, RFIFOP(fd,4)); break;
- case 0x307d: mapif->parse_elemental_load(fd, (int)RFIFOL(fd,2), (int)RFIFOL(fd,6)); break;
- case 0x307e: mapif->parse_elemental_delete(fd, (int)RFIFOL(fd,2)); break;
+ case 0x307d: mapif->parse_elemental_load(fd, RFIFOL(fd,2), RFIFOL(fd,6)); break;
+ case 0x307e: mapif->parse_elemental_delete(fd, RFIFOL(fd,2)); break;
case 0x307f: mapif->parse_elemental_save(fd, RFIFOP(fd,4)); break;
default:
return 0;
diff --git a/src/char/int_homun.c b/src/char/int_homun.c
index f084b9709..e5fde2330 100644
--- a/src/char/int_homun.c
+++ b/src/char/int_homun.c
@@ -345,13 +345,12 @@ int inter_homunculus_parse_frommap(int fd)
{
unsigned short cmd = RFIFOW(fd,0);
- switch( cmd )
- {
- case 0x3090: mapif->parse_homunculus_create(fd, (int)RFIFOW(fd,2), (int)RFIFOL(fd,4), RFIFOP(fd,8)); break;
- case 0x3091: mapif->parse_homunculus_load (fd, (int)RFIFOL(fd,2), (int)RFIFOL(fd,6)); break;
- case 0x3092: mapif->parse_homunculus_save (fd, (int)RFIFOW(fd,2), (int)RFIFOL(fd,4), RFIFOP(fd,8)); break;
- case 0x3093: mapif->parse_homunculus_delete(fd, (int)RFIFOL(fd,2)); break;
- case 0x3094: mapif->parse_homunculus_rename(fd, (int)RFIFOL(fd,2), (int)RFIFOL(fd,6), RFIFOP(fd,10)); break;
+ switch (cmd) {
+ case 0x3090: mapif->parse_homunculus_create(fd, RFIFOW(fd,2), RFIFOL(fd,4), RFIFOP(fd,8)); break;
+ case 0x3091: mapif->parse_homunculus_load (fd, RFIFOL(fd,2), RFIFOL(fd,6)); break;
+ case 0x3092: mapif->parse_homunculus_save (fd, RFIFOW(fd,2), RFIFOL(fd,4), RFIFOP(fd,8)); break;
+ case 0x3093: mapif->parse_homunculus_delete(fd, RFIFOL(fd,2)); break;
+ case 0x3094: mapif->parse_homunculus_rename(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOP(fd,10)); break;
default:
return 0;
}
diff --git a/src/char/int_mercenary.c b/src/char/int_mercenary.c
index 0c3a7fdf8..0bc3c0909 100644
--- a/src/char/int_mercenary.c
+++ b/src/char/int_mercenary.c
@@ -260,11 +260,10 @@ int inter_mercenary_parse_frommap(int fd)
{
unsigned short cmd = RFIFOW(fd,0);
- switch( cmd )
- {
+ switch (cmd) {
case 0x3070: mapif->parse_mercenary_create(fd, RFIFOP(fd,4)); break;
- case 0x3071: mapif->parse_mercenary_load(fd, (int)RFIFOL(fd,2), (int)RFIFOL(fd,6)); break;
- case 0x3072: mapif->parse_mercenary_delete(fd, (int)RFIFOL(fd,2)); break;
+ case 0x3071: mapif->parse_mercenary_load(fd, RFIFOL(fd,2), RFIFOL(fd,6)); break;
+ case 0x3072: mapif->parse_mercenary_delete(fd, RFIFOL(fd,2)); break;
case 0x3073: mapif->parse_mercenary_save(fd, RFIFOP(fd,4)); break;
default:
return 0;
diff --git a/src/login/login.c b/src/login/login.c
index 73d2be9dd..bd826b300 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -527,12 +527,12 @@ void login_fromchar_parse_ban(int fd, int id, const char *const ip)
struct mmo_account acc;
int account_id = RFIFOL(fd,2);
- int year = (short)RFIFOW(fd,6);
- int month = (short)RFIFOW(fd,8);
- int mday = (short)RFIFOW(fd,10);
- int hour = (short)RFIFOW(fd,12);
- int min = (short)RFIFOW(fd,14);
- int sec = (short)RFIFOW(fd,16);
+ int year = RFIFOW(fd,6);
+ int month = RFIFOW(fd,8);
+ int mday = RFIFOW(fd,10);
+ int hour = RFIFOW(fd,12);
+ int min = RFIFOW(fd,14);
+ int sec = RFIFOW(fd,16);
RFIFOSKIP(fd,18);
if (!accounts->load_num(accounts, &acc, account_id)) {
diff --git a/src/map/clif.c b/src/map/clif.c
index fdc6c9c63..5e0c6f568 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -10850,7 +10850,7 @@ void clif_parse_ChangeCart(int fd,struct map_session_data *sd)
}
#endif
- type = (int)RFIFOW(fd,2);
+ type = RFIFOW(fd,2);
#ifdef NEW_CARTS
if( (type == 9 && sd->status.base_level > 131) ||
(type == 8 && sd->status.base_level > 121) ||
@@ -10881,7 +10881,7 @@ void clif_parse_SelectCart(int fd, struct map_session_data *sd)
if (!sd || !pc->checkskill(sd, MC_CARTDECORATE) || RFIFOL(fd, 2) != sd->status.account_id)
return;
- type = (int)RFIFOB(fd, 6);
+ type = RFIFOB(fd, 6);
if (type <= MAX_BASE_CARTS || type > MAX_CARTS)
return;
@@ -11424,7 +11424,7 @@ void clif_parse_NpcAmountInput(int fd,struct map_session_data *sd) __attribute__
void clif_parse_NpcAmountInput(int fd,struct map_session_data *sd)
{
int npcid = RFIFOL(fd,2);
- int amount = (int)RFIFOL(fd,6);
+ int amount = RFIFOL(fd,6);
if (amount >= 0)
sd->npc_amount = amount;
@@ -12608,7 +12608,7 @@ void clif_parse_PurchaseReq(int fd, struct map_session_data* sd) __attribute__((
void clif_parse_PurchaseReq(int fd, struct map_session_data* sd)
{
int len = (int)RFIFOW(fd,2) - 8;
- int id = (int)RFIFOL(fd,4);
+ int id = RFIFOL(fd,4);
const uint8 *data = RFIFOP(fd,8);
vending->purchase(sd, id, sd->vended_id, data, len/4);
@@ -12623,8 +12623,8 @@ void clif_parse_PurchaseReq2(int fd, struct map_session_data* sd) __attribute__(
void clif_parse_PurchaseReq2(int fd, struct map_session_data* sd)
{
int len = (int)RFIFOW(fd,2) - 12;
- int aid = (int)RFIFOL(fd,4);
- int uid = (int)RFIFOL(fd,8);
+ int aid = RFIFOL(fd,4);
+ int uid = RFIFOL(fd,8);
const uint8 *data = RFIFOP(fd,12);
vending->purchase(sd, aid, uid, data, len/4);
@@ -12643,7 +12643,7 @@ void clif_parse_OpenVending(int fd, struct map_session_data* sd) __attribute__((
void clif_parse_OpenVending(int fd, struct map_session_data* sd) {
short len = (short)RFIFOW(fd,2) - 85;
const char *message = RFIFOP(fd,4);
- bool flag = (bool)RFIFOB(fd,84);
+ bool flag = (RFIFOB(fd,84) != 0) ? true : false;
const uint8 *data = RFIFOP(fd,85);
if( !flag )
@@ -15594,7 +15594,7 @@ void clif_parse_EquipTick(int fd, struct map_session_data* sd) __attribute__((no
/// 1 = enabled
void clif_parse_EquipTick(int fd, struct map_session_data* sd)
{
- bool flag = (bool)RFIFOL(fd,6);
+ bool flag = (RFIFOL(fd,6) != 0) ? true : false;
sd->status.show_equip = flag;
clif->equiptickack(sd, flag);
}