gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-exchange] branch master updated: -more bool cleanup


From: gnunet
Subject: [taler-exchange] branch master updated: -more bool cleanup
Date: Mon, 28 Feb 2022 22:46:26 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new a8d9e7e0 -more bool cleanup
a8d9e7e0 is described below

commit a8d9e7e0a61cd9f23371d09bec244a6e11683efc
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Mon Feb 28 22:46:24 2022 +0100

    -more bool cleanup
---
 src/exchangedb/irbt_callbacks.c |  4 +++-
 src/exchangedb/lrbt_callbacks.c | 23 ++++++++++-------------
 2 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/src/exchangedb/irbt_callbacks.c b/src/exchangedb/irbt_callbacks.c
index 44acaf8a..a994c611 100644
--- a/src/exchangedb/irbt_callbacks.c
+++ b/src/exchangedb/irbt_callbacks.c
@@ -524,7 +524,9 @@ irbt_cb_table_deposits (struct PostgresClosure *pg,
     GNUNET_PQ_query_param_bool (td->details.deposits.tiny),
     GNUNET_PQ_query_param_bool (td->details.deposits.done),
     GNUNET_PQ_query_param_bool (td->details.deposits.extension_blocked),
-    GNUNET_PQ_query_param_uint64 (
+    0 == td->details.deposits.extension_details_serial_id
+    ? GNUNET_PQ_query_param_null ()
+    : GNUNET_PQ_query_param_uint64 (
       &td->details.deposits.extension_details_serial_id),
     GNUNET_PQ_query_param_end
   };
diff --git a/src/exchangedb/lrbt_callbacks.c b/src/exchangedb/lrbt_callbacks.c
index 1f2ad604..f8c93a38 100644
--- a/src/exchangedb/lrbt_callbacks.c
+++ b/src/exchangedb/lrbt_callbacks.c
@@ -458,7 +458,6 @@ lrbt_cb_table_auditors (void *cls,
 
   for (unsigned int i = 0; i<num_results; i++)
   {
-    uint8_t is_active8 = 0;
     struct GNUNET_PQ_ResultSpec rs[] = {
       GNUNET_PQ_result_spec_uint64 ("serial",
                                     &td.serial),
@@ -468,8 +467,8 @@ lrbt_cb_table_auditors (void *cls,
                                     &td.details.auditors.auditor_url),
       GNUNET_PQ_result_spec_string ("auditor_name",
                                     &td.details.auditors.auditor_name),
-      GNUNET_PQ_result_spec_auto_from_type ("is_active",
-                                            &is_active8),
+      GNUNET_PQ_result_spec_bool ("is_active",
+                                  &td.details.auditors.is_active),
       GNUNET_PQ_result_spec_timestamp ("last_change",
                                        &td.details.auditors.last_change),
       GNUNET_PQ_result_spec_end
@@ -484,7 +483,6 @@ lrbt_cb_table_auditors (void *cls,
       ctx->error = true;
       return;
     }
-    td.details.auditors.is_active = (0 != is_active8);
     ctx->cb (ctx->cb_cls,
              &td);
     GNUNET_PQ_cleanup_result (rs);
@@ -908,8 +906,7 @@ lrbt_cb_table_deposits (void *cls,
 
   for (unsigned int i = 0; i<num_results; i++)
   {
-    uint8_t tiny = 0; /* initialized to make compiler happy */
-    uint8_t done = 0; /* initialized to make compiler happy */
+    bool no_extension;
     struct GNUNET_PQ_ResultSpec rs[] = {
       GNUNET_PQ_result_spec_uint64 (
         "serial",
@@ -950,18 +947,20 @@ lrbt_cb_table_deposits (void *cls,
       GNUNET_PQ_result_spec_uint64 (
         "wire_target_serial_id",
         &td.details.deposits.wire_target_serial_id),
-      GNUNET_PQ_result_spec_auto_from_type (
+      GNUNET_PQ_result_spec_bool (
         "tiny",
         &td.details.deposits.tiny),
-      GNUNET_PQ_result_spec_auto_from_type (
+      GNUNET_PQ_result_spec_bool (
         "done",
         &td.details.deposits.done),
       GNUNET_PQ_result_spec_auto_from_type (
         "extension_blocked",
         &td.details.deposits.extension_blocked),
-      GNUNET_PQ_result_spec_uint64 (
-        "extension_details_serial_id",
-        &td.details.deposits.extension_details_serial_id),
+      GNUNET_PQ_result_spec_allow_null (
+        GNUNET_PQ_result_spec_uint64 (
+          "extension_details_serial_id",
+          &td.details.deposits.extension_details_serial_id),
+        &no_extension),
       GNUNET_PQ_result_spec_end
     };
 
@@ -974,8 +973,6 @@ lrbt_cb_table_deposits (void *cls,
       ctx->error = true;
       return;
     }
-    td.details.deposits.tiny = (0 != tiny);
-    td.details.deposits.done = (0 != done);
     ctx->cb (ctx->cb_cls,
              &td);
     GNUNET_PQ_cleanup_result (rs);

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]