[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis-gtk] branch master updated: adapt to latest GNUnet API:
From: |
gnunet |
Subject: |
[taler-anastasis-gtk] branch master updated: adapt to latest GNUnet API: GNUNET_JSON_spec_mark_optional() changed |
Date: |
Tue, 05 Apr 2022 17:16:13 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository anastasis-gtk.
The following commit(s) were added to refs/heads/master by this push:
new 47b7418 adapt to latest GNUnet API: GNUNET_JSON_spec_mark_optional()
changed
47b7418 is described below
commit 47b7418ded6f139d22404aeea72aa8f48fdcade8
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Tue Apr 5 17:16:11 2022 +0200
adapt to latest GNUnet API: GNUNET_JSON_spec_mark_optional() changed
---
src/anastasis/anastasis-gtk_action.c | 110 +++++++++++++--------
src/anastasis/anastasis-gtk_attributes.c | 7 +-
src/anastasis/anastasis-gtk_autocomplete.c | 18 ++--
src/anastasis/anastasis-gtk_handle-add-provider.c | 3 +-
...astasis-gtk_handle-auth-edit-provider-clicked.c | 19 ++--
.../anastasis-gtk_handle-identity-changed.c | 3 +-
.../anastasis-gtk_handle-secret-buttons.c | 39 +++++---
7 files changed, 124 insertions(+), 75 deletions(-)
diff --git a/src/anastasis/anastasis-gtk_action.c
b/src/anastasis/anastasis-gtk_action.c
index 7beabbf..efca017 100644
--- a/src/anastasis/anastasis-gtk_action.c
+++ b/src/anastasis/anastasis-gtk_action.c
@@ -71,11 +71,12 @@ lookup_provider_name (const char *provider_url)
{
json_t *providers;
json_t *provider;
- const char *name;
+ const char *name = NULL;
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("business_name",
- &name)),
+ &name),
+ NULL),
GNUNET_JSON_spec_end ()
};
@@ -519,13 +520,16 @@ action_user_attributes_collecting (void)
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("widget",
- &widget_name)),
+ &widget_name),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_bool ("optional",
- &optional)),
+ &optional),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("tooltip",
- &attr_tooltip)),
+ &attr_tooltip),
+ NULL),
GNUNET_JSON_spec_string ("type",
&attr_type),
GNUNET_JSON_spec_string ("uuid",
@@ -534,7 +538,8 @@ action_user_attributes_collecting (void)
&attr_name),
GNUNET_JSON_spec_mark_optional (
TALER_JSON_spec_i18n_str ("label",
- &attr_label)),
+ &attr_label),
+ NULL),
GNUNET_JSON_spec_end ()
};
struct GNUNET_HashCode uh;
@@ -720,16 +725,20 @@ action_authentications_editing (void)
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_uint32 ("error_code",
- &ec)),
+ &ec),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_json ("methods",
- &methods)),
+ &methods),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_uint32 ("http_status",
- &hc)),
+ &hc),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_bool ("disabled",
- &disabled)),
+ &disabled),
+ NULL),
GNUNET_JSON_spec_end ()
};
@@ -1260,10 +1269,12 @@ action_secret_editing (void)
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_json ("core_secret",
- &jsecret)),
+ &jsecret),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("secret_name",
- &name)),
+ &name),
+ NULL),
GNUNET_JSON_spec_end ()
};
@@ -1289,13 +1300,16 @@ action_secret_editing (void)
struct GNUNET_JSON_Specification sspec[] = {
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("text",
- &text)),
+ &text),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("mime",
- &mime)),
+ &mime),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("filename",
- &filename)),
+ &filename),
+ NULL),
GNUNET_JSON_spec_end ()
};
@@ -1696,19 +1710,22 @@ show_challenge_feedback (const char *uuid,
const char *state;
const char *hint = NULL;
const char *taler_pay_uri = NULL;
- uint32_t ec = 0;
+ uint32_t ec = TALER_EC_NONE;
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_string ("state",
&state),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("taler_pay_uri",
- &taler_pay_uri)),
+ &taler_pay_uri),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("display_hint",
- &hint)),
+ &hint),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_uint32 ("error_code",
- &ec)),
+ &ec),
+ NULL),
GNUNET_JSON_spec_end ()
};
@@ -2256,10 +2273,12 @@ add_challenge (GtkBox *challenge_box,
&iuuid),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_bool ("async",
- &async)),
+ &async),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_bool ("solved",
- &solved)),
+ &solved),
+ NULL),
GNUNET_JSON_spec_end ()
};
bool ok = true;
@@ -2565,7 +2584,8 @@ action_challenge_selecting (void)
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_bool ("async",
- &async)),
+ &async),
+ NULL),
GNUNET_JSON_spec_end ()
};
const json_t *ks;
@@ -2640,13 +2660,14 @@ action_challenge_paying (void)
&state),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("taler_pay_uri",
- &payto)),
+ &payto),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("provider",
- &provider)),
- GNUNET_JSON_spec_mark_optional (
- GNUNET_JSON_spec_string ("payment_secret",
- &ps)),
+ &provider),
+ NULL),
+ GNUNET_JSON_spec_string ("payment_secret",
+ &ps),
GNUNET_JSON_spec_end ()
};
GdkPixbuf *pb;
@@ -2752,7 +2773,7 @@ render_feedback (GtkBuilder *builder,
const char *hint = NULL;
json_t *details = NULL;
const char *taler_pay_uri = NULL;
- uint32_t ec = 0;
+ uint32_t ec = TALER_EC_NONE;
uint32_t http_status = 0;
bool hide = false;
struct GNUNET_JSON_Specification spec[] = {
@@ -2760,22 +2781,28 @@ render_feedback (GtkBuilder *builder,
&state),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("taler_pay_uri",
- &taler_pay_uri)),
+ &taler_pay_uri),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_json ("details",
- &details)),
+ &details),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("redirect_url",
- &redirect_url)),
+ &redirect_url),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("hint",
- &hint)),
+ &hint),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_uint32 ("http_status",
- &http_status)),
+ &http_status),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_uint32 ("error_code",
- &ec)),
+ &ec),
+ NULL),
GNUNET_JSON_spec_end ()
};
GtkLabel *elabel;
@@ -2828,10 +2855,12 @@ render_feedback (GtkBuilder *builder,
&code),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("hint",
- &hint)),
+ &hint),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("detail",
- &detail)),
+ &detail),
+ NULL),
GNUNET_JSON_spec_end ()
};
@@ -3299,14 +3328,17 @@ action_recovery_finished (void)
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("mime",
- &mime)),
+ &mime),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("text",
- &text)),
+ &text),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_varsize ("value",
&data,
- &data_size)),
+ &data_size),
+ NULL),
GNUNET_JSON_spec_end ()
};
GdkPixbuf *pb;
diff --git a/src/anastasis/anastasis-gtk_attributes.c
b/src/anastasis/anastasis-gtk_attributes.c
index 14e790b..f2c7e82 100644
--- a/src/anastasis/anastasis-gtk_attributes.c
+++ b/src/anastasis/anastasis-gtk_attributes.c
@@ -100,11 +100,12 @@ AG_collect_attributes (bool partial)
const char *attr_name;
const char *attr_type;
const char *attr_uuid;
- int optional = false;
+ bool optional = false;
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_mark_optional (
- GNUNET_JSON_spec_boolean ("optional",
- &optional)),
+ GNUNET_JSON_spec_bool ("optional",
+ &optional),
+ NULL),
GNUNET_JSON_spec_string ("type",
&attr_type),
GNUNET_JSON_spec_string ("name",
diff --git a/src/anastasis/anastasis-gtk_autocomplete.c
b/src/anastasis/anastasis-gtk_autocomplete.c
index c941d25..8c522d1 100644
--- a/src/anastasis/anastasis-gtk_autocomplete.c
+++ b/src/anastasis/anastasis-gtk_autocomplete.c
@@ -57,11 +57,13 @@ lookup_autocomplete (GtkEditable *editable)
bool match;
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_mark_optional (
- GNUNET_JSON_spec_string ("widget",
- &widget_name)),
+ GNUNET_JSON_spec_string ("widget",
+ &widget_name),
+ NULL),
GNUNET_JSON_spec_mark_optional (
- GNUNET_JSON_spec_string ("autocomplete",
- &autocomplete)),
+ GNUNET_JSON_spec_string ("autocomplete",
+ &autocomplete),
+ NULL),
GNUNET_JSON_spec_string ("type",
&type),
GNUNET_JSON_spec_end ()
@@ -154,7 +156,7 @@ anastasis_gtk_autocomplete_insert_text (GtkEditable
*editable,
pos = gtk_editable_get_position (editable);
if (strlen (ac) <= pos + new_text_length)
return;
- if (ac[pos+new_text_length] != '?')
+ if (ac[pos + new_text_length] != '?')
{
g_signal_stop_emission_by_name (editable,
"insert-text");
@@ -162,7 +164,7 @@ anastasis_gtk_autocomplete_insert_text (GtkEditable
*editable,
"%.*s%c",
new_text_length,
new_text,
- ac[pos+new_text_length]);
+ ac[pos + new_text_length]);
gtk_editable_insert_text (editable,
replacement,
-1,
@@ -211,7 +213,7 @@ anastasis_gtk_pin_autocomplete_insert_text (GtkEditable
*editable,
pos = gtk_editable_get_position (editable);
if (strlen (ac) <= pos + new_text_length)
return;
- if (ac[pos+new_text_length] != '?')
+ if (ac[pos + new_text_length] != '?')
{
g_signal_stop_emission_by_name (editable,
"insert-text");
@@ -219,7 +221,7 @@ anastasis_gtk_pin_autocomplete_insert_text (GtkEditable
*editable,
"%.*s%c",
new_text_length,
new_text,
- ac[pos+new_text_length]);
+ ac[pos + new_text_length]);
gtk_editable_insert_text (editable,
replacement,
-1,
diff --git a/src/anastasis/anastasis-gtk_handle-add-provider.c
b/src/anastasis/anastasis-gtk_handle-add-provider.c
index 8bf68e9..ae85b46 100644
--- a/src/anastasis/anastasis-gtk_handle-add-provider.c
+++ b/src/anastasis/anastasis-gtk_handle-add-provider.c
@@ -86,7 +86,8 @@ config_cb (void *cls,
GNUNET_assert (NULL != methods_list);
for (unsigned int i = 0; i<acfg->methods_length; i++)
{
- struct ANASTASIS_AuthorizationMethodConfig *method = &acfg->methods[i];
+ const struct ANASTASIS_AuthorizationMethodConfig *method
+ = &acfg->methods[i];
json_t *mj = GNUNET_JSON_PACK (
GNUNET_JSON_pack_string ("type",
method->type),
diff --git a/src/anastasis/anastasis-gtk_handle-auth-edit-provider-clicked.c
b/src/anastasis/anastasis-gtk_handle-auth-edit-provider-clicked.c
index 28e7199..1c0ddb1 100644
--- a/src/anastasis/anastasis-gtk_handle-auth-edit-provider-clicked.c
+++ b/src/anastasis/anastasis-gtk_handle-auth-edit-provider-clicked.c
@@ -445,27 +445,32 @@ anastasis_gtk_edit_provider_list_clicked_cb (GtkButton
*object,
const json_t *provider;
json_object_foreach (providers, url, provider)
{
- uint32_t http_code;
- uint32_t ec;
+ uint32_t http_code = 0;
+ uint32_t ec = TALER_EC_NONE;
struct TALER_Amount ll;
bool disabled = false;
const char *name = NULL;
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_uint32 ("http_status",
- &http_code)),
+ &http_code),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("business_name",
- &name)),
+ &name),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_bool ("disabled",
- &disabled)),
+ &disabled),
+ NULL),
GNUNET_JSON_spec_mark_optional (
TALER_JSON_spec_amount_any ("liability_limit",
- &ll)),
+ &ll),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_uint32 ("error_code",
- &ec)),
+ &ec),
+ NULL),
GNUNET_JSON_spec_end ()
};
char *status;
diff --git a/src/anastasis/anastasis-gtk_handle-identity-changed.c
b/src/anastasis/anastasis-gtk_handle-identity-changed.c
index c84c031..701ed8e 100644
--- a/src/anastasis/anastasis-gtk_handle-identity-changed.c
+++ b/src/anastasis/anastasis-gtk_handle-identity-changed.c
@@ -92,7 +92,8 @@ AG_mark_invalid_input (const char *name)
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("widget",
- &widget_name)),
+ &widget_name),
+ NULL),
GNUNET_JSON_spec_string ("type",
&attr_type),
GNUNET_JSON_spec_string ("uuid",
diff --git a/src/anastasis/anastasis-gtk_handle-secret-buttons.c
b/src/anastasis/anastasis-gtk_handle-secret-buttons.c
index 5aa97dc..5193be6 100644
--- a/src/anastasis/anastasis-gtk_handle-secret-buttons.c
+++ b/src/anastasis/anastasis-gtk_handle-secret-buttons.c
@@ -222,18 +222,20 @@ save_secret_dialog_response_cb (GtkDialog *dialog,
{
GtkBuilder *builder = GTK_BUILDER (user_data);
char *filename;
- size_t data_len;
- const char *text;
- void *data;
+ size_t data_len = 0;
+ const char *text = NULL;
+ void *data = NULL;
json_t *cs;
struct GNUNET_JSON_Specification cspec[] = {
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("text",
- &text)),
+ &text),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_varsize ("value",
&data,
- &data_len)),
+ &data_len),
+ NULL),
GNUNET_JSON_spec_end ()
};
@@ -330,16 +332,18 @@ anastasis_gtk_secret_save_as_button_clicked_cb (GtkButton
*button,
GtkWidget *ad;
GtkBuilder *builder;
- const char *mime;
- const char *fn;
+ const char *mime = NULL;
+ const char *fn = NULL;
json_t *cs;
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("filename",
- &fn)),
+ &fn),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("mime",
- &mime)),
+ &mime),
+ NULL),
GNUNET_JSON_spec_end ()
};
@@ -398,22 +402,25 @@ void
anastasis_gtk_secret_copy_button_clicked_cb (GtkButton *button,
gpointer user_data)
{
- size_t data_len;
- void *data;
- const char *mime;
- const char *text;
+ size_t data_len = 0;
+ void *data = NULL;
+ const char *mime = NULL;
+ const char *text = NULL;
json_t *cs;
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_varsize ("value",
&data,
- &data_len)),
+ &data_len),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("mime",
- &mime)),
+ &mime),
+ NULL),
GNUNET_JSON_spec_mark_optional (
GNUNET_JSON_spec_string ("text",
- &text)),
+ &text),
+ NULL),
GNUNET_JSON_spec_end ()
};
GtkClipboard *cb;
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-anastasis-gtk] branch master updated: adapt to latest GNUnet API: GNUNET_JSON_spec_mark_optional() changed,
gnunet <=