From f204cc7915dac6116bce5f402c8882ea0aff49a4 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@54d463be-8e91-2dee-dedb-b68131a5f0ec> Date: Sat, 5 Feb 2005 04:25:56 +0000 Subject: Fix some compile errors git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1037 54d463be-8e91-2dee-dedb-b68131a5f0ec --- Changelog.txt | 1 + src/char/char.c | 1 + src/common/buffer.h | 2 +- src/login/login.c | 1 + src/map/map.c | 62 +++++++++++++++++++++++++++-------------------------- src/map/npc.c | 14 ++++++------ 6 files changed, 43 insertions(+), 38 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 5dbab7aa2..4cb2220f1 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,6 +1,7 @@ Date Added 02/04 + * Fixed some compile errors [SVN 1037: MouseJstr] * Added common/buffer.(c/h) [SVN 1033: Ajarn] * Login server can now set it's ip address in the config [SVN 1033: Ajarn] * Servers now bind to a single ip address, thus allowing multiple servers to diff --git a/src/char/char.c b/src/char/char.c index caae3c143..70bf4aeb7 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -25,6 +25,7 @@ #include "lock.h" #include "char.h" #include "showmsg.h" +#include "buffer.h" #include "inter.h" #include "int_pet.h" diff --git a/src/common/buffer.h b/src/common/buffer.h index 294233595..4d7f46d38 100644 --- a/src/common/buffer.h +++ b/src/common/buffer.h @@ -15,4 +15,4 @@ #endif -#endif \ No newline at end of file +#endif diff --git a/src/login/login.c b/src/login/login.c index a61210921..5c3888bd4 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -42,6 +42,7 @@ void Gettimeofday(struct timeval *timenow) #include "../common/db.h" #include "../common/lock.h" #include "../common/malloc.h" +#include "../common/buffer.h" #ifdef PASSWORDENC #include "md5calc.h" diff --git a/src/map/map.c b/src/map/map.c index c214f16a2..c0f3aa046 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -117,7 +117,7 @@ static struct dbt * nick_db=NULL; static struct dbt * charid_db=NULL; static int users=0; -static struct block_list *object[MAX_FLOORITEM]; +static struct block_list *objects[MAX_FLOORITEM]; static int first_free_object_id=0,last_object_id=0; #define block_free_max 1048576 @@ -668,7 +668,7 @@ int map_addobject(struct block_list *bl) { if(first_free_object_id<2 || first_free_object_id>=MAX_FLOORITEM) first_free_object_id=2; for(i=first_free_object_id;i=MAX_FLOORITEM){ if(battle_config.error_log) @@ -678,7 +678,7 @@ int map_addobject(struct block_list *bl) { first_free_object_id=i; if(last_object_idid) first_free_object_id=id; - while(last_object_id>2 && object[last_object_id]==NULL) + while(last_object_id>2 && objects[last_object_id]==NULL) last_object_id--; return 0; @@ -715,7 +715,7 @@ int map_delobjectnofree(int id) { *------------------------------------------ */ int map_delobject(int id) { - struct block_list *obj = object[id]; + struct block_list *obj = objects[id]; if(obj==NULL) return 0; @@ -739,15 +739,15 @@ void map_foreachobject(int (*func)(struct block_list*,va_list),int type,...) { va_start(ap,type); for(i=2;i<=last_object_id;i++){ - if(object[i]){ - if(type && object[i]->type!=type) + if(objects[i]){ + if(type && objects[i]->type!=type) continue; if(bl_list_count>=BL_LIST_MAX) { if(battle_config.error_log) printf("map_foreachobject: too many block !\n"); } else - bl_list[bl_list_count++]=object[i]; + bl_list[bl_list_count++]=objects[i]; } } @@ -776,7 +776,7 @@ void map_foreachobject(int (*func)(struct block_list*,va_list),int type,...) { int map_clearflooritem_timer(int tid,unsigned int tick,int id,int data) { struct flooritem_data *fitem=NULL; - fitem = (struct flooritem_data *)object[id]; + fitem = (struct flooritem_data *)objects[id]; if(fitem==NULL || fitem->bl.type!=BL_ITEM || (!data && fitem->cleartimer != tid)){ if(battle_config.error_log) printf("map_clearflooritem_timer : error\n"); @@ -1189,8 +1189,8 @@ struct map_session_data * map_nick2sd(char *nick) { struct block_list * map_id2bl(int id) { struct block_list *bl=NULL; - if(idxs * m->ys * 2); + write_buf = (char *) aMalloc(m->xs * m->ys * 2); len_new = m->xs * m->ys * 2; - encode_zip(write_buf,&len_new,m->gat,m->xs * m->ys); + encode_zip((unsigned char *) write_buf,&len_new,m->gat,m->xs * m->ys); map_cache.map[i].compressed = 1; map_cache.map[i].compressed_len = len_new; } else { len_new = m->xs * m->ys; - write_buf = m->gat; + write_buf = (char *) m->gat; map_cache.map[i].compressed = 0; map_cache.map[i].compressed_len = 0; } @@ -1727,14 +1729,14 @@ static int map_cache_write(struct map_data *m) if(map_cache.map[i].fn[0] == 0) { // 新しい場所に登録 if(map_read_flag == 2) { - write_buf = aMalloc(m->xs * m->ys * 2); + write_buf = (char *) aMalloc(m->xs * m->ys * 2); len_new = m->xs * m->ys * 2; - encode_zip(write_buf,&len_new,m->gat,m->xs * m->ys); + encode_zip((unsigned char *) write_buf,&len_new,m->gat,m->xs * m->ys); map_cache.map[i].compressed = 1; map_cache.map[i].compressed_len = len_new; } else { len_new = m->xs * m->ys; - write_buf = m->gat; + write_buf = (char *) m->gat; map_cache.map[i].compressed = 0; map_cache.map[i].compressed_len = 0; } diff --git a/src/map/npc.c b/src/map/npc.c index cbb6c5495..0519b9925 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -1636,26 +1636,26 @@ static int npc_parse_script(char *w1,char *w2,char *w3,char *w4,char *first_line // スクリプトの解析 srcbuf=(unsigned char *)aCallocA(srcsize,sizeof(char)); if (strchr(first_line,'{')) { - strcpy(srcbuf,strchr(first_line,'{')); + strcpy((char *) srcbuf,strchr(first_line,'{')); startline=*lines; } else srcbuf[0]=0; while(1) { - for(i=strlen(srcbuf)-1;i>=0 && isspace(srcbuf[i]);i--); + for(i=strlen((const char *) srcbuf)-1;i>=0 && isspace(srcbuf[i]);i--); if (i>=0 && srcbuf[i]=='}') break; - fgets(line,1020,fp); + fgets((char *) line,1020,fp); (*lines)++; if (feof(fp)) break; - if (strlen(srcbuf)+strlen(line)+1>=srcsize) { + if (strlen((char *) srcbuf)+strlen((char *) line)+1>=srcsize) { srcsize += 65536; - srcbuf = (char *)aRealloc(srcbuf, srcsize); + srcbuf = (unsigned char *)aRealloc(srcbuf, srcsize); memset(srcbuf + srcsize - 65536, '\0', 65536); } if (srcbuf[0]!='{') { - if (strchr(line,'{')) { - strcpy(srcbuf,strchr(line,'{')); + if (strchr((char *) line,'{')) { + strcpy(srcbuf,strchr((const char *) line,'{')); startline=*lines; } } else -- cgit v1.2.3-70-g09d2