summaryrefslogtreecommitdiff
path: root/src/ivyperf.c
diff options
context:
space:
mode:
authorfcolin2005-08-18 07:36:18 +0000
committerfcolin2005-08-18 07:36:18 +0000
commit9921017a4b14b379d99305e17f8583ff90de0c1b (patch)
tree2f76b0a528a766ee67be1ba82973f02acc6e85c2 /src/ivyperf.c
parentf625f6e00c1d5d1194ce3db62e59ccc47fdf2386 (diff)
downloadivy-c-9921017a4b14b379d99305e17f8583ff90de0c1b.zip
ivy-c-9921017a4b14b379d99305e17f8583ff90de0c1b.tar.gz
ivy-c-9921017a4b14b379d99305e17f8583ff90de0c1b.tar.bz2
ivy-c-9921017a4b14b379d99305e17f8583ff90de0c1b.tar.xz
memory leak malloc/free cleanup
Diffstat (limited to 'src/ivyperf.c')
-rwxr-xr-xsrc/ivyperf.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/ivyperf.c b/src/ivyperf.c
index 9eb5c02..f8e9250 100755
--- a/src/ivyperf.c
+++ b/src/ivyperf.c
@@ -56,26 +56,26 @@ void Reply (IvyClientPtr app, void *user_data, IvyArgument args)
{
IvyArgument arg;
int len;
- void* val;
+ const void* val;
arg = IvyArgumentGetChildrens( args );
IvyArgumentGetValue( arg , &len, &val);
- IvySendMsg ("pong ts=%.*s tr=%f", len, val, currentTime());
+ IvySendMsg ("pong ts=%.*s tr=%f", len, (char*)val, currentTime());
}
void Pong (IvyClientPtr app, void *user_data, IvyArgument args)
{
double current, ts, tr, roundtrip1, roundtrip2, roundtrip3;
IvyArgument arg;
int len;
- void* val;
+ const void* val;
/* TODO bug atof non limite a la longeur de la valeur !!!*/
current = currentTime();
arg = IvyArgumentGetChildrens( args );
IvyArgumentGetValue( arg , &len, &val);
- ts = atof( val );
+ ts = atof( (char*)val );
arg = IvyArgumentGetNextChild( arg );
IvyArgumentGetValue( arg , &len, &val);
- tr = atof( val );
+ tr = atof( (char*)val );
roundtrip1 = tr-ts;
roundtrip2 = current - tr;
roundtrip3 = current - ts;
@@ -96,9 +96,14 @@ int main(int argc, char *argv[])
/* Mainloop management */
IvyInit ("IvyPerf", "IvyPerf ready", NULL,NULL,NULL,NULL);
-
+
+#ifdef USE_REGEXP
IvyBindMsg (Reply, NULL, "^ping ts=(.*)");
IvyBindMsg (Pong, NULL, "^pong ts=(.*) tr=(.*)");
+#else
+ IvyBindSimpleMsg (Reply, NULL, "ping ts");
+ IvyBindSimpleMsg (Pong, NULL, "pong ts tr");
+#endif
IvyStart (0);