From a89c7a30d499bac96890929d745fad063eb707b2 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 21 Aug 2013 16:03:30 +0000 Subject: removing deprecated argument in 'init' callback of GNUNET_CORE_connect --- src/core/core_api.c | 2 +- src/core/gnunet-core.c | 11 +++++------ src/core/test_core_api.c | 4 +--- src/core/test_core_api_reliability.c | 4 +--- src/core/test_core_api_send_to_self.c | 6 +++--- src/core/test_core_api_start_only.c | 8 +++----- src/core/test_core_quota_compliance.c | 5 ++--- 7 files changed, 16 insertions(+), 24 deletions(-) (limited to 'src/core') diff --git a/src/core/core_api.c b/src/core/core_api.c index ccd159d15..2198f7e2c 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c @@ -782,7 +782,7 @@ main_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg) h->init = NULL; LOG (GNUNET_ERROR_TYPE_DEBUG, "Connected to core service of peer `%s'.\n", GNUNET_i2s (&h->me)); - init (h->cls, h, &h->me); + init (h->cls, &h->me); } else { diff --git a/src/core/gnunet-core.c b/src/core/gnunet-core.c index 37f1caec2..9bfd18ec9 100644 --- a/src/core/gnunet-core.c +++ b/src/core/gnunet-core.c @@ -72,7 +72,8 @@ shutdown_task (void *cls, * @param peer peer identity this notification is about */ static void -connected_peer_callback (void *cls, const struct GNUNET_PeerIdentity *peer) +connected_peer_callback (void *cls, + const struct GNUNET_PeerIdentity *peer) { struct GNUNET_CRYPTO_HashAsciiEncoded enc; @@ -82,11 +83,10 @@ connected_peer_callback (void *cls, const struct GNUNET_PeerIdentity *peer) printf (_("Peer `%s'\n"), (const char *) &enc); } -void + +static void monitor_notify_startup (void *cls, - struct GNUNET_CORE_Handle * server, - const struct GNUNET_PeerIdentity * - my_identity) + const struct GNUNET_PeerIdentity *my_identity) { my_id = (*my_identity); } @@ -146,7 +146,6 @@ monitor_notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) } - /** * Main function that will be run by the scheduler. * diff --git a/src/core/test_core_api.c b/src/core/test_core_api.c index 184a64092..348bd8975 100644 --- a/src/core/test_core_api.c +++ b/src/core/test_core_api.c @@ -264,16 +264,14 @@ connect_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) static void -init_notify (void *cls, struct GNUNET_CORE_Handle *server, +init_notify (void *cls, const struct GNUNET_PeerIdentity *my_identity) { struct PeerContext *p = cls; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Core connection to `%4s' established\n", GNUNET_i2s (my_identity)); - GNUNET_assert (server != NULL); p->id = *my_identity; - p->ch = server; if (cls == &p1) { GNUNET_assert (ok == 2); diff --git a/src/core/test_core_api_reliability.c b/src/core/test_core_api_reliability.c index 29f39585e..e0db5eaed 100644 --- a/src/core/test_core_api_reliability.c +++ b/src/core/test_core_api_reliability.c @@ -358,7 +358,7 @@ static struct GNUNET_CORE_MessageHandler handlers[] = { static void -init_notify (void *cls, struct GNUNET_CORE_Handle *server, +init_notify (void *cls, const struct GNUNET_PeerIdentity *my_identity) { struct PeerContext *p = cls; @@ -366,9 +366,7 @@ init_notify (void *cls, struct GNUNET_CORE_Handle *server, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connection to CORE service of `%4s' established\n", GNUNET_i2s (my_identity)); - GNUNET_assert (server != NULL); p->id = *my_identity; - p->ch = server; if (cls == &p1) { GNUNET_assert (ok == 2); diff --git a/src/core/test_core_api_send_to_self.c b/src/core/test_core_api_send_to_self.c index 82048ea92..4e2ee3fe4 100644 --- a/src/core/test_core_api_send_to_self.c +++ b/src/core/test_core_api_send_to_self.c @@ -103,12 +103,12 @@ send_message (void *cls, size_t size, void *buf) static void -init (void *cls, struct GNUNET_CORE_Handle *core, +init (void *cls, const struct GNUNET_PeerIdentity *my_identity) { - if (core == NULL) + if (NULL == my_identity) { - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Could NOT connect to CORE;\n"); + GNUNET_break (0); return; } GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, diff --git a/src/core/test_core_api_start_only.c b/src/core/test_core_api_start_only.c index e98b374d2..ca16eb856 100644 --- a/src/core/test_core_api_start_only.c +++ b/src/core/test_core_api_start_only.c @@ -104,14 +104,12 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) static void -init_notify (void *cls, struct GNUNET_CORE_Handle *server, +init_notify (void *cls, const struct GNUNET_PeerIdentity *my_identity) { struct PeerContext *p = cls; - GNUNET_assert (server != NULL); - GNUNET_assert (p->ch == server); - if (cls == &p1) + if (p == &p1) { /* connect p2 */ p2.ch = @@ -121,7 +119,7 @@ init_notify (void *cls, struct GNUNET_CORE_Handle *server, } else { - GNUNET_assert (cls == &p2); + GNUNET_assert (p == &p2); GNUNET_SCHEDULER_cancel (timeout_task_id); GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); } diff --git a/src/core/test_core_quota_compliance.c b/src/core/test_core_quota_compliance.c index 9eb4d841f..0078a2daf 100644 --- a/src/core/test_core_quota_compliance.c +++ b/src/core/test_core_quota_compliance.c @@ -500,7 +500,7 @@ static struct GNUNET_CORE_MessageHandler handlers[] = { static void -init_notify (void *cls, struct GNUNET_CORE_Handle *server, +init_notify (void *cls, const struct GNUNET_PeerIdentity *my_identity) { struct PeerContext *p = cls; @@ -508,9 +508,8 @@ init_notify (void *cls, struct GNUNET_CORE_Handle *server, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connection to CORE service of `%4s' established\n", GNUNET_i2s (my_identity)); - GNUNET_assert (server != NULL); + GNUNET_assert (NULL != my_identity); p->id = *my_identity; - GNUNET_assert (p->ch == server); if (cls == &p1) { GNUNET_assert (ok == 2); -- cgit v1.2.3