aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/test_mesh_local_2.c
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2011-09-14 15:27:34 +0000
committerBart Polot <bart@net.in.tum.de>2011-09-14 15:27:34 +0000
commit4a9c4c7275860ca9b558eb7354ddd39af9cd8c3d (patch)
treec37d619d78e8af4fd098ff548ad813ee16143d18 /src/mesh/test_mesh_local_2.c
parentc9e58a448ef96bf6eecae21cafc82b64ef551662 (diff)
downloadgnunet-4a9c4c7275860ca9b558eb7354ddd39af9cd8c3d.tar.gz
gnunet-4a9c4c7275860ca9b558eb7354ddd39af9cd8c3d.zip
Fixed compiler warning in tests
Diffstat (limited to 'src/mesh/test_mesh_local_2.c')
-rw-r--r--src/mesh/test_mesh_local_2.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/mesh/test_mesh_local_2.c b/src/mesh/test_mesh_local_2.c
index b29921dd3..d841d63d9 100644
--- a/src/mesh/test_mesh_local_2.c
+++ b/src/mesh/test_mesh_local_2.c
@@ -36,6 +36,8 @@ static struct GNUNET_OS_Process *arm_pid;
36static struct GNUNET_MESH_Handle *mesh_peer_1; 36static struct GNUNET_MESH_Handle *mesh_peer_1;
37static struct GNUNET_MESH_Handle *mesh_peer_2; 37static struct GNUNET_MESH_Handle *mesh_peer_2;
38static struct GNUNET_MESH_Tunnel *t; 38static struct GNUNET_MESH_Tunnel *t;
39static unsigned int one = 1;
40static unsigned int two = 2;
39 41
40static int result; 42static int result;
41static GNUNET_SCHEDULER_TaskIdentifier abort_task; 43static GNUNET_SCHEDULER_TaskIdentifier abort_task;
@@ -132,7 +134,7 @@ inbound_tunnel (void *cls, struct GNUNET_MESH_Tunnel *tunnel,
132 const struct GNUNET_PeerIdentity *initiator, 134 const struct GNUNET_PeerIdentity *initiator,
133 const struct GNUNET_TRANSPORT_ATS_Information *atsi) 135 const struct GNUNET_TRANSPORT_ATS_Information *atsi)
134{ 136{
135 unsigned int id = (unsigned int) cls; 137 unsigned int id = *(unsigned int *) cls;
136 138
137 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: received incoming tunnel\n"); 139 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: received incoming tunnel\n");
138 if (id != 1) 140 if (id != 1)
@@ -158,7 +160,7 @@ static void
158inbound_end (void *cls, const struct GNUNET_MESH_Tunnel *tunnel, 160inbound_end (void *cls, const struct GNUNET_MESH_Tunnel *tunnel,
159 void *tunnel_ctx) 161 void *tunnel_ctx)
160{ 162{
161 unsigned int id = (unsigned int) cls; 163 unsigned int id = *(unsigned int *) cls;
162 164
163 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: incoming tunnel closed\n"); 165 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: incoming tunnel closed\n");
164 if (id != 1) 166 if (id != 1)
@@ -177,7 +179,8 @@ inbound_end (void *cls, const struct GNUNET_MESH_Tunnel *tunnel,
177 * @param peer peer identity the tunnel stopped working with 179 * @param peer peer identity the tunnel stopped working with
178 */ 180 */
179static void 181static void
180peer_conected (void *cls, const struct GNUNET_PeerIdentity *peer) 182peer_conected (void *cls, const struct GNUNET_PeerIdentity *peer,
183 const struct GNUNET_TRANSPORT_ATS_Information *atsi)
181{ 184{
182 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: peer connected\n"); 185 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: peer connected\n");
183 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &do_shutdown, NULL); 186 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &do_shutdown, NULL);
@@ -192,8 +195,7 @@ peer_conected (void *cls, const struct GNUNET_PeerIdentity *peer)
192 * @param atsi performance data for the connection 195 * @param atsi performance data for the connection
193 */ 196 */
194static void 197static void
195peer_disconnected (void *cls, const struct GNUNET_PeerIdentity *peer, 198peer_disconnected (void *cls, const struct GNUNET_PeerIdentity *peer)
196 const struct GNUNET_TRANSPORT_ATS_Information *atsi)
197{ 199{
198 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: peer disconnected\n"); 200 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: peer disconnected\n");
199} 201}
@@ -226,7 +228,7 @@ do_connect_peer_1 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
226 test_task = GNUNET_SCHEDULER_NO_TASK; 228 test_task = GNUNET_SCHEDULER_NO_TASK;
227 mesh_peer_1 = GNUNET_MESH_connect (cfg, /* configuration */ 229 mesh_peer_1 = GNUNET_MESH_connect (cfg, /* configuration */
228 10, /* queue size */ 230 10, /* queue size */
229 (void *) 1, /* cls */ 231 (void *) &one, /* cls */
230 &inbound_tunnel, /* inbound new hndlr */ 232 &inbound_tunnel, /* inbound new hndlr */
231 &inbound_end, /* inbound end hndlr */ 233 &inbound_end, /* inbound end hndlr */
232 handlers1, /* traffic handlers */ 234 handlers1, /* traffic handlers */
@@ -247,7 +249,7 @@ test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
247 249
248 mesh_peer_2 = GNUNET_MESH_connect (cfg, /* configuration */ 250 mesh_peer_2 = GNUNET_MESH_connect (cfg, /* configuration */
249 10, /* queue size */ 251 10, /* queue size */
250 (void *) 2, /* cls */ 252 (void *) &two, /* cls */
251 &inbound_tunnel, /* inbound new hndlr */ 253 &inbound_tunnel, /* inbound new hndlr */
252 &inbound_end, /* inbound end hndlr */ 254 &inbound_end, /* inbound end hndlr */
253 handlers2, /* traffic handlers */ 255 handlers2, /* traffic handlers */
@@ -263,7 +265,7 @@ test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
263 } 265 }
264 266
265 t = GNUNET_MESH_tunnel_create (mesh_peer_2, NULL, &peer_conected, 267 t = GNUNET_MESH_tunnel_create (mesh_peer_2, NULL, &peer_conected,
266 &peer_disconnected, (void *) 2); 268 &peer_disconnected, (void *) &two);
267 GNUNET_MESH_peer_request_connect_by_type (t, 1); 269 GNUNET_MESH_peer_request_connect_by_type (t, 1);
268 test_task = 270 test_task =
269 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, 271 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,