diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-12-14 19:53:29 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-12-14 19:53:34 +0100 |
commit | a398d5ee9672e6d773cccae03513a812b7230cd2 (patch) | |
tree | 85d83ad3dea55b0402168dda2d22ed393cc8b11d | |
parent | 6cbfc3b9b5b91fe903e8b22e5bab59ae9d8ad7ab (diff) | |
download | anastasis-gtk-a398d5ee9672e6d773cccae03513a812b7230cd2.tar.gz anastasis-gtk-a398d5ee9672e6d773cccae03513a812b7230cd2.tar.bz2 anastasis-gtk-a398d5ee9672e6d773cccae03513a812b7230cd2.zip |
-fix FTBFS for Taler protocol v11
6 files changed, 34 insertions, 37 deletions
diff --git a/src/anastasis/anastasis-gtk_action.c b/src/anastasis/anastasis-gtk_action.c index 79b7f3d..823f5f6 100644 --- a/src/anastasis/anastasis-gtk_action.c +++ b/src/anastasis/anastasis-gtk_action.c @@ -1145,10 +1145,10 @@ update_entry (const char *name, static void action_secret_editing (void) { - struct GNUNET_TIME_Absolute exp_time; + struct GNUNET_TIME_Timestamp exp_time; struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_absolute_time ("expiration", - &exp_time), + GNUNET_JSON_spec_timestamp ("expiration", + &exp_time), GNUNET_JSON_spec_end () }; struct tm tv; @@ -1168,7 +1168,7 @@ action_secret_editing (void) { time_t t; - t = exp_time.abs_value_us / GNUNET_TIME_UNIT_SECONDS.rel_value_us; + t = exp_time.abs_time.abs_value_us / GNUNET_TIME_UNIT_SECONDS.rel_value_us; GNUNET_assert (NULL != localtime_r (&t, &tv)); @@ -1587,7 +1587,7 @@ action_backup_finished (void) json_t *se; const char *url; GtkListStore *ls; - struct GNUNET_TIME_Absolute mexp; + struct GNUNET_TIME_Timestamp mexp; AG_hide_all_frames (); det = json_object_get (AG_redux_state, @@ -1595,16 +1595,16 @@ action_backup_finished (void) ls = GTK_LIST_STORE (GCG_get_main_window_object ( "backup_provider_liststore")); gtk_list_store_clear (ls); - mexp = GNUNET_TIME_UNIT_FOREVER_ABS; + mexp = GNUNET_TIME_UNIT_FOREVER_TS; json_object_foreach (det, url, se) { - struct GNUNET_TIME_Absolute pexp; + struct GNUNET_TIME_Timestamp pexp; uint64_t version; struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_uint64 ("policy_version", &version), - GNUNET_JSON_spec_absolute_time ("policy_expiration", - &pexp), + GNUNET_JSON_spec_timestamp ("policy_expiration", + &pexp), GNUNET_JSON_spec_end () }; @@ -1617,8 +1617,8 @@ action_backup_finished (void) AG_error ("State did not parse correctly"); return; } - mexp = GNUNET_TIME_absolute_min (mexp, - pexp); + mexp = GNUNET_TIME_timestamp_min (mexp, + pexp); gtk_list_store_insert_with_values ( ls, NULL, @@ -1628,7 +1628,7 @@ action_backup_finished (void) AG_BPC_BACKUP_VERSION, (guint64) version, AG_BPC_EXPIRATION_TIME_STR, - GNUNET_STRINGS_absolute_time_to_string (pexp), + GNUNET_TIME_timestamp2s (pexp), AG_BPC_SUCCESS_FLAG, true, AG_BPC_PROVIDER_NAME, @@ -1639,11 +1639,12 @@ action_backup_finished (void) struct tm tv; char estr[128]; time_t t; + struct GNUNET_TIME_Absolute sexp; /* be more conservative in what we show */ - mexp = GNUNET_TIME_absolute_subtract (mexp, + sexp = GNUNET_TIME_absolute_subtract (mexp.abs_time, GNUNET_TIME_UNIT_DAYS); - t = mexp.abs_value_us / GNUNET_TIME_UNIT_SECONDS.rel_value_us; + t = sexp.abs_value_us / GNUNET_TIME_UNIT_SECONDS.rel_value_us; GNUNET_assert (NULL != localtime_r (&t, &tv)); @@ -1653,7 +1654,7 @@ action_backup_finished (void) "%d %B %Y", &tv)); update_label ("backup_expiration_date_label", - GNUNET_STRINGS_absolute_time_to_string (mexp)); + GNUNET_TIME_absolute2s (sexp)); } AG_hide ("anastasis_gtk_progress_vbox"); AG_hide ("anastasis_gtk_backup_progress_scrolled_window"); diff --git a/src/anastasis/anastasis-gtk_handle-core-secret-changed.c b/src/anastasis/anastasis-gtk_handle-core-secret-changed.c index 5498077..906ef29 100644 --- a/src/anastasis/anastasis-gtk_handle-core-secret-changed.c +++ b/src/anastasis/anastasis-gtk_handle-core-secret-changed.c @@ -37,7 +37,7 @@ anastasis_gtk_enter_secret_textbuffer_changed_cb (GtkTextBuffer *tb, gpointer user_data) { json_t *arguments; - struct GNUNET_TIME_Absolute expiration; + struct GNUNET_TIME_Timestamp expiration; GtkTextIter start; GtkTextIter end; const char *text; @@ -54,7 +54,7 @@ anastasis_gtk_enter_secret_textbuffer_changed_cb (GtkTextBuffer *tb, return; AG_in_secret_editing = true; expiration = AG_get_desired_expiration (); - if (0 == expiration.abs_value_us) + if (GNUNET_TIME_absolute_is_zero (expiration.abs_time)) return; /* failured */ if ( (NULL == text) || (0 == strlen (text)) ) @@ -75,7 +75,7 @@ anastasis_gtk_enter_secret_textbuffer_changed_cb (GtkTextBuffer *tb, "mime", "text/plain", "expiration", - GNUNET_JSON_from_time_abs (expiration)); + GNUNET_JSON_from_timestamp (expiration)); GNUNET_assert (NULL != arguments); AG_freeze (); AG_ra = ANASTASIS_redux_action (AG_redux_state, diff --git a/src/anastasis/anastasis-gtk_handle-expiration-change.c b/src/anastasis/anastasis-gtk_handle-expiration-change.c index 8ce6442..a713eee 100644 --- a/src/anastasis/anastasis-gtk_handle-expiration-change.c +++ b/src/anastasis/anastasis-gtk_handle-expiration-change.c @@ -29,16 +29,15 @@ #include <jansson.h> -struct GNUNET_TIME_Absolute +struct GNUNET_TIME_Timestamp AG_get_desired_expiration () { GtkSpinButton *spin_button; gint value; - struct GNUNET_TIME_Absolute res; - struct GNUNET_TIME_Absolute exp_time; + struct GNUNET_TIME_Timestamp exp_time; struct GNUNET_JSON_Specification spec[] = { - GNUNET_JSON_spec_absolute_time ("expiration", - &exp_time), + GNUNET_JSON_spec_timestamp ("expiration", + &exp_time), GNUNET_JSON_spec_end () }; struct tm tv; @@ -50,13 +49,13 @@ AG_get_desired_expiration () { GNUNET_break (0); AG_error ("State did not parse correctly: lacks expiration"); - return GNUNET_TIME_UNIT_ZERO_ABS; + return GNUNET_TIME_UNIT_ZERO_TS; } { time_t t; - t = exp_time.abs_value_us / GNUNET_TIME_UNIT_SECONDS.rel_value_us; + t = exp_time.abs_time.abs_value_us / GNUNET_TIME_UNIT_SECONDS.rel_value_us; GNUNET_assert (NULL != localtime_r (&t, &tv)); @@ -69,9 +68,8 @@ AG_get_desired_expiration () { time_t t = mktime (&tv); - res.abs_value_us = t * GNUNET_TIME_UNIT_SECONDS.rel_value_us; + return GNUNET_TIME_timestamp_from_s (t); } - return res; } @@ -88,17 +86,16 @@ expiration_year_spin_button_value_changed_cb ( gpointer user_data) { json_t *arg; - struct GNUNET_TIME_Absolute expiration; + struct GNUNET_TIME_Timestamp expiration; if (AG_in_action) return; expiration = AG_get_desired_expiration (); - if (0 == expiration.abs_value_us) + if (GNUNET_TIME_absolute_is_zero (expiration.abs_time)) return; /* failured */ - (void) GNUNET_TIME_round_abs (&expiration); arg = GNUNET_JSON_PACK ( - GNUNET_JSON_pack_time_abs ("expiration", - (expiration))); + GNUNET_JSON_pack_timestamp ("expiration", + expiration)); AG_freeze (); AG_ra = ANASTASIS_redux_action (AG_redux_state, "update_expiration", diff --git a/src/anastasis/anastasis-gtk_handle-expiration-change.h b/src/anastasis/anastasis-gtk_handle-expiration-change.h index 28defc3..8f926c1 100644 --- a/src/anastasis/anastasis-gtk_handle-expiration-change.h +++ b/src/anastasis/anastasis-gtk_handle-expiration-change.h @@ -30,7 +30,7 @@ * Return the current expiration time desired by the * user (in the 'edit secret' dialog). */ -struct GNUNET_TIME_Absolute +struct GNUNET_TIME_Timestamp AG_get_desired_expiration (void); #endif diff --git a/src/anastasis/anastasis-gtk_handle-method-totp.c b/src/anastasis/anastasis-gtk_handle-method-totp.c index b85e6d4..9c44a36 100644 --- a/src/anastasis/anastasis-gtk_handle-method-totp.c +++ b/src/anastasis/anastasis-gtk_handle-method-totp.c @@ -69,7 +69,6 @@ compute_totp (int time_off) uint8_t hmac[20]; /* SHA1: 20 bytes */ now = GNUNET_TIME_absolute_get (); - (void) GNUNET_TIME_round_abs (&now); while (time_off < 0) { now = GNUNET_TIME_absolute_subtract (now, diff --git a/src/anastasis/anastasis-gtk_handle-secret-buttons.c b/src/anastasis/anastasis-gtk_handle-secret-buttons.c index c7bfe30..5aa97dc 100644 --- a/src/anastasis/anastasis-gtk_handle-secret-buttons.c +++ b/src/anastasis/anastasis-gtk_handle-secret-buttons.c @@ -136,10 +136,10 @@ open_secret_dialog_response_cb (GtkDialog *dialog, data_size); { json_t *arguments; - struct GNUNET_TIME_Absolute expiration; + struct GNUNET_TIME_Timestamp expiration; expiration = AG_get_desired_expiration (); - if (0 == expiration.abs_value_us) + if (GNUNET_TIME_absolute_is_zero (expiration.abs_time)) { GNUNET_free (data); GNUNET_free (filename); @@ -157,7 +157,7 @@ open_secret_dialog_response_cb (GtkDialog *dialog, "mime", mime, "expiration", - GNUNET_JSON_from_time_abs (expiration)); + GNUNET_JSON_from_timestamp (expiration)); GNUNET_free (filename); GNUNET_free (data); GNUNET_assert (NULL != arguments); |