summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfourdan2007-02-14 13:00:40 +0000
committerfourdan2007-02-14 13:00:40 +0000
commit018219f2fc25f76e83f4111455d7a6c678223482 (patch)
tree5cf2b45e4bda9206998ec943e476e86bf3cd9bfe
parent30748deeab75a17254aba6696d137037ff2e2294 (diff)
downloadivy-c-018219f2fc25f76e83f4111455d7a6c678223482.zip
ivy-c-018219f2fc25f76e83f4111455d7a6c678223482.tar.gz
ivy-c-018219f2fc25f76e83f4111455d7a6c678223482.tar.bz2
ivy-c-018219f2fc25f76e83f4111455d7a6c678223482.tar.xz
Include patches from Michel Estienne <estienne@cena.fr> for older gcc
-rw-r--r--debian/changelog6
-rw-r--r--src/Makefile2
-rw-r--r--src/intervalRegexp.c30
-rw-r--r--src/ivy.c30
-rw-r--r--src/ivybind.c10
-rw-r--r--src/ivybuffer.c2
-rw-r--r--src/ivysocket.c6
-rw-r--r--src/ivytcl.c16
8 files changed, 54 insertions, 48 deletions
diff --git a/debian/changelog b/debian/changelog
index 8852b53..147aec5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+ivy-c (3.9.3-1) unstable; urgency=low
+
+ * Include patches from Michel Estienne <estienne@cena.fr> for older gcc
+
+ -- Olivier Fourdan <fourdan@lerak.tls.cena.fr> Wed, 14 Feb 2007 13:48:28 +0100
+
ivy-c (3.9.2-1) unstable; urgency=low
* Apply patch from Michel Estienne <estienne@cena.fr> for Solaris,
diff --git a/src/Makefile b/src/Makefile
index ea8a102..3278ffb 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -89,8 +89,8 @@ REGEXP= -DUSE_PCRE_REGEX -DPCRE_OPT=$(PCRE_OPT)
# on activeTCL , set #define CHANNEL to null, and add ivyloop.o in the ivytcl target,
# see below
CHANNEL = -DTCL_CHANNEL_INTEGRATION
-CFLAGS = -g -Wall -std=gnu89 $(FPIC)
+CFLAGS += -g -Wall $(FPIC)
OBJ = ivyloop.o timer.o ivysocket.o ivy.o ivybuffer.o ivybind.o intervalRegexp.o
GOBJ = ivyloop.o timer.o ivysocket.o givy.o ivybuffer.o ivybind.o intervalRegexp.o
diff --git a/src/intervalRegexp.c b/src/intervalRegexp.c
index 0132fce..54a06f0 100644
--- a/src/intervalRegexp.c
+++ b/src/intervalRegexp.c
@@ -84,7 +84,7 @@ int regexpGen (char *regexp, size_t buflen, long min, long max, int flottant)
AddLocBuf ("%ld%s", min, decimalPart);
} else if (min < 0) {
if (max < 0) {
- // reg = '\-(?:' . strictPosRegexpGen (-max, -min, decimalPart, boundDecimalPart). ')';
+ /* reg = '\-(?:' . strictPosRegexpGen (-max, -min, decimalPart, boundDecimalPart). ')'; */
AddLocBuf ("\\-(?:");
if (strictPosRegexpGen (EndLocBuf, sizeof (locBuf)-strlen(locBuf), -min, -max, decimalPart,
boundDecimalPart) == fail) return fail;
@@ -95,7 +95,7 @@ int regexpGen (char *regexp, size_t buflen, long min, long max, int flottant)
boundDecimalPart)== fail) return fail;
AddLocBuf (")");
} else {
- //reg ='(?:' . regexpGen (min, 0,withDecimal) . '|' . regexpGen (0, max, withDecimal). ')' ;
+ /*reg ='(?:' . regexpGen (min, 0,withDecimal) . '|' . regexpGen (0, max, withDecimal). ')' ; */
AddLocBuf ("(?:");
if (regexpGen (EndLocBuf, sizeof (locBuf)-strlen(locBuf), min, 0, flottant)== fail) return fail;
AddLocBuf ("|");
@@ -103,7 +103,7 @@ int regexpGen (char *regexp, size_t buflen, long min, long max, int flottant)
AddLocBuf (")");
}
} else if (min == 0) {
- // reg = "(?:0{decimalPart})|" . strictPosRegexpGen (1, max, decimalPart,boundDecimalPart) ;
+ /* reg = "(?:0{decimalPart})|" . strictPosRegexpGen (1, max, decimalPart,boundDecimalPart) ; */
AddLocBuf ("(?:0%s)|",decimalPart);
if (strictPosRegexpGen (EndLocBuf, sizeof (locBuf)-strlen(locBuf), 1, max, decimalPart,
boundDecimalPart)== fail) return fail;
@@ -201,11 +201,11 @@ static NextMax nextMax (const char *min, const char *max)
for (i=nbDigitsMin-1; i >= 0; i--) {
revMin[nbDigitsMin-i-1]= min[i];
- // printf ("DBG> nextMax revMin[%d]= %c\n", nbDigitsMin-i-1, min[i]);
+ /* printf ("DBG> nextMax revMin[%d]= %c\n", nbDigitsMin-i-1, min[i]); */
}
for (i=nbDigitsMax-nbDigitsMin; i >= 0; i--) {
revMin[nbDigitsMax-i]= '0';
- // printf ("DBG> nextMax revMin[%d]= %c\n", nbDigitsMax-i, '0');
+ /* printf ("DBG> nextMax revMin[%d]= %c\n", nbDigitsMax-i, '0'); */
}
for (i=nbDigitsMax-1; i >= 0; i--) {
@@ -214,11 +214,11 @@ static NextMax nextMax (const char *min, const char *max)
revMin[nbDigitsMax] = revMax[nbDigitsMax] = 0;
rankForw = nbDigitsMax -1;
- // printf ("DBG> nextMax rev(%s)=%s rev(%s)=%s rankForw=%d\n", min, revMin, max, revMax, rankForw);
+ /* printf ("DBG> nextMax rev(%s)=%s rev(%s)=%s rankForw=%d\n", min, revMin, max, revMax, rankForw); */
- // en partant des unitées (digit de poids faible), premier digit de min != 0
+ /* en partant des unitées (digit de poids faible), premier digit de min != 0 */
while ((revMin[rankRev] == '0') && (rankRev < nbDigitsMax)) rankRev++;
- // en partant du digit de poids fort, premier digit de max != du même digit de revMin
+ /* en partant du digit de poids fort, premier digit de max != du même digit de revMin */
while ((revMin[rankForw] == revMax[rankForw]) && rankForw > 0) rankForw--;
if (rankForw <= rankRev) {
@@ -236,7 +236,7 @@ static NextMax nextMax (const char *min, const char *max)
currMax = atoi (max);
if (nextMax.max > currMax) nextMax.max = currMax;
- // printf ("DBG> nextMax ('%s', '%s') = %d@%d\n", min, max, nextMax.max, nextMax.rank);
+ /* printf ("DBG> nextMax ('%s', '%s') = %d@%d\n", min, max, nextMax.max, nextMax.rank); */
return (nextMax);
}
@@ -281,8 +281,8 @@ static bool genPreRank (char *preRank, size_t buflen, const char *min, const cha
lmin = &(min[i]);
lmax = &(max[j]);
- // printf ("DBG> genPreRank (lmin='%s'[%d], lmax='%s'[%d], rank=%d\n", lmin, (int) strlen (lmin), lmax,
- // (int) strlen (lmax), rank);
+ /* printf ("DBG> genPreRank (lmin='%s'[%d], lmax='%s'[%d], rank=%d\n", lmin, (int) strlen (lmin), lmax, */
+ /* (int) strlen (lmax), rank); */
if (substr (locBuf, sizeof (locBuf), lmin, 0, strlen (lmin) - rank) == fail) return fail;
if (substr (locBufMax, sizeof (locBufMax), lmax, 0, strlen (lmax) - rank) == fail) return fail;
@@ -290,7 +290,7 @@ static bool genPreRank (char *preRank, size_t buflen, const char *min, const cha
if (strncmp (locBuf, locBufMax, MININT (sizeof (locBuf), sizeof (locBufMax))) != 0)
return Perr ("min=%s[%s] and max=%s[%s] should be invariants at rank %d", locBuf, min, locBufMax, max, rank);
- // printf ("DBG> genPreRank ('%s', '%s', %d) = '%s'\n", min, max, rank, locBuf);
+ /* printf ("DBG> genPreRank ('%s', '%s', %d) = '%s'\n", min, max, rank, locBuf); */
CHECK_AND_RETURN (preRank);
}
@@ -371,7 +371,7 @@ static bool substr (char *substring, size_t buflen, const char* expr, size_t pos
}
locBuf[j] = 0;
- // printf ("DBG> substr ('%s', %d, %d) = '%s'\n", expr, pos, len, locBuf);
+ /* printf ("DBG> substr ('%s', %d, %d) = '%s'\n", expr, pos, len, locBuf); */
CHECK_AND_RETURN (substring);
}
@@ -392,11 +392,11 @@ static char* reverse (char *string)
locBuf = malloc (len+1);
for (i=len-1; i >= 0; i--) {
locBuf[len-i-1]= string[i];
- //printf ("DBG> reverse locBuf[%d]= %c\n",len- i-1, string[i]);
+ /*printf ("DBG> reverse locBuf[%d]= %c\n",len- i-1, string[i]); */
}
locBuf [len] = 0;
- // printf ("DBG> reverse '%s' = '%s'\n", string, locBuf);
+ /* printf ("DBG> reverse '%s' = '%s'\n", string, locBuf); */
strcpy (string, locBuf);
free (locBuf);
return (string);
diff --git a/src/ivy.c b/src/ivy.c
index 5231f0d..9d5d6d1 100644
--- a/src/ivy.c
+++ b/src/ivy.c
@@ -198,9 +198,9 @@ static int MsgCall (const char *message, MsgSndPtr msg, IvyClientPtr client)
TRACE( "Sending message id=%d '%s'\n",msg->id,message);
buffer.offset = 0;
- // il faut essayer d'envoyer le message en une seule fois sur la socket
- // pour eviter au maximun de passer dans le select plusieur fois par message du protocole Ivy
- // pour eviter la latence ( PB de perfo detecte par ivyperf ping roudtrip )
+ /* il faut essayer d'envoyer le message en une seule fois sur la socket */
+ /* pour eviter au maximun de passer dans le select plusieur fois par message du protocole Ivy */
+ /* pour eviter la latence ( PB de perfo detecte par ivyperf ping roudtrip ) */
err = make_message_var( &buffer, "%d %d" ARG_START ,Msg, msg->id);
TRACE( "Send matching args count %d\n",rc);
@@ -320,7 +320,7 @@ static void Receive( Client client, void *data, char *line )
bind = IvyBindingCompile( arg, & erroffset, & errbuf );
if ( bind != NULL )
{
- // On teste si c'est un change regexp : changement de regexp d'une id existante
+ /* On teste si c'est un change regexp : changement de regexp d'une id existante */
IVY_LIST_ITER( clnt->msg_send, snd, ( id != snd->id ));
if ( snd ) {
free (snd->str_regexp);
@@ -493,7 +493,7 @@ static void ClientDelete( Client client, void *data )
/* probably bogus call, but this is for debug only anyway */
SocketGetRemoteHost( client, &remotehost, &remoteport );
TRACE("Deconnexion de %s:%hu\n", remotehost, remoteport );
-#endif //DEBUG
+#endif /*DEBUG */
if ( clnt->app_name ) free( clnt->app_name );
IVY_LIST_EACH( clnt->msg_send, msg)
@@ -513,7 +513,7 @@ static void *ClientCreate( Client client )
unsigned short remoteport;
SocketGetRemoteHost( client, &remotehost, &remoteport );
TRACE("Connexion de %s:%hu\n", remotehost, remoteport );
-#endif //DEBUG
+#endif /*DEBUG */
return SendService (client, "Unknown");
}
@@ -558,7 +558,7 @@ static void BroadcastReceive( Client client, void *data, char *line )
#ifdef DEBUG
SocketGetRemoteHost (client, &remotehost, &remoteport );
TRACE(" Broadcast de %s:%hu port %hu\n", remotehost, remoteport, serviceport );
-#endif //DEBUG
+#endif /*DEBUG */
/* connect to the service and send the regexp */
app = SocketConnectAddr(SocketGetRemoteAddr(client), serviceport, 0, Receive, ClientDelete );
@@ -701,7 +701,7 @@ void IvyStart (const char* bus)
baddr.s_addr = htonl(mask);
printf ("Broadcasting on network %s, port %d\n", inet_ntoa(baddr), SupervisionPort);
- // test mask value agaisnt CLASS D
+ /* test mask value agaisnt CLASS D */
if ( IN_MULTICAST( mask ) )
SocketAddMember (broadcast , mask );
@@ -956,7 +956,7 @@ char **IvyGetApplicationMessages( IvyClientPtr app )
static void substituteInterval (IvyBuffer *src)
{
- // pas de traitement couteux s'il n'y a rien à interpoler
+ /* pas de traitement couteux s'il n'y a rien à interpoler */
if (strstr (src->data, "(?I") == NULL) {
return;
} else {
@@ -968,7 +968,7 @@ static void substituteInterval (IvyBuffer *src)
curPos = src->data;
while ((itvPos = strstr (curPos, "(?I")) != NULL) {
- // copie depuis la position courante jusqu'à l'intervalle
+ /* copie depuis la position courante jusqu'à l'intervalle */
int lenCp, min,max;
char withDecimal;
lenCp = itvPos-curPos;
@@ -976,17 +976,17 @@ static void substituteInterval (IvyBuffer *src)
curPos=itvPos;
dst.offset += lenCp;
- // extraction des paramètres de l'intervalle
+ /* extraction des paramètres de l'intervalle */
sscanf (itvPos, "(?I%d#%d%c", &min, &max, &withDecimal);
- // printf ("DBG> substituteInterval min=%d max=%d withDecimal=%d\n",
- // min, max, (withDecimal != 'i'));
+ /* printf ("DBG> substituteInterval min=%d max=%d withDecimal=%d\n", */
+ /* min, max, (withDecimal != 'i')); */
- // generation et copie de l'intervalle
+ /* generation et copie de l'intervalle */
regexpGen (&(dst.data[dst.offset]), dst.size-dst.offset, min, max, (withDecimal != 'i'));
dst.offset = strlen (dst.data);
- // consommation des caractères décrivant intervalle dans la chaine source
+ /* consommation des caractères décrivant intervalle dans la chaine source */
curPos = strstr (curPos, ")");
curPos++;
}
diff --git a/src/ivybind.c b/src/ivybind.c
index c506ab3..5aaefe2 100644
--- a/src/ivybind.c
+++ b/src/ivybind.c
@@ -170,7 +170,7 @@ void IvyBindingMatch( IvyBinding bind, const char *message, int argnum, int *arg
if ( p->rm_so != -1 ) {
*arglen = p->rm_eo - p->rm_so;
*arg = message + p->rm_so;
- } else { // ARG VIDE
+ } else { /* ARG VIDE */
*arglen = 0;
*arg = NULL;
}
@@ -178,7 +178,7 @@ void IvyBindingMatch( IvyBinding bind, const char *message, int argnum, int *arg
}
-//filter Expression Bind
+/*filter Expression Bind */
int IvyBindingGetFilterCount()
{
return messages_classes_count;
@@ -219,9 +219,9 @@ int IvyBindingFilter(const char *expression)
{
if (strncmp( messages_classes[i], token, tokenlen ) == 0) {
return 1; }
- // else {
- //printf ("DBG> %s eliminé [%s]\n", token, expression);
- //}
+ /* else { */
+ /*printf ("DBG> %s eliminé [%s]\n", token, expression); */
+ /*} */
}
}
return regexp_ok;
diff --git a/src/ivybuffer.c b/src/ivybuffer.c
index 0d85d98..3588d06 100644
--- a/src/ivybuffer.c
+++ b/src/ivybuffer.c
@@ -27,7 +27,7 @@
#define BUFFER_SIZE 4096 /* taille buffer initiale on multiple par deux a chaque realloc */
-// fonction de formtage a la printf d'un buffer avec reallocation dynamique
+/* fonction de formtage a la printf d'un buffer avec reallocation dynamique */
int make_message(IvyBuffer* buffer, const char *fmt, va_list ap)
{
/* Guess we need no more than BUFFER_INIT_SIZE bytes. */
diff --git a/src/ivysocket.c b/src/ivysocket.c
index b31ab4a..8430bd3 100644
--- a/src/ivysocket.c
+++ b/src/ivysocket.c
@@ -351,7 +351,7 @@ int SocketSendRaw (Client client, char *buffer, int len )
FD_ZERO(&wrset);
FD_SET( client->fd, &wrset );
ready = select(client->fd+1, 0, &wrset, 0, &timeout);
- //fprintf(stderr,"Ivy: select ready=%d fd=%d\n",ready,FD_ISSET( client->fd, &wrset ) );
+ /* fprintf(stderr,"Ivy: select ready=%d fd=%d\n",ready,FD_ISSET( client->fd, &wrset ) ); */
if(ready < 0) {
perror("Ivy: SocketSendRaw select");
}
@@ -481,7 +481,7 @@ Client SocketConnectAddr (struct in_addr * addr, unsigned short port,
return client;
}
-// TODO factoriser avec HandleRead !!!!
+/* TODO factoriser avec HandleRead !!!! */
int SocketWaitForReply (Client client, char *buffer, int size, int delai)
{
fd_set rdset;
@@ -641,7 +641,7 @@ Multicast datagrams with initial TTL 64 are restricted to the same region.
Multicast datagrams with initial TTL 128 are restricted to the same continent.
Multicast datagrams with initial TTL 255 are unrestricted in scope.
*/
- unsigned char ttl = 64 ; // Arbitrary TTL value.
+ unsigned char ttl = 64 ; /* Arbitrary TTL value. */
/* wee need to broadcast */
imr.imr_multiaddr.s_addr = htonl( host );
diff --git a/src/ivytcl.c b/src/ivytcl.c
index a43821a..5f70a5a 100644
--- a/src/ivytcl.c
+++ b/src/ivytcl.c
@@ -33,11 +33,11 @@
#include "ivy.h"
#include "timer.h"
-// defined or not in the Makefile only
+/* defined or not in the Makefile only */
#ifdef TCL_CHANNEL_INTEGRATION
-// On utilisa la boucle Standard TCL
-// mais il y a des problemes sur les socket server
-// Il n'y a pas de Tcl_MakeTCPserver
+/* On utilisa la boucle Standard TCL */
+/* mais il y a des problemes sur les socket server */
+/* Il n'y a pas de Tcl_MakeTCPserver */
struct _channel {
HANDLE fd;
@@ -126,7 +126,7 @@ Channel IvyChannelAdd(HANDLE fd, void *data,
}
#else
-// On utilisa la procedure Idle et la boucle Standard Ivy
+/* On utilisa la procedure Idle et la boucle Standard Ivy */
void IvyIdleProc(ClientData clientData)
{
IvyIdle();
@@ -397,11 +397,11 @@ IvyBindCmd(ClientData clientData,
}
filter = (filter_struct *) ckalloc(sizeof(filter_struct));
- filter->filter = ckalloc(strlen(argv[1])+1); // regexp
+ filter->filter = ckalloc(strlen(argv[1])+1); /* regexp */
strcpy(filter->filter, argv[1]);
- filter->script = ckalloc(strlen(argv[2])+1); // callback proc name
+ filter->script = ckalloc(strlen(argv[2])+1); /* callback proc name */
strcpy(filter->script, argv[2]);
- filter->id = IvyBindMsg(IvyMsgCB, (void *) filter, filter->filter, NULL); // MsgPtr id
+ filter->id = IvyBindMsg(IvyMsgCB, (void *) filter, filter->filter, NULL); /* MsgPtr id */
filter->interp = interp;
entry = Tcl_CreateHashEntry(&filter_table, (char *) filter_id, &dummy);
Tcl_SetHashValue(entry, (ClientData) filter);