diff options
author | amber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-12-20 20:03:39 +0000 |
---|---|---|
committer | amber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2004-12-20 20:03:39 +0000 |
commit | b618a5972a3fe0add853a578d0dd8b05a2e32261 (patch) | |
tree | 9a024c0090c266be3c56754c1378b8b2af661131 /src | |
parent | 1873f00935e96730fdb52ca357ffbd2311d79bec (diff) | |
download | hercules-b618a5972a3fe0add853a578d0dd8b05a2e32261.tar.gz hercules-b618a5972a3fe0add853a578d0dd8b05a2e32261.tar.bz2 hercules-b618a5972a3fe0add853a578d0dd8b05a2e32261.tar.xz hercules-b618a5972a3fe0add853a578d0dd8b05a2e32261.zip |
gcc 2.95 compile fixes
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@678 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/common/socket.c | 44 | ||||
-rw-r--r-- | src/map/pc.c | 4 | ||||
-rw-r--r-- | src/map/skill.c | 3 |
3 files changed, 4 insertions, 47 deletions
diff --git a/src/common/socket.c b/src/common/socket.c index 497564298..dfeebf03a 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -36,10 +36,6 @@ int fd_max; int rfifo_size = 65536; int wfifo_size = 65536; -#ifdef TWILIGHT -#define NSOCKET -#endif - #ifndef TCP_FRAME_LEN #define TCP_FRAME_LEN 1053 #endif @@ -61,7 +57,6 @@ void set_defaultparse(int (*defaultparse)(int)) default_func_parse = defaultparse; } -#ifdef NSOCKET static void setsocketopts(int fd) { int yes = 1; // reuse fix @@ -76,7 +71,6 @@ static void setsocketopts(int fd) setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *) &rfifo_size , sizeof(rfifo_size )); } -#endif /* NSOCKET */ /*====================================== * CORE : Socket Sub Function *-------------------------------------- @@ -172,9 +166,6 @@ static int connect_client(int listen_fd) struct sockaddr_in client_address; int len; int result; -#ifndef NSOCKET - int yes = 1; // reuse fix -#endif /* not NSOCKET */ //printf("connect_client : %d\n",listen_fd); @@ -183,15 +174,7 @@ static int connect_client(int listen_fd) fd=accept(listen_fd,(struct sockaddr*)&client_address,&len); if(fd_max<=fd) fd_max=fd+1; -#ifndef NSOCKET - setsockopt(fd,SOL_SOCKET,SO_REUSEADDR,(char *)&yes,sizeof yes); -#ifdef SO_REUSEPORT - setsockopt(fd,SOL_SOCKET,SO_REUSEPORT,(char *)&yes,sizeof yes); -#endif - setsockopt(fd,IPPROTO_TCP,TCP_NODELAY,(char *)&yes,sizeof yes); -#else /* NSOCKET */ setsocketopts(fd); -#endif /* NSOCKET */ if(fd==-1) perror("accept"); @@ -227,9 +210,6 @@ int make_listen_port(int port) struct sockaddr_in server_address; int fd; int result; -#ifndef NSOCKET - int yes = 1; // reuse fix -#endif /* not NSOCKET */ fd = socket( AF_INET, SOCK_STREAM, 0 ); if(fd_max<=fd) fd_max=fd+1; @@ -243,15 +223,7 @@ int make_listen_port(int port) result = fcntl(fd, F_SETFL, O_NONBLOCK); #endif -#ifndef NSOCKET - setsockopt(fd,SOL_SOCKET,SO_REUSEADDR,(char *)&yes,sizeof yes); -#ifdef SO_REUSEPORT - setsockopt(fd,SOL_SOCKET,SO_REUSEPORT,(char *)&yes,sizeof yes); -#endif - setsockopt(fd,IPPROTO_TCP,TCP_NODELAY,(char *)&yes,sizeof yes); -#else /* NSOCKET */ setsocketopts(fd); -#endif /* NSOCKET */ server_address.sin_family = AF_INET; server_address.sin_addr.s_addr = htonl( INADDR_ANY ); @@ -333,24 +305,12 @@ int make_connection(long ip,int port) struct sockaddr_in server_address; int fd; int result; -#ifndef NSOCKET - int yes = 1; // reuse fix -#endif /* not NSOCKET */ fd = socket( AF_INET, SOCK_STREAM, 0 ); -#ifndef NSOCKET - if(fd_max<=fd) fd_max=fd+1; - setsockopt(fd,SOL_SOCKET,SO_REUSEADDR,(char *)&yes,sizeof yes); -#ifdef SO_REUSEPORT - setsockopt(fd,SOL_SOCKET,SO_REUSEPORT,(char *)&yes,sizeof yes); -#endif - setsockopt(fd,IPPROTO_TCP,TCP_NODELAY,(char *)&yes,sizeof yes); -#else /* NSOCKET */ if(fd_max<=fd) fd_max=fd+1; setsocketopts(fd); -#endif /* NSOCKET */ server_address.sin_family = AF_INET; server_address.sin_addr.s_addr = ip; @@ -418,10 +378,8 @@ int realloc_fifo(int fd,int rfifo_size,int wfifo_size) int WFIFOSET(int fd,int len) { struct socket_data *s=session[fd]; -#ifdef NSOCKET if (s == NULL || s->wdata == NULL) return 0; -#endif /* NSOCKET */ if( s->wdata_size+len+16384 > s->max_wdata ){ unsigned char *sin_addr = (unsigned char *)&s->client_addr.sin_addr; realloc_fifo(fd,s->max_rdata, s->max_wdata <<1 ); @@ -429,10 +387,8 @@ int WFIFOSET(int fd,int len) } s->wdata_size=(s->wdata_size+(len)+2048 < s->max_wdata) ? s->wdata_size+len : (printf("socket: %d wdata lost !!\n",fd),s->wdata_size); -#ifdef NSOCKET if (s->wdata_size > (TCP_FRAME_LEN)) send_from_fifo(fd); -#endif /* NSOCKET */ return 0; } diff --git a/src/map/pc.c b/src/map/pc.c index 0e749ead2..09b8b8c4d 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -963,9 +963,9 @@ int pc_calc_skilltree(struct map_session_data *sd) do { flag=0; for(i=0;(id=skill_tree[s][c][i].id)>0;i++){ + int j,f=1; if(skill_get_inf2(id)) continue; - int j,f=1; if(!battle_config.skillfree) { for(j=0;j<5;j++) { if( skill_tree[s][c][i].need[j].id && @@ -980,9 +980,9 @@ int pc_calc_skilltree(struct map_session_data *sd) } } for(i=0;(id=skill_tree[s][s_class.job][i].id)>0;i++){ + int j,f=1; if(!skill_get_inf2(id)) continue; - int j,f=1; if(!battle_config.skillfree) { for(j=0;j<5;j++) { if( skill_tree[s][s_class.job][i].need[j].id && diff --git a/src/map/skill.c b/src/map/skill.c index f74409caf..dacd08e88 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -5228,10 +5228,11 @@ struct skill_unit_group *skill_unitsetting( struct block_list *src, int skillid, int i,count=1,limit=10000,val1=0,val2=0; int target=BCT_ENEMY,interval=1000,range=0; int dir=0,aoe_diameter=0; // -- aoe_diameter (moonsoul) added for sage Area Of Effect skills + struct status_change *sc_data; nullpo_retr(0, src); - struct status_change *sc_data = battle_get_sc_data(src); // for firewall and fogwall - celest + sc_data = battle_get_sc_data(src); // for firewall and fogwall - celest switch(skillid){ /* ݒ */ |