summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorflaviojs <flaviojs@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-09-08 19:47:26 +0000
committerflaviojs <flaviojs@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-09-08 19:47:26 +0000
commit6fc804e12ad7db569e82229cc11a361066cec682 (patch)
treeddfdf820c20e373e6666b6ae4428099702b47744 /src/map
parent49a1de65bf592bbfe194a06b2b4c41f9865ea8b3 (diff)
downloadhercules-6fc804e12ad7db569e82229cc11a361066cec682.tar.gz
hercules-6fc804e12ad7db569e82229cc11a361066cec682.tar.bz2
hercules-6fc804e12ad7db569e82229cc11a361066cec682.tar.xz
hercules-6fc804e12ad7db569e82229cc11a361066cec682.zip
* Fix C++ compilation issues.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14955 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/clif.c2
-rw-r--r--src/map/map.c8
-rw-r--r--src/map/mob.c26
-rw-r--r--src/map/npc.c2
-rw-r--r--src/map/npc_chat.c14
-rw-r--r--src/map/script.c2
-rw-r--r--src/map/searchstore.c4
-rw-r--r--src/map/status.c2
-rw-r--r--src/map/status.h2
9 files changed, 33 insertions, 29 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 5e8ef2367..5d6a828d3 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -11160,7 +11160,7 @@ void clif_parse_GuildChangeEmblem(int fd,struct map_session_data *sd)
return;
}
- guild_change_emblem(sd, emblem_len, emblem);
+ guild_change_emblem(sd, emblem_len, (const char*)emblem);
}
/*==========================================
diff --git a/src/map/map.c b/src/map/map.c
index 559cab96d..39077de6c 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -2676,7 +2676,7 @@ static char *map_init_mapcache(FILE *fp)
fseek(fp, 0, SEEK_SET);
// Allocate enough space
- CREATE(buffer, unsigned char, size);
+ CREATE(buffer, char, size);
// No memory? Return..
nullpo_ret(buffer);
@@ -2699,7 +2699,7 @@ int map_readfromcache(struct map_data *m, char *buffer, char *decode_buffer)
int i;
struct map_cache_main_header *header = (struct map_cache_main_header *)buffer;
struct map_cache_map_info *info = NULL;
- unsigned char *p = buffer + sizeof(struct map_cache_main_header);
+ char *p = buffer + sizeof(struct map_cache_main_header);
for(i = 0; i < header->map_count; i++) {
info = (struct map_cache_map_info *)p;
@@ -2906,8 +2906,8 @@ int map_readallmaps (void)
int i;
FILE* fp=NULL;
int maps_removed = 0;
- unsigned char *map_cache_buffer = NULL; // Has the uncompressed gat data of all maps, so just one allocation has to be made
- unsigned char map_cache_decode_buffer[MAX_MAP_SIZE];
+ char *map_cache_buffer = NULL; // Has the uncompressed gat data of all maps, so just one allocation has to be made
+ char map_cache_decode_buffer[MAX_MAP_SIZE];
if( enable_grf )
ShowStatus("Loading maps (using GRF files)...\n");
diff --git a/src/map/mob.c b/src/map/mob.c
index c20672a13..5272b17e8 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -3964,6 +3964,21 @@ static bool mob_parse_row_mobskilldb(char** str, int columns, int current)
static const struct {
char str[32];
enum MobSkillState id;
+ } state[] = {
+ { "any", MSS_ANY }, //All states except Dead
+ { "idle", MSS_IDLE },
+ { "walk", MSS_WALK },
+ { "loot", MSS_LOOT },
+ { "dead", MSS_DEAD },
+ { "attack", MSS_BERSERK }, //Retaliating attack
+ { "angry", MSS_ANGRY }, //Preemptive attack (aggressive mobs)
+ { "chase", MSS_RUSH }, //Chase escaping target
+ { "follow", MSS_FOLLOW }, //Preemptive chase (aggressive mobs)
+ { "anytarget",MSS_ANYTARGET }, //Berserk+Angry+Rush+Follow
+ };
+ static const struct {
+ char str[32];
+ int id;
} cond1[] = {
{ "always", MSC_ALWAYS },
{ "myhpltmaxrate", MSC_MYHPLTMAXRATE },
@@ -4001,17 +4016,6 @@ static bool mob_parse_row_mobskilldb(char** str, int columns, int current)
{ "blind", SC_BLIND },
{ "hiding", SC_HIDING },
{ "sight", SC_SIGHT },
- }, state[] = {
- { "any", MSS_ANY }, //All states except Dead
- { "idle", MSS_IDLE },
- { "walk", MSS_WALK },
- { "loot", MSS_LOOT },
- { "dead", MSS_DEAD },
- { "attack", MSS_BERSERK }, //Retaliating attack
- { "angry", MSS_ANGRY }, //Preemptive attack (aggressive mobs)
- { "chase", MSS_RUSH }, //Chase escaping target
- { "follow", MSS_FOLLOW }, //Preemptive chase (aggressive mobs)
- { "anytarget",MSS_ANYTARGET }, //Berserk+Angry+Rush+Follow
}, target[] = {
{ "target", MST_TARGET },
{ "randomtarget", MST_RANDOM },
diff --git a/src/map/npc.c b/src/map/npc.c
index dd3a671b0..ceb1f3f1d 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -2340,7 +2340,7 @@ const char* npc_parse_duplicate(char* w1, char* w2, char* w3, char* w4, const ch
nd->speed = 200;
nd->src_id = src_id;
nd->bl.type = BL_NPC;
- nd->subtype = type;
+ nd->subtype = (enum npc_subtype)type;
switch( type )
{
case SCRIPT:
diff --git a/src/map/npc_chat.c b/src/map/npc_chat.c
index 99fa40a20..77c875a7e 100644
--- a/src/map/npc_chat.c
+++ b/src/map/npc_chat.c
@@ -73,8 +73,8 @@
struct pcrematch_entry {
struct pcrematch_entry* next;
char* pattern;
- pcre* pcre;
- pcre_extra* pcre_extra;
+ pcre* pcre_;
+ pcre_extra* pcre_extra_;
char* label;
};
@@ -108,8 +108,8 @@ struct npc_parse {
*/
void finalize_pcrematch_entry(struct pcrematch_entry* e)
{
- pcre_free(e->pcre);
- pcre_free(e->pcre_extra);
+ pcre_free(e->pcre_);
+ pcre_free(e->pcre_extra_);
aFree(e->pattern);
aFree(e->label);
}
@@ -316,8 +316,8 @@ void npc_chat_def_pattern(struct npc_data* nd, int setid, const char* pattern, c
struct pcrematch_entry *e = create_pcrematch_entry(s);
e->pattern = aStrdup(pattern);
e->label = aStrdup(label);
- e->pcre = pcre_compile(pattern, PCRE_CASELESS, &err, &erroff, NULL);
- e->pcre_extra = pcre_study(e->pcre, 0, &err);
+ e->pcre_ = pcre_compile(pattern, PCRE_CASELESS, &err, &erroff, NULL);
+ e->pcre_extra_ = pcre_study(e->pcre_, 0, &err);
}
/**
@@ -373,7 +373,7 @@ int npc_chat_sub(struct block_list* bl, va_list ap)
int offsets[2*10 + 10]; // 1/3 reserved for temp space requred by pcre_exec
// perform pattern match
- int r = pcre_exec(e->pcre, e->pcre_extra, msg, len, 0, 0, offsets, ARRAYLENGTH(offsets));
+ int r = pcre_exec(e->pcre_, e->pcre_extra_, msg, len, 0, 0, offsets, ARRAYLENGTH(offsets));
if (r > 0)
{
// save out the matched strings
diff --git a/src/map/script.c b/src/map/script.c
index 66b61a419..0da5e21aa 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -901,7 +901,7 @@ int add_word(const char* p)
disp_error_message("script:add_word: invalid word. A word consists of undercores and/or alfanumeric characters, and valid variable prefixes/postfixes.", p);
// Duplicate the word
- word = aMalloc(len+1);
+ word = (char*)aMalloc(len+1);
memcpy(word, p, len);
word[len] = 0;
diff --git a/src/map/searchstore.c b/src/map/searchstore.c
index 76f0d4e2e..c59c13bed 100644
--- a/src/map/searchstore.c
+++ b/src/map/searchstore.c
@@ -184,7 +184,7 @@ void searchstore_query(struct map_session_data* sd, unsigned char type, unsigned
searchstore_clear(sd);
// allocate max. amount of results
- sd->searchstore.items = aMalloc(sizeof(struct s_search_store_info_item)*battle_config.searchstore_maxresults);
+ sd->searchstore.items = (struct s_search_store_info_item*)aMalloc(sizeof(struct s_search_store_info_item)*battle_config.searchstore_maxresults);
// search
s.search_sd = sd;
@@ -215,7 +215,7 @@ void searchstore_query(struct map_session_data* sd, unsigned char type, unsigned
if( sd->searchstore.count )
{
// reclaim unused memory
- sd->searchstore.items = aRealloc(sd->searchstore.items, sizeof(struct s_search_store_info_item)*sd->searchstore.count);
+ sd->searchstore.items = (struct s_search_store_info_item*)aRealloc(sd->searchstore.items, sizeof(struct s_search_store_info_item)*sd->searchstore.count);
// present results
clif_search_store_info_ack(sd);
diff --git a/src/map/status.c b/src/map/status.c
index 00708428e..89ad5c483 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -2723,7 +2723,7 @@ void status_calc_regen_rate(struct block_list *bl, struct regen_data *regen, str
/// Recalculates parts of an object's battle status according to the specified flags.
/// @param flag bitfield of values from enum scb_flag
-void status_calc_bl_main(struct block_list *bl, enum scb_flag flag)
+void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag)
{
const struct status_data *b_status = status_get_base_status(bl);
struct status_data *status = status_get_status_data(bl);
diff --git a/src/map/status.h b/src/map/status.h
index c7ad8a9cf..d3f5a2f48 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -1293,7 +1293,7 @@ int status_change_timer_sub(struct block_list* bl, va_list ap);
int status_change_clear(struct block_list* bl, int type);
int status_change_clear_buffs(struct block_list* bl, int type);
-#define status_calc_bl(bl, flag) status_calc_bl_(bl, flag, false)
+#define status_calc_bl(bl, flag) status_calc_bl_(bl, (enum scb_flag)(flag), false)
#define status_calc_mob(md, first) status_calc_bl_(&(md)->bl, SCB_ALL, first)
#define status_calc_pet(pd, first) status_calc_bl_(&(pd)->bl, SCB_ALL, first)
#define status_calc_pc(sd, first) status_calc_bl_(&(sd)->bl, SCB_ALL, first)