summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfcolin2002-12-16 14:51:27 +0000
committerfcolin2002-12-16 14:51:27 +0000
commita0963c921b51df6817448d419483a64c47046326 (patch)
treee2b338eaa37c6febe9cbb5379e7471274ee5209c /src
parent809dd9c2eeb1441f04234bdd23d862b98fe4ff9b (diff)
downloadivy-c-a0963c921b51df6817448d419483a64c47046326.zip
ivy-c-a0963c921b51df6817448d419483a64c47046326.tar.gz
ivy-c-a0963c921b51df6817448d419483a64c47046326.tar.bz2
ivy-c-a0963c921b51df6817448d419483a64c47046326.tar.xz
passage en GCC 3.2
Diffstat (limited to 'src')
-rw-r--r--src/ivy.c3
-rwxr-xr-xsrc/ivyglutloop.c2
-rw-r--r--src/ivygtkloop.c4
-rw-r--r--src/ivysocket.c11
-rw-r--r--src/list.h17
5 files changed, 24 insertions, 13 deletions
diff --git a/src/ivy.c b/src/ivy.c
index 870e6fc..43539f8 100644
--- a/src/ivy.c
+++ b/src/ivy.c
@@ -17,6 +17,9 @@
*/
#include <stdlib.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
#include <stdio.h>
#include <string.h>
diff --git a/src/ivyglutloop.c b/src/ivyglutloop.c
index b78c183..a777a30 100755
--- a/src/ivyglutloop.c
+++ b/src/ivyglutloop.c
@@ -37,7 +37,7 @@
#endif
-#include <GL/Glut.h>
+#include <GL/glut.h>
#include "ivychannel.h"
#include "ivyglutloop.h"
diff --git a/src/ivygtkloop.c b/src/ivygtkloop.c
index 75cd0b6..45722d5 100644
--- a/src/ivygtkloop.c
+++ b/src/ivygtkloop.c
@@ -75,8 +75,8 @@ void IvyGtkChannelClose( Channel channel )
if ( channel->handle_delete )
(*channel->handle_delete)( channel->data );
- gtk_input_remove( channel->id_read );
- gtk_input_remove( channel->id_delete );
+ gdk_input_remove( channel->id_read );
+ gdk_input_remove( channel->id_delete );
}
diff --git a/src/ivysocket.c b/src/ivysocket.c
index 3e23a0b..3d996de 100644
--- a/src/ivysocket.c
+++ b/src/ivysocket.c
@@ -112,7 +112,7 @@ static void HandleSocket (Channel channel, HANDLE fd, void *data)
char *ptr_nl;
long nb_to_read = 0;
long nb;
- int len;
+ socklen_t len;
/* limitation taille buffer */
nb_to_read = MAX_BUFFER - (client->ptr - client->buffer );
@@ -122,7 +122,8 @@ static void HandleSocket (Channel channel, HANDLE fd, void *data)
return;
}
len = sizeof (client->from );
- nb = recvfrom (fd, client->ptr, nb_to_read,0,(struct sockaddr *)&client->from,&len);
+ nb = recvfrom (fd, client->ptr, nb_to_read,0,(struct sockaddr *)&client->from,
+ &len);
if (nb < 0) {
perror(" Read Socket ");
(*channel_close) (client->channel );
@@ -160,7 +161,7 @@ static void HandleServer(Channel channel, HANDLE fd, void *data)
Server server = (Server ) data;
Client client;
HANDLE ns;
- int addrlen;
+ socklen_t addrlen;
struct sockaddr_in remote2;
addrlen = sizeof (remote2 );
@@ -195,7 +196,7 @@ Server SocketServer(unsigned short port,
HANDLE fd;
int one=1;
struct sockaddr_in local;
- int addrlen;
+ socklen_t addrlen;
if ((fd = socket (AF_INET, SOCK_STREAM, 0)) < 0){
@@ -274,7 +275,7 @@ char *SocketGetPeerHost (Client client )
int err;
struct sockaddr_in name;
struct hostent *host;
- int len = sizeof(name);
+ socklen_t len = sizeof(name);
if (!client)
return "undefined";
diff --git a/src/list.h b/src/list.h
index 0c31223..78eb07e 100644
--- a/src/list.h
+++ b/src/list.h
@@ -13,14 +13,21 @@
* Please refer to file version.h for the
* copyright notice regarding this software
*/
+#if (__GNUC__ >= 3)
+#define TYPEOF(p) typeof (p)
+#else
+#define TYPEOF(p) void *
+#endif
#define IVY_LIST_ITER( list, p, cond ) \
p = list; \
while ( p && (cond) ) p = p->next
+
+
#define IVY_LIST_REMOVE( list, p ) \
{ \
- void *toRemove; \
+ TYPEOF(p) toRemove; \
if ( list == p ) \
{ \
list = p->next; \
@@ -33,8 +40,8 @@
if ( p )\
{\
/* somme tricky swapping to use a untyped variable */\
- void *suiv; \
- void *prec = p;\
+ TYPEOF(p) suiv; \
+ TYPEOF(p) prec = p;\
p = toRemove;\
suiv = p->next;\
p = prec;\
@@ -45,7 +52,7 @@
}
#define IVY_LIST_ADD(list, p ) \
- if ((p = malloc( sizeof( *p ))))\
+ if ( p = (TYPEOF(p)) (malloc( sizeof( *p ))))\
{ \
memset( p, 0 , sizeof( *p ));\
p->next = list; \
@@ -60,7 +67,7 @@ for ( p = list ; (next = p ? p->next: p ),p ; p = next )
#define IVY_LIST_EMPTY( list ) \
{ \
- void *p; \
+ TYPEOF(list) p; \
while( list ) \
{ \
p = list;\