gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-exchange] branch master updated (602093e9 -> cf62f51


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated (602093e9 -> cf62f519)
Date: Mon, 08 Apr 2019 16:58:46 +0200

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

ng0 pushed a change to branch master
in repository exchange.

    from 602093e9 notes
     new 0b8a8712 Refactor auditor/taler-auditor.c for GNUNET_memcmp
     new 79dcb727 Refactor auditor/taler-wire-auditor.c for GNUNET_memcmp
     new d55c2acb refactor util/test_crypto.c for GNUNET_memcmp
     new a5007df7 refactor for GNUNET_memcmp
     new cf62f519 refactor for GNUNET_memcmp

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/auditor/taler-auditor.c                        | 45 +++++++++-------------
 src/auditor/taler-wire-auditor.c                   | 10 ++---
 src/lib/testing_api_cmd_track.c                    |  5 +--
 src/util/test_crypto.c                             | 15 +++-----
 .../test_wire_plugin_transactions_taler-bank.c     |  5 +--
 5 files changed, 32 insertions(+), 48 deletions(-)

diff --git a/src/auditor/taler-auditor.c b/src/auditor/taler-auditor.c
index 1b9c99c8..9d629d1e 100644
--- a/src/auditor/taler-auditor.c
+++ b/src/auditor/taler-auditor.c
@@ -1975,12 +1975,10 @@ check_transaction_history (const struct 
TALER_CoinSpendPublicKeyP *coin_pub,
       }
       /* Check if this deposit is within the remit of the aggregation
          we are investigating, if so, include it in the totals. */
-      if ( (0 == memcmp (merchant_pub,
-                         &tl->details.deposit->merchant_pub,
-                         sizeof (struct TALER_MerchantPublicKeyP))) &&
-           (0 == memcmp (h_contract_terms,
-                         &tl->details.deposit->h_contract_terms,
-                         sizeof (struct GNUNET_HashCode))) )
+      if ( (0 == GNUNET_memcmp (merchant_pub,
+                                &tl->details.deposit->merchant_pub)) &&
+           (0 == GNUNET_memcmp (h_contract_terms,
+                                &tl->details.deposit->h_contract_terms)) )
       {
         struct TALER_Amount amount_without_fee;
 
@@ -2063,12 +2061,10 @@ check_transaction_history (const struct 
TALER_CoinSpendPublicKeyP *coin_pub,
       }
       /* Check if this refund is within the remit of the aggregation
          we are investigating, if so, include it in the totals. */
-      if ( (0 == memcmp (merchant_pub,
-                         &tl->details.refund->merchant_pub,
-                         sizeof (struct TALER_MerchantPublicKeyP))) &&
-           (0 == memcmp (h_contract_terms,
-                         &tl->details.refund->h_contract_terms,
-                         sizeof (struct GNUNET_HashCode))) )
+      if ( (0 == GNUNET_memcmp (merchant_pub,
+                                &tl->details.refund->merchant_pub)) &&
+           (0 == GNUNET_memcmp (h_contract_terms,
+                                &tl->details.refund->h_contract_terms)) )
       {
         if (GNUNET_OK !=
             TALER_amount_add (&merchant_loss,
@@ -2223,9 +2219,8 @@ wire_transfer_information_cb (void *cls,
     return;
   }
   if (0 !=
-      memcmp (&hw,
-              h_wire,
-              sizeof (struct GNUNET_HashCode)))
+      GNUNET_memcmp (&hw,
+                     h_wire))
   {
     wcc->qs = GNUNET_DB_STATUS_HARD_ERROR;
     report_row_inconsistency ("aggregation",
@@ -2320,18 +2315,16 @@ wire_transfer_information_cb (void *cls,
                                    tl);
 
   /* Check other details of wire transfer match */
-  if (0 != memcmp (h_wire,
-                   &wcc->h_wire,
-                   sizeof (struct GNUNET_HashCode)))
+  if (0 != GNUNET_memcmp (h_wire,
+                          &wcc->h_wire))
   {
     wcc->qs = GNUNET_DB_STATUS_HARD_ERROR;
     report_row_inconsistency ("aggregation",
                               rowid,
                               "wire method of aggregate do not match wire 
transfer");
   }
-  if (0 != memcmp (h_wire,
-                   &wcc->h_wire,
-                   sizeof (struct GNUNET_HashCode)))
+  if (0 != GNUNET_memcmp (h_wire,
+                          &wcc->h_wire))
   {
     wcc->qs = GNUNET_DB_STATUS_HARD_ERROR;
     report_row_inconsistency ("aggregation",
@@ -4393,9 +4386,8 @@ test_master_present (void *cls,
   int *found = cls;
 
   (void) exchange_url;
-  if (0 == memcmp (mpub,
-                  &master_pub,
-                  sizeof (master_pub)))
+  if (0 == GNUNET_memcmp (mpub,
+                          &master_pub))
     *found = GNUNET_YES;
 }
 
@@ -4423,9 +4415,8 @@ run (void *cls,
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Launching auditor\n");
   cfg = c;
-  if (0 == memcmp (&zeromp,
-                   &master_pub,
-                   sizeof (struct TALER_MasterPublicKeyP)))
+  if (0 == GNUNET_memcmp (&zeromp,
+                          &master_pub))
   {
     /* -m option not given, try configuration */
     char *master_public_key_str;
diff --git a/src/auditor/taler-wire-auditor.c b/src/auditor/taler-wire-auditor.c
index c903a494..7b96e34e 100644
--- a/src/auditor/taler-wire-auditor.c
+++ b/src/auditor/taler-wire-auditor.c
@@ -1244,9 +1244,8 @@ history_credit_cb (void *cls,
                        "diagnostic", "wire reference size missmatch"));
     return GNUNET_OK;
   }
-  if (0 != memcmp (&details->wtid,
-                  &rii->details.wtid,
-                  sizeof (struct TALER_WireTransferIdentifierRawP)))
+  if (0 != GNUNET_memcmp (&details->wtid,
+                          &rii->details.wtid))
   {
     report (report_reserve_in_inconsistencies,
             json_pack ("{s:I, s:o, s:o, s:o, s:s, s:s}",
@@ -1536,9 +1535,8 @@ run (void *cls,
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Launching auditor\n");
   cfg = c;
-  if (0 == memcmp (&zeromp,
-                   &master_pub,
-                   sizeof (struct TALER_MasterPublicKeyP)))
+  if (0 == GNUNET_memcmp (&zeromp,
+                          &master_pub))
   {
     /* -m option not given, try configuration */
     char *master_public_key_str;
diff --git a/src/lib/testing_api_cmd_track.c b/src/lib/testing_api_cmd_track.c
index 4898a097..6afb0ac6 100644
--- a/src/lib/testing_api_cmd_track.c
+++ b/src/lib/testing_api_cmd_track.c
@@ -613,9 +613,8 @@ track_transfer_cb
          TALER_JSON_merchant_wire_signature_hash (wire_details,
                                                   &h_wire_details));
 
-      if (0 != memcmp (&h_wire_details,
-                       h_wire,
-                       sizeof (struct GNUNET_HashCode)))
+      if (0 != GNUNET_memcmp (&h_wire_details,
+                              h_wire))
       {
         GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                     "Wire hash missmath to command %s\n",
diff --git a/src/util/test_crypto.c b/src/util/test_crypto.c
index 4713b3a3..bba9275a 100644
--- a/src/util/test_crypto.c
+++ b/src/util/test_crypto.c
@@ -60,16 +60,14 @@ test_high_level ()
                                      &coin_pub,
                                      &secret2);
   GNUNET_assert (0 ==
-                memcmp (&secret,
-                        &secret2,
-                        sizeof (secret)));
+                 GNUNET_memcmp (&secret,
+                                &secret2));
   TALER_link_recover_transfer_secret (&trans_pub,
                                       &coin_priv,
                                       &secret2);
   GNUNET_assert (0 ==
-                memcmp (&secret,
-                        &secret2,
-                        sizeof (secret)));
+                 GNUNET_memcmp (&secret,
+                                &secret2));
   TALER_planchet_setup_refresh (&secret,
                                 0,
                                 &fc1);
@@ -77,9 +75,8 @@ test_high_level ()
                                 1,
                                 &fc2);
   GNUNET_assert (0 !=
-                 memcmp (&fc1,
-                         &fc2,
-                         sizeof (struct TALER_PlanchetSecretsP)));
+                 GNUNET_memcmp (&fc1,
+                                &fc2));
   return 0;
 }
 
diff --git a/src/wire-plugins/test_wire_plugin_transactions_taler-bank.c 
b/src/wire-plugins/test_wire_plugin_transactions_taler-bank.c
index da1d43c1..4c2af52c 100644
--- a/src/wire-plugins/test_wire_plugin_transactions_taler-bank.c
+++ b/src/wire-plugins/test_wire_plugin_transactions_taler-bank.c
@@ -207,9 +207,8 @@ history_result_cb
     GNUNET_SCHEDULER_shutdown ();
     return GNUNET_SYSERR;
   }
-  if (0 != memcmp (&wtid,
-                   &details->wtid,
-                   sizeof (struct TALER_WireTransferIdentifierRawP)))
+  if (0 != GNUNET_memcmp (&wtid,
+                          &details->wtid))
   {
     GNUNET_break (0);
     global_ret = GNUNET_SYSERR;

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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