summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
author(no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-01-24 16:55:10 +0000
committer(no author) <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-01-24 16:55:10 +0000
commite38158dfce4969609ab4957446d1d9a631abbfb5 (patch)
tree0b223240cd1fefb86026a273029a0f176f3d2da4 /src/map
parent817a048b554ed05fda836a9b55e0dc9a816334b7 (diff)
downloadhercules-e38158dfce4969609ab4957446d1d9a631abbfb5.tar.gz
hercules-e38158dfce4969609ab4957446d1d9a631abbfb5.tar.bz2
hercules-e38158dfce4969609ab4957446d1d9a631abbfb5.tar.xz
hercules-e38158dfce4969609ab4957446d1d9a631abbfb5.zip
More G++ work
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@976 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/clif.c7
-rw-r--r--src/map/clif.h2
-rw-r--r--src/map/npc.c22
-rw-r--r--src/map/pc.c12
4 files changed, 22 insertions, 21 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 7b088068f..d15fdf3a1 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -7343,7 +7343,8 @@ void clif_parse_WantToConnection(int fd, struct map_session_data *sd)
if (sd != 0)
clif_setwaitclose(sd->fd); // Set session to EOF
} else {
- sd = (struct map_session_data*)session[fd]->session_data = (struct map_session_data*)aCalloc(1, sizeof(struct map_session_data));
+ sd = (struct map_session_data*)aCalloc(1, sizeof(struct map_session_data));
+ session[fd]->session_data = sd;
sd->fd = fd;
if (IS_PACKET_DB_VER(cmd)) {
@@ -10392,7 +10393,7 @@ void clif_parse_debug(int fd,struct map_session_data *sd)
}
// functions list
-static void (*clif_parse_func_table[MAX_PACKET_DB])() = {
+static void (*clif_parse_func_table[MAX_PACKET_DB])(int, struct map_session_data *) = {
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -10745,7 +10746,7 @@ static int packetdb_readdb(void)
char *str[32],*p,*str2[32],*p2,w1[24],w2[24];
struct {
- void (*func)();
+ void (*func)(int, struct map_session_data *);
char *name;
} clif_parse_func[]={
{clif_parse_WantToConnection,"wanttoconnection"},
diff --git a/src/map/clif.h b/src/map/clif.h
index 99e0752d1..17fcfb446 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -18,7 +18,7 @@ typedef unsigned int in_addr_t;
struct packet_db {
short len;
- void (*func)();
+ void (*func)(int, struct map_session_data *);
short pos[20];
};
extern struct packet_db packet_db[MAX_PACKET_VER + 1][MAX_PACKET_DB];
diff --git a/src/map/npc.c b/src/map/npc.c
index 6fd630fd5..349514e3b 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -89,7 +89,7 @@ int npc_enable_sub( struct block_list *bl, va_list ap )
}
int npc_enable(const char *name,int flag)
{
- struct npc_data *nd=strdb_search(npcname_db,name);
+ struct npc_data *nd= (struct npc_data *) strdb_search(npcname_db,name);
if (nd==NULL)
return 0;
@@ -120,7 +120,7 @@ int npc_enable(const char *name,int flag)
*/
struct npc_data* npc_name2id(const char *name)
{
- return strdb_search(npcname_db,name);
+ return (struct npc_data *) strdb_search(npcname_db,name);
}
/*==========================================
* イベントキューのイベント処理
@@ -172,7 +172,7 @@ int npc_event_timer(int tid,unsigned int tick,int id,int data)
int npc_timer_event(const char *eventname) // Added by RoVeRT
{
- struct event_data *ev=strdb_search(ev_db,eventname);
+ struct event_data *ev=(struct event_data *) strdb_search(ev_db,eventname);
struct npc_data *nd;
// int xs,ys;
@@ -245,8 +245,8 @@ int npc_event_export(void *key,void *data,va_list ap)
char *buf;
char *p=strchr(lname,':');
// エクスポートされる
- ev=aCalloc(sizeof(struct event_data), 1);
- buf=aCallocA(50, 1);
+ ev=(struct event_data *) aCalloc(sizeof(struct event_data), 1);
+ buf=(char *) aCallocA(50, 1);
if (ev==NULL || buf==NULL) {
printf("npc_event_export: out of memory !\n");
exit(1);
@@ -460,7 +460,7 @@ int npc_addeventtimer(struct npc_data *nd,int tick,const char *name)
if( nd->eventtimer[i]==-1 )
break;
if(i<MAX_EVENTTIMER){
- char *evname=aMallocA(24);
+ char *evname=(char *) aMallocA(24);
if(evname==NULL){
printf("npc_addeventtimer: out of memory !\n");exit(1);
}
@@ -546,8 +546,8 @@ int npc_timerevent_import(void *key,void *data,va_list ap)
// タイマーイベント
struct npc_timerevent_list *te=nd->u.scr.timer_event;
int j,i=nd->u.scr.timeramount;
- if(te==NULL) te=aMallocA(sizeof(struct npc_timerevent_list));
- else te=aRealloc( te, sizeof(struct npc_timerevent_list) * (i+1) );
+ if(te==NULL) te=(struct npc_timerevent_list*)aMallocA(sizeof(struct npc_timerevent_list));
+ else te= (struct npc_timerevent_list*)aRealloc( te, sizeof(struct npc_timerevent_list) * (i+1) );
if(te==NULL){
printf("npc_timerevent_import: out of memory !\n");
exit(1);
@@ -681,7 +681,7 @@ int npc_settimerevent_tick(struct npc_data *nd,int newtimer)
*/
int npc_event(struct map_session_data *sd,const char *eventname,int mob_kill)
{
- struct event_data *ev=strdb_search(ev_db,eventname);
+ struct event_data *ev=(struct event_data *) strdb_search(ev_db,eventname);
struct npc_data *nd;
int xs,ys;
char mobevent[100];
@@ -697,7 +697,7 @@ int npc_event(struct map_session_data *sd,const char *eventname,int mob_kill)
if(mob_kill && (ev==NULL || (nd=ev->nd)==NULL)){
strcpy( mobevent, eventname);
strcat( mobevent, "::OnMyMobDead");
- ev=strdb_search(ev_db,mobevent);
+ ev= (struct event_data *) strdb_search(ev_db,mobevent);
if (ev==NULL || (nd=ev->nd)==NULL) {
if (strnicmp(eventname,"GM_MONSTER",10)!=0)
printf("npc_event: event not found [%s]\n",mobevent);
@@ -1627,7 +1627,7 @@ static int npc_parse_script(char *w1,char *w2,char *w3,char *w4,char *first_line
if(strcmp(w2,"script")==0){
// スクリプトの解析
- srcbuf=(char *)aCallocA(srcsize,sizeof(char));
+ srcbuf=(unsigned char *)aCallocA(srcsize,sizeof(char));
if (strchr(first_line,'{')) {
strcpy(srcbuf,strchr(first_line,'{'));
startline=*lines;
diff --git a/src/map/pc.c b/src/map/pc.c
index c17e8677b..3713b4409 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -126,7 +126,7 @@ int pc_set_gm_level(int account_id, int level) {
}
GM_num++;
- gm_account = aRealloc(gm_account, sizeof(struct gm_account) * GM_num);
+ gm_account = (struct gm_account *) aRealloc(gm_account, sizeof(struct gm_account) * GM_num);
gm_account[GM_num - 1].account_id = account_id;
gm_account[GM_num - 1].level = level;
return 0;
@@ -6558,7 +6558,7 @@ int pc_setreg(struct map_session_data *sd,int reg,int val)
}
}
sd->reg_num++;
- sd->reg = aRealloc(sd->reg, sizeof(*(sd->reg)) * sd->reg_num);
+ sd->reg = (struct script_reg *) aRealloc(sd->reg, sizeof(*(sd->reg)) * sd->reg_num);
if (sd->reg == NULL){
printf("out of memory : pc_setreg\n");
exit(1);
@@ -6609,7 +6609,7 @@ int pc_setregstr(struct map_session_data *sd,int reg,char *str)
return 0;
}
sd->regstr_num++;
- sd->regstr = aRealloc(sd->regstr, sizeof(sd->regstr[0]) * sd->regstr_num);
+ sd->regstr = (struct script_regstr *) aRealloc(sd->regstr, sizeof(sd->regstr[0]) * sd->regstr_num);
if(sd->regstr==NULL){
printf("out of memory : pc_setreg\n");
exit(1);
@@ -7891,7 +7891,7 @@ int pc_read_gm_account(int fd)
aFree(gm_account);
GM_num = 0;
#ifdef TXT_ONLY
- gm_account = aCallocA(sizeof(struct gm_account) * ((RFIFOW(fd,2) - 4) / 5), 1);
+ gm_account = (struct gm_account *) aCallocA(sizeof(struct gm_account) * ((RFIFOW(fd,2) - 4) / 5), 1);
for (i = 4; i < RFIFOW(fd,2); i = i + 5) {
gm_account[GM_num].account_id = RFIFOL(fd,i);
gm_account[GM_num].level = (int)RFIFOB(fd,i+4);
@@ -7933,7 +7933,7 @@ int map_day_timer(int tid, unsigned int tick, int id, int data) { // by [yor]
strcpy(tmpstr, msg_txt(502)); // The day has arrived!
night_flag = 0; // 0=day, 1=night [Yor]
for(i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth) {
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth) {
pl_sd->opt2 &= ~STATE_BLIND;
clif_changeoption(&pl_sd->bl);
clif_wis_message(pl_sd->fd, wisp_server_name, tmpstr, strlen(tmpstr)+1);
@@ -7959,7 +7959,7 @@ int map_night_timer(int tid, unsigned int tick, int id, int data) { // by [yor]
strcpy(tmpstr, msg_txt(503)); // The night has fallen...
night_flag = 1; // 0=day, 1=night [Yor]
for(i = 0; i < fd_max; i++) {
- if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth && !map[pl_sd->bl.m].flag.indoors) {
+ if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth && !map[pl_sd->bl.m].flag.indoors) {
if (battle_config.night_darkness_level > 0)
clif_specialeffect(&pl_sd->bl, 474 + battle_config.night_darkness_level, 0);
else {