Fixed compiler whining about test
authorBart Polot <bart@net.in.tum.de>
Wed, 7 Sep 2011 16:31:55 +0000 (16:31 +0000)
committerBart Polot <bart@net.in.tum.de>
Wed, 7 Sep 2011 16:31:55 +0000 (16:31 +0000)
src/mesh/test_mesh_local.c

index bf81ccc8ebcbef4d0223f5b1ea30b34bccf3c9b7..8cb863b10552c7419cb0ecf8eca4175fda0d00de 100644 (file)
@@ -36,19 +36,11 @@ static struct GNUNET_OS_Process *arm_pid;
 static struct GNUNET_MESH_Handle *mesh_peer_1;
 static struct GNUNET_MESH_Handle *mesh_peer_2;
 static struct GNUNET_MESH_Tunnel *t_1;
-static struct GNUNET_MESH_Tunnel *t_2;
+// static struct GNUNET_MESH_Tunnel *t_2;
 static int result;
 static GNUNET_SCHEDULER_TaskIdentifier abort_task;
 static GNUNET_SCHEDULER_TaskIdentifier test_task;
 
-static struct GNUNET_MESH_MessageHandler handlers1[] = {
-  {&callback, 1, 0},
-  {NULL, 0, 0}
-};
-
-static struct GNUNET_MESH_MessageHandler handlers2[] = { {NULL, 0, 0} };
-
-
 
 /**
  * Function is called whenever a message is received.
@@ -86,13 +78,18 @@ callback (void *cls, struct GNUNET_MESH_Tunnel *tunnel, void **tunnel_ctx,
 static void *
 inbound_tunnel (void *cls, struct GNUNET_MESH_Tunnel *tunnel,
                 const struct GNUNET_PeerIdentity *initiator,
-                const structGNUNET_TRANSPORT_ATS_Information * atsi)
+                const struct GNUNET_TRANSPORT_ATS_Information * atsi)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: \n");
   return NULL;
 }
 
+static struct GNUNET_MESH_MessageHandler handlers1[] = {
+  {&callback, 1, 0},
+  {NULL, 0, 0}
+};
 
+static struct GNUNET_MESH_MessageHandler handlers2[] = { {NULL, 0, 0} };
 
 
 
@@ -150,8 +147,20 @@ test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   static const GNUNET_MESH_ApplicationType app2[] = { 0 };
 
   test_task = (GNUNET_SCHEDULER_TaskIdentifier) 0;
-  mesh_peer_1 = GNUNET_MESH_connect (cfg, 10, 1, NULL, NULL, handlers1, app1);
-  mesh_peer_2 = GNUNET_MESH_connect (cfg, 10, 2, NULL, NULL, handlers2, app2);
+  mesh_peer_1 = GNUNET_MESH_connect (cfg,
+                                     10,
+                                     (void *)1,
+                                     &inbound_tunnel,
+                                     NULL,
+                                     handlers1,
+                                     app1);
+  mesh_peer_2 = GNUNET_MESH_connect (cfg,
+                                     10,
+                                     (void *)2,
+                                     NULL,
+                                     NULL,
+                                     handlers2,
+                                     app2);
   if (NULL == mesh_peer_1 || NULL == mesh_peer_2)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "test: Couldn't connect to mesh :(\n");
@@ -162,7 +171,7 @@ test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: YAY! CONNECTED TO MESH :D\n");
   }
 
-  t_1 = GNUNET_MESH_tunnel_create (mesh_peer_1, NULL, NULL, NULL, 1);
+  t_1 = GNUNET_MESH_tunnel_create (mesh_peer_1, NULL, NULL, NULL, (void *)1);
 //   t_2 = GNUNET_MESH_tunnel_create (mesh_peer_2, NULL, NULL, NULL, 2);
 
   GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply