From a0963c921b51df6817448d419483a64c47046326 Mon Sep 17 00:00:00 2001 From: fcolin Date: Mon, 16 Dec 2002 14:51:27 +0000 Subject: passage en GCC 3.2 --- src/ivy.c | 3 +++ src/ivyglutloop.c | 2 +- src/ivygtkloop.c | 4 ++-- src/ivysocket.c | 11 ++++++----- src/list.h | 17 ++++++++++++----- 5 files changed, 24 insertions(+), 13 deletions(-) (limited to 'src') 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 +#include +#include +#include #include #include 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 +#include #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;\ -- cgit v1.1