aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2022-10-27 14:00:23 +0900
committerMartin Schanzenbach <schanzen@gnunet.org>2022-10-27 14:00:23 +0900
commitae8d5664c3fc944a61b52e33223b05f13c618523 (patch)
tree3dd186801ddaa8e846900993406fb1967cb4d814 /src
parent596988af1cbea04a9af1eeb66668f49b4ff876d5 (diff)
downloadgnunet-gtk-ae8d5664c3fc944a61b52e33223b05f13c618523.tar.gz
gnunet-gtk-ae8d5664c3fc944a61b52e33223b05f13c618523.zip
Silence warnings and port to gnunet 0.18.0
Diffstat (limited to 'src')
-rw-r--r--src/conversation/gnunet-conversation-gtk_import.c35
-rw-r--r--src/fs/gnunet-fs-gtk_main-window-search.c11
-rw-r--r--src/namestore/gnunet-namestore-gtk.c12
-rw-r--r--src/statistics/gtk_statistics.c4
4 files changed, 25 insertions, 37 deletions
diff --git a/src/conversation/gnunet-conversation-gtk_import.c b/src/conversation/gnunet-conversation-gtk_import.c
index cc16d386..9602ff7d 100644
--- a/src/conversation/gnunet-conversation-gtk_import.c
+++ b/src/conversation/gnunet-conversation-gtk_import.c
@@ -99,17 +99,14 @@ static int private_record;
99 * operation. 99 * operation.
100 * 100 *
101 * @param cls NULL 101 * @param cls NULL
102 * @param success #GNUNET_SYSERR on failure (including timeout/queue 102 * @param ec the error code
103 * drop/failure to validate) #GNUNET_NO if content was already there #GNUNET_YES
104 * (or other positive value) on success
105 * @param emsg NULL on success, otherwise an error message
106 */ 103 */
107static void 104static void
108add_contact_continuation (void *cls, int32_t success, const char *emsg) 105add_contact_continuation (void *cls, enum GNUNET_ErrorCode ec)
109{ 106{
110 if (GNUNET_YES != success) 107 if (GNUNET_EC_NONE != ec)
111 GCG_log (_ ("Adding contact failed: %s\n"), 108 GCG_log (_ ("Adding contact failed: %s\n"),
112 (GNUNET_NO == success) ? _ ("record exists") : emsg); 109 GNUNET_ErrorCode_get_hint (ec));
113 add_contact_qe = NULL; 110 add_contact_qe = NULL;
114} 111}
115 112
@@ -195,18 +192,16 @@ GSC_add_contact (const gchar *name, const gchar *address)
195 * add operation. Finish 'add phone' operation. 192 * add operation. Finish 'add phone' operation.
196 * 193 *
197 * @param cls closure 194 * @param cls closure
198 * @param success #GNUNET_SYSERR on failure (including timeout/queue 195 * @param ec the errro code
199 * drop/failure to validate) #GNUNET_NO if content was already there or not
200 * found #GNUNET_YES (or other positive value) on success
201 * @param emsg NULL on success, otherwise an error message
202 */ 196 */
203static void 197static void
204add_phone_continuation (void *cls, int32_t success, const char *emsg) 198add_phone_continuation (void *cls, enum GNUNET_ErrorCode ec)
205{ 199{
206 add_phone_qe = NULL; 200 add_phone_qe = NULL;
207 if (GNUNET_SYSERR == success) 201 if (GNUNET_EC_NONE != ec)
208 { 202 {
209 GCG_log (_ ("Failed to publish my PHONE record: %s\n"), emsg); 203 GCG_log (_ ("Failed to publish my PHONE record: %s\n"),
204 GNUNET_ErrorCode_get_hint (ec));
210 GNUNET_free (phone_label); 205 GNUNET_free (phone_label);
211 phone_label = NULL; 206 phone_label = NULL;
212 } 207 }
@@ -354,17 +349,15 @@ finish_shutdown ()
354 * with 'add phone' operation if one is pending. 349 * with 'add phone' operation if one is pending.
355 * 350 *
356 * @param cls closure 351 * @param cls closure
357 * @param success #GNUNET_SYSERR on failure (including timeout/queue 352 * @param ec the error code
358 * drop/failure to validate) #GNUNET_NO if content was already there or not
359 * found #GNUNET_YES (or other positive value) on success
360 * @param emsg NULL on success, otherwise an error message
361 */ 353 */
362static void 354static void
363remove_phone_continuation (void *cls, int32_t success, const char *emsg) 355remove_phone_continuation (void *cls, enum GNUNET_ErrorCode ec)
364{ 356{
365 remove_phone_qe = NULL; 357 remove_phone_qe = NULL;
366 if (GNUNET_SYSERR == success) 358 if (GNUNET_EC_NONE != ec)
367 GCG_log (_ ("Failed to remove PHONE record: %s\n"), emsg); 359 GCG_log (_ ("Failed to remove PHONE record: %s\n"),
360 GNUNET_ErrorCode_get_hint (ec));
368 if (GNUNET_YES == add_waiting) 361 if (GNUNET_YES == add_waiting)
369 add_phone (); 362 add_phone ();
370 if (GNUNET_YES == in_shutdown) 363 if (GNUNET_YES == in_shutdown)
diff --git a/src/fs/gnunet-fs-gtk_main-window-search.c b/src/fs/gnunet-fs-gtk_main-window-search.c
index 438a9517..fed27001 100644
--- a/src/fs/gnunet-fs-gtk_main-window-search.c
+++ b/src/fs/gnunet-fs-gtk_main-window-search.c
@@ -364,22 +364,19 @@ abort_pseu_lookup (struct PseuLookupContext *lctx)
364 * operation. 364 * operation.
365 * 365 *
366 * @param cls closure 366 * @param cls closure
367 * @param success #GNUNET_SYSERR on failure (including timeout/queue 367 * @param success the error code
368 * drop/failure to validate) #GNUNET_NO if content was already there or not
369 * found #GNUNET_YES (or other positive value) on success
370 * @param emsg NULL on success, otherwise an error message
371 */ 368 */
372static void 369static void
373store_continuation (void *cls, int32_t success, const char *emsg) 370store_continuation (void *cls, enum GNUNET_ErrorCode success)
374{ 371{
375 struct PseuLookupContext *lctx = cls; 372 struct PseuLookupContext *lctx = cls;
376 373
377 lctx->qe = NULL; 374 lctx->qe = NULL;
378 if (NULL != emsg) 375 if (GNUNET_EC_NONE != success)
379 { 376 {
380 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 377 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
381 _ ("Failed to save record: %s\n"), 378 _ ("Failed to save record: %s\n"),
382 emsg); 379 GNUNET_ErrorCode_get_hint (success));
383 beep (); 380 beep ();
384 } 381 }
385 abort_pseu_lookup (lctx); 382 abort_pseu_lookup (lctx);
diff --git a/src/namestore/gnunet-namestore-gtk.c b/src/namestore/gnunet-namestore-gtk.c
index ad5aa099..025aa9c5 100644
--- a/src/namestore/gnunet-namestore-gtk.c
+++ b/src/namestore/gnunet-namestore-gtk.c
@@ -764,26 +764,26 @@ check_record_permitted (unsigned int rd_count,
764 * Function called upon completion of an operation. 764 * Function called upon completion of an operation.
765 * 765 *
766 * @param cls the `struct OperationContext` of the operation that completed 766 * @param cls the `struct OperationContext` of the operation that completed
767 * @param success #GNUNET_OK if the operation succeeded 767 * @param ec the error code
768 * @param emsg error message if the operation failed
769 */ 768 */
770static void 769static void
771operation_done_cont (void *cls, int32_t success, const char *emsg) 770operation_done_cont (void *cls, enum GNUNET_ErrorCode ec)
772{ 771{
773 struct OperationContext *oc = cls; 772 struct OperationContext *oc = cls;
774 GtkWidget *dialog; 773 GtkWidget *dialog;
775 774
776 oc->qe = NULL; 775 oc->qe = NULL;
777 GNUNET_CONTAINER_DLL_remove (oc_head, oc_tail, oc); 776 GNUNET_CONTAINER_DLL_remove (oc_head, oc_tail, oc);
778 if (GNUNET_SYSERR == success) 777 if (GNUNET_EC_NONE != ec)
779 { 778 {
780 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _ ("Operation failed: `%s'\n"), emsg); 779 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _ ("Operation failed: `%s'\n"),
780 GNUNET_ErrorCode_get_hint (ec));
781 dialog = gtk_message_dialog_new (GTK_WINDOW (main_window), 781 dialog = gtk_message_dialog_new (GTK_WINDOW (main_window),
782 GTK_DIALOG_DESTROY_WITH_PARENT, 782 GTK_DIALOG_DESTROY_WITH_PARENT,
783 GTK_MESSAGE_ERROR, 783 GTK_MESSAGE_ERROR,
784 GTK_BUTTONS_CLOSE, 784 GTK_BUTTONS_CLOSE,
785 _ ("Operation failed: `%s'\n"), 785 _ ("Operation failed: `%s'\n"),
786 emsg); 786 GNUNET_ErrorCode_get_hint (ec));
787 g_signal_connect_swapped (dialog, 787 g_signal_connect_swapped (dialog,
788 "response", 788 "response",
789 G_CALLBACK (gtk_widget_destroy), 789 G_CALLBACK (gtk_widget_destroy),
diff --git a/src/statistics/gtk_statistics.c b/src/statistics/gtk_statistics.c
index 3a7aba8e..e9e4360c 100644
--- a/src/statistics/gtk_statistics.c
+++ b/src/statistics/gtk_statistics.c
@@ -178,9 +178,7 @@ gtk_statistics_init (GtkStatistics *statistics)
178{ 178{
179 GtkStatisticsPrivate *priv; 179 GtkStatisticsPrivate *priv;
180 180
181 statistics->priv = G_TYPE_INSTANCE_GET_PRIVATE (statistics, 181 statistics->priv = gtk_statistics_get_instance_private (statistics);
182 GTK_TYPE_STATISTICS,
183 GtkStatisticsPrivate);
184 priv = statistics->priv; 182 priv = statistics->priv;
185#if GTK_MAJOR_VERSION < 3 183#if GTK_MAJOR_VERSION < 3
186 g_signal_connect (statistics, 184 g_signal_connect (statistics,