summaryrefslogtreecommitdiff
path: root/src/char
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-07-14 03:28:53 +0200
committerHaru <haru@dotalux.com>2016-07-14 03:28:53 +0200
commit7bcb379c83327331bda05a23000dc0a6bbbefa48 (patch)
tree5c0911e81606e0c41008a7f8e0b990114ae24051 /src/char
parent968e3cddbd3394607ae34f56ba8ee12d78bad1a5 (diff)
downloadhercules-7bcb379c83327331bda05a23000dc0a6bbbefa48.tar.gz
hercules-7bcb379c83327331bda05a23000dc0a6bbbefa48.tar.bz2
hercules-7bcb379c83327331bda05a23000dc0a6bbbefa48.tar.xz
hercules-7bcb379c83327331bda05a23000dc0a6bbbefa48.zip
Changed mmo_charstatus::base_level and mmo_charstatus::job_level to int
Fixes several -Wsign-compare issues Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/char')
-rw-r--r--src/char/char.c18
-rw-r--r--src/char/inter.c4
2 files changed, 11 insertions, 11 deletions
diff --git a/src/char/char.c b/src/char/char.c
index 5f92e37bf..8dc2661db 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -474,7 +474,7 @@ int char_mmo_char_tosql(int char_id, struct mmo_charstatus* p)
if( p->show_equip )
opt |= OPT_SHOW_EQUIP;
- if( SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `base_level`='%u', `job_level`='%u',"
+ if( SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `base_level`='%d', `job_level`='%d',"
"`base_exp`='%u', `job_exp`='%u', `zeny`='%d',"
"`max_hp`='%d',`hp`='%d',`max_sp`='%d',`sp`='%d',`status_point`='%u',`skill_point`='%u',"
"`str`='%d',`agi`='%d',`vit`='%d',`int`='%d',`dex`='%d',`luk`='%d',"
@@ -958,8 +958,8 @@ int char_mmo_chars_fromsql(struct char_session_data* sd, uint8* buf)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 1, SQLDT_UCHAR, &p.slot, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 2, SQLDT_STRING, &p.name, sizeof(p.name), NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 3, SQLDT_SHORT, &p.class_, 0, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 4, SQLDT_UINT, &p.base_level, 0, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 5, SQLDT_UINT, &p.job_level, 0, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 4, SQLDT_INT, &p.base_level, 0, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 5, SQLDT_INT, &p.job_level, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 6, SQLDT_UINT, &p.base_exp, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 7, SQLDT_UINT, &p.job_exp, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 8, SQLDT_INT, &p.zeny, 0, NULL, NULL)
@@ -1068,8 +1068,8 @@ int char_mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_every
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 2, SQLDT_UCHAR, &p->slot, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 3, SQLDT_STRING, &p->name, sizeof(p->name), NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 4, SQLDT_SHORT, &p->class_, 0, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 5, SQLDT_UINT, &p->base_level, 0, NULL, NULL)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 6, SQLDT_UINT, &p->job_level, 0, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 5, SQLDT_INT, &p->base_level, 0, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 6, SQLDT_INT, &p->job_level, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 7, SQLDT_UINT, &p->base_exp, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 8, SQLDT_UINT, &p->job_exp, 0, NULL, NULL)
|| SQL_ERROR == SQL->StmtBindColumn(stmt, 9, SQLDT_INT, &p->zeny, 0, NULL, NULL)
@@ -4222,7 +4222,7 @@ static void char_delete2_accept(int fd, struct char_session_data* sd)
{// CH: <0829>.W <char id>.L <birth date:YYMMDD>.6B
char birthdate[8+1];
int char_id, i;
- unsigned int base_level;
+ int base_level;
char* data;
time_t delete_date;
@@ -4256,7 +4256,7 @@ static void char_delete2_accept(int fd, struct char_session_data* sd)
return;
}
- SQL->GetData(inter->sql_handle, 0, &data, NULL); base_level = (unsigned int)strtoul(data, NULL, 10);
+ SQL->GetData(inter->sql_handle, 0, &data, NULL); base_level = atoi(data);
SQL->GetData(inter->sql_handle, 1, &data, NULL); delete_date = strtoul(data, NULL, 10);
if( !delete_date || delete_date>time(NULL) )
@@ -4271,8 +4271,8 @@ static void char_delete2_accept(int fd, struct char_session_data* sd)
return;
}
- if( ( char_del_level > 0 && base_level >= (unsigned int)char_del_level ) || ( char_del_level < 0 && base_level <= (unsigned int)(-char_del_level) ) )
- {// character level config restriction
+ if ((char_del_level > 0 && base_level >= char_del_level) || (char_del_level < 0 && base_level <= -char_del_level)) {
+ // character level config restriction
chr->delete2_accept_ack(fd, char_id, 2); // 2: Due to system settings can not be deleted
return;
}
diff --git a/src/char/inter.c b/src/char/inter.c
index d277abec9..756ae32c7 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -474,7 +474,7 @@ void mapif_parse_accinfo(int fd)
inter->msg_to_fd(fd, u_fd, aid, "Your query returned the following %d results, please be more specific...",(int)SQL->NumRows(inter->sql_handle));
while ( SQL_SUCCESS == SQL->NextRow(inter->sql_handle) ) {
int class_;
- short base_level, job_level, online;
+ int base_level, job_level, online;
char name[NAME_LENGTH];
SQL->GetData(inter->sql_handle, 0, &data, NULL); account_id = atoi(data);
@@ -546,7 +546,7 @@ void mapif_parse_accinfo2(bool success, int map_fd, int u_fd, int u_aid, int acc
while ( SQL_SUCCESS == SQL->NextRow(inter->sql_handle) ) {
char *data;
int char_id, class_;
- short char_num, base_level, job_level, online;
+ int char_num, base_level, job_level, online;
char name[NAME_LENGTH];
SQL->GetData(inter->sql_handle, 0, &data, NULL); char_id = atoi(data);