gnunet-svn
[Top][All Lists]
Advanced

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

[taler-merchant] branch master updated: -fix misc clang compiler warning


From: gnunet
Subject: [taler-merchant] branch master updated: -fix misc clang compiler warnings
Date: Mon, 22 Aug 2022 22:47:43 +0200

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

grothoff pushed a commit to branch master
in repository merchant.

The following commit(s) were added to refs/heads/master by this push:
     new b14e18eb -fix misc clang compiler warnings
b14e18eb is described below

commit b14e18eb31c957276c3f74834495d1bfa5c9329a
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Mon Aug 22 22:47:41 2022 +0200

    -fix misc clang compiler warnings
---
 src/backend/taler-merchant-httpd.c                 |   9 +-
 src/backend/taler-merchant-httpd_get-orders-ID.c   |   5 +
 src/backend/taler-merchant-httpd_get-tips-ID.c     |   1 +
 .../taler-merchant-httpd_post-orders-ID-pay.c      |   2 +-
 ...er-merchant-httpd_private-delete-instances-ID.c |   2 +
 ...taler-merchant-httpd_private-delete-orders-ID.c |   1 +
 ...ler-merchant-httpd_private-delete-products-ID.c |   1 +
 ...ler-merchant-httpd_private-delete-reserves-ID.c |   3 +-
 ...er-merchant-httpd_private-delete-transfers-ID.c |   1 +
 ...r-merchant-httpd_private-get-instances-ID-kyc.c | 109 ++++++++++++++-------
 .../taler-merchant-httpd_private-get-instances.c   |   3 +-
 .../taler-merchant-httpd_private-get-reserves-ID.c |   1 +
 .../taler-merchant-httpd_private-get-reserves.c    |   1 +
 .../taler-merchant-httpd_private-get-tips-ID.c     |   1 +
 .../taler-merchant-httpd_private-get-tips.c        |   1 +
 .../taler-merchant-httpd_private-get-transfers.c   |   1 +
 src/backend/taler-merchant-httpd_qr.c              |   6 +-
 17 files changed, 105 insertions(+), 43 deletions(-)

diff --git a/src/backend/taler-merchant-httpd.c 
b/src/backend/taler-merchant-httpd.c
index d95dafdc..d55d5a07 100644
--- a/src/backend/taler-merchant-httpd.c
+++ b/src/backend/taler-merchant-httpd.c
@@ -333,6 +333,7 @@ handle_mhd_completion_callback (void *cls,
 {
   struct TMH_HandlerContext *hc = *con_cls;
 
+  (void) cls;
   if (NULL == hc)
     return;
   GNUNET_SCHEDULER_begin_async_scope (&hc->async_scope_id);
@@ -440,6 +441,8 @@ handle_server_options (const struct TMH_RequestHandler *rh,
                        struct MHD_Connection *connection,
                        struct TMH_HandlerContext *hc)
 {
+  (void) rh;
+  (void) hc;
   return TALER_MHD_reply_cors_preflight (connection);
 }
 
@@ -664,7 +667,7 @@ url_handler (void *cls,
       .handler = &TMH_private_get_instances_default_ID_kyc,
     },
     {
-      NULL
+      .url_prefix = NULL
     }
   };
 
@@ -918,7 +921,7 @@ url_handler (void *cls,
       .handler = &TMH_private_get_transfers
     },
     {
-      NULL
+      .url_prefix = NULL
     }
   };
   static struct TMH_RequestHandler public_handlers[] = {
@@ -1049,7 +1052,7 @@ url_handler (void *cls,
       .handler = &handle_server_options
     },
     {
-      NULL
+      .url_prefix = NULL
     }
   };
   struct TMH_HandlerContext *hc = *con_cls;
diff --git a/src/backend/taler-merchant-httpd_get-orders-ID.c 
b/src/backend/taler-merchant-httpd_get-orders-ID.c
index 5d229fc2..c1db5ea9 100644
--- a/src/backend/taler-merchant-httpd_get-orders-ID.c
+++ b/src/backend/taler-merchant-httpd_get-orders-ID.c
@@ -758,6 +758,10 @@ process_refunds_cb (void *cls,
 {
   struct GetOrderData *god = cls;
 
+  (void) refund_serial;
+  (void) timestamp;
+  (void) exchange_url;
+  (void) rtransaction_id;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Found refund of %s for coin %s with reason `%s' in database\n",
               TALER_amount2s (refund_amount),
@@ -823,6 +827,7 @@ TMH_get_orders_ID (const struct TMH_RequestHandler *rh,
   bool contract_available = false;
   const char *merchant_base_url;
 
+  (void) rh;
   if (NULL == god)
   {
     god = GNUNET_new (struct GetOrderData);
diff --git a/src/backend/taler-merchant-httpd_get-tips-ID.c 
b/src/backend/taler-merchant-httpd_get-tips-ID.c
index 0486de3e..b20de7e1 100644
--- a/src/backend/taler-merchant-httpd_get-tips-ID.c
+++ b/src/backend/taler-merchant-httpd_get-tips-ID.c
@@ -164,6 +164,7 @@ TMH_get_tips_ID (const struct TMH_RequestHandler *rh,
   char *exchange_url;
   struct TALER_ReservePrivateKeyP reserve_priv;
 
+  (void) rh;
   if (GNUNET_OK !=
       GNUNET_CRYPTO_hash_from_string (hc->infix,
                                       &tip_id.hash))
diff --git a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c 
b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
index d0e4752f..8be93a01 100644
--- a/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
+++ b/src/backend/taler-merchant-httpd_post-orders-ID-pay.c
@@ -1312,7 +1312,7 @@ process_pay_with_exchange (
         goto AGE_FAIL;
       }
       dc->age_commitment.mask = denom_details->key.age_mask;
-      if ((dc->age_commitment.num + 1) !=
+      if (((int) (dc->age_commitment.num + 1)) !=
           __builtin_popcount (dc->age_commitment.mask.bits))
       {
         GNUNET_break_op (0);
diff --git a/src/backend/taler-merchant-httpd_private-delete-instances-ID.c 
b/src/backend/taler-merchant-httpd_private-delete-instances-ID.c
index 9926d0b3..2791d6d7 100644
--- a/src/backend/taler-merchant-httpd_private-delete-instances-ID.c
+++ b/src/backend/taler-merchant-httpd_private-delete-instances-ID.c
@@ -92,6 +92,7 @@ TMH_private_delete_instances_ID (const struct 
TMH_RequestHandler *rh,
 {
   struct TMH_MerchantInstance *mi = hc->instance;
 
+  (void) rh;
   return delete_instances_ID (mi,
                               connection);
 }
@@ -104,6 +105,7 @@ TMH_private_delete_instances_default_ID (const struct 
TMH_RequestHandler *rh,
 {
   struct TMH_MerchantInstance *mi;
 
+  (void) rh;
   mi = TMH_lookup_instance (hc->infix);
   if (NULL == mi)
   {
diff --git a/src/backend/taler-merchant-httpd_private-delete-orders-ID.c 
b/src/backend/taler-merchant-httpd_private-delete-orders-ID.c
index 9d0b4fb4..dfdb486e 100644
--- a/src/backend/taler-merchant-httpd_private-delete-orders-ID.c
+++ b/src/backend/taler-merchant-httpd_private-delete-orders-ID.c
@@ -41,6 +41,7 @@ TMH_private_delete_orders_ID (const struct TMH_RequestHandler 
*rh,
   const char *force_s;
   bool force;
 
+  (void) rh;
   force_s = MHD_lookup_connection_value (connection,
                                          MHD_GET_ARGUMENT_KIND,
                                          "force");
diff --git a/src/backend/taler-merchant-httpd_private-delete-products-ID.c 
b/src/backend/taler-merchant-httpd_private-delete-products-ID.c
index bb7964aa..7d314785 100644
--- a/src/backend/taler-merchant-httpd_private-delete-products-ID.c
+++ b/src/backend/taler-merchant-httpd_private-delete-products-ID.c
@@ -39,6 +39,7 @@ TMH_private_delete_products_ID (const struct 
TMH_RequestHandler *rh,
   struct TMH_MerchantInstance *mi = hc->instance;
   enum GNUNET_DB_QueryStatus qs;
 
+  (void) rh;
   GNUNET_assert (NULL != mi);
   GNUNET_assert (NULL != hc->infix);
   qs = TMH_db->delete_product (TMH_db->cls,
diff --git a/src/backend/taler-merchant-httpd_private-delete-reserves-ID.c 
b/src/backend/taler-merchant-httpd_private-delete-reserves-ID.c
index c391ed0e..bbfba877 100644
--- a/src/backend/taler-merchant-httpd_private-delete-reserves-ID.c
+++ b/src/backend/taler-merchant-httpd_private-delete-reserves-ID.c
@@ -41,6 +41,7 @@ TMH_private_delete_reserves_ID (const struct 
TMH_RequestHandler *rh,
   struct TALER_ReservePublicKeyP reserve_pub;
   const char *purge;
 
+  (void) rh;
   if (GNUNET_OK !=
       GNUNET_STRINGS_string_to_data (hc->infix,
                                      strlen (hc->infix),
@@ -59,7 +60,7 @@ TMH_private_delete_reserves_ID (const struct 
TMH_RequestHandler *rh,
   GNUNET_assert (NULL != mi);
   if ( (NULL != purge) &&
        (0 == strcasecmp (purge,
-                     "yes")) )
+                         "yes")) )
     qs = TMH_db->purge_reserve (TMH_db->cls,
                                 mi->settings.id,
                                 &reserve_pub);
diff --git a/src/backend/taler-merchant-httpd_private-delete-transfers-ID.c 
b/src/backend/taler-merchant-httpd_private-delete-transfers-ID.c
index 1e191eb6..9b4412ba 100644
--- a/src/backend/taler-merchant-httpd_private-delete-transfers-ID.c
+++ b/src/backend/taler-merchant-httpd_private-delete-transfers-ID.c
@@ -33,6 +33,7 @@ TMH_private_delete_transfers_ID (const struct 
TMH_RequestHandler *rh,
   unsigned long long serial;
   char dummy;
 
+  (void) rh;
   GNUNET_assert (NULL != mi);
   if (1 !=
       sscanf (hc->infix,
diff --git a/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c 
b/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c
index 0709679b..10c76013 100644
--- a/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c
+++ b/src/backend/taler-merchant-httpd_private-get-instances-ID-kyc.c
@@ -432,6 +432,54 @@ handle_kyc_timeout (void *cls)
 }
 
 
+/**
+ * We are done with the KYC request @a ekr.
+ * Remove it from the work list and check if
+ * we are done overall.
+ *
+ * @param[in] ekr key request that is done (and will be freed)
+ */
+static void
+ekr_finished (struct ExchangeKycRequest *ekr)
+{
+  struct KycContext *kc = ekr->kc;
+
+  GNUNET_CONTAINER_DLL_remove (kc->exchange_pending_head,
+                               kc->exchange_pending_tail,
+                               ekr);
+  GNUNET_free (ekr->exchange_url);
+  GNUNET_free (ekr->payto_uri);
+  GNUNET_free (ekr);
+  if (NULL != kc->exchange_pending_head)
+    return; /* wait for more */
+  /* All exchange requests done, create final
+     big response from cummulated replies */
+  if ( (0 == json_array_size (kc->pending_kycs)) &&
+       (0 == json_array_size (kc->timeout_kycs)) )
+  {
+    /* special case: all KYC operations did succeed
+       after we asked at the exchanges => 204 */
+    struct MHD_Response *response;
+
+    response = MHD_create_response_from_buffer (0,
+                                                "",
+                                                MHD_RESPMEM_PERSISTENT);
+    resume_kyc_with_response (kc,
+                              MHD_HTTP_NO_CONTENT,
+                              response);
+    return;
+  }
+  resume_kyc_with_response (
+    kc,
+    kc->response_code, /* MHD_HTTP_OK or MHD_HTTP_BAD_GATEWAY */
+    TALER_MHD_MAKE_JSON_PACK (
+      GNUNET_JSON_pack_array_incref ("pending_kycs",
+                                     kc->pending_kycs),
+      GNUNET_JSON_pack_array_incref ("timeout_kycs",
+                                     kc->timeout_kycs)));
+}
+
+
 /**
  * Function called with the result of a KYC check.
  *
@@ -520,41 +568,8 @@ exchange_check_cb (void *cls,
                                    ks->ec),
           GNUNET_JSON_pack_uint64 ("exchange_http_status",
                                    ks->http_status))));
-    break;
-  }
-  GNUNET_CONTAINER_DLL_remove (kc->exchange_pending_head,
-                               kc->exchange_pending_tail,
-                               ekr);
-  GNUNET_free (ekr->exchange_url);
-  GNUNET_free (ekr->payto_uri);
-  GNUNET_free (ekr);
-  if (NULL != kc->exchange_pending_head)
-    return; /* wait for more */
-  /* All exchange requests done, create final
-     big response from cummulated replies */
-  if ( (0 == json_array_size (kc->pending_kycs)) &&
-       (0 == json_array_size (kc->timeout_kycs)) )
-  {
-    /* special case: all KYC operations did succeed
-       after we asked at the exchanges => 204 */
-    struct MHD_Response *response;
-
-    response = MHD_create_response_from_buffer (0,
-                                                "",
-                                                MHD_RESPMEM_PERSISTENT);
-    resume_kyc_with_response (kc,
-                              MHD_HTTP_NO_CONTENT,
-                              response);
-    return;
   }
-  resume_kyc_with_response (
-    kc,
-    kc->response_code, /* MHD_HTTP_OK or MHD_HTTP_BAD_GATEWAY */
-    TALER_MHD_MAKE_JSON_PACK (
-      GNUNET_JSON_pack_array_incref ("pending_kycs",
-                                     kc->pending_kycs),
-      GNUNET_JSON_pack_array_incref ("timeout_kycs",
-                                     kc->timeout_kycs)));
+  ekr_finished (ekr);
 }
 
 
@@ -581,7 +596,31 @@ kyc_with_exchange (void *cls,
   struct KycContext *kc = ekr->kc;
   struct TALER_PaytoHashP h_payto;
 
+  (void) payto_uri;
+  (void) wire_fee;
+  (void) exchange_trusted;
   ekr->fo = NULL;
+  if (MHD_HTTP_OK != hr->http_status)
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+                "Exchange responded with HTTP status %u (%d) to /kyc-check 
request!\n",
+                hr->http_status,
+                hr->ec);
+    kc->response_code = MHD_HTTP_BAD_GATEWAY;
+    GNUNET_assert (
+      0 ==
+      json_array_append_new (
+        kc->timeout_kycs,
+        GNUNET_JSON_PACK (
+          GNUNET_JSON_pack_string ("exchange_url",
+                                   ekr->exchange_url),
+          GNUNET_JSON_pack_uint64 ("exchange_code",
+                                   hr->ec),
+          GNUNET_JSON_pack_uint64 ("exchange_http_status",
+                                   hr->http_status))));
+    ekr_finished (ekr);
+    return;
+  }
   TALER_payto_hash (ekr->payto_uri,
                     &h_payto);
   ekr->kyc = TALER_EXCHANGE_kyc_check (
@@ -832,6 +871,7 @@ TMH_private_get_instances_ID_kyc (const struct 
TMH_RequestHandler *rh,
 {
   struct TMH_MerchantInstance *mi = hc->instance;
 
+  (void) rh;
   return get_instances_ID_kyc (mi,
                                connection,
                                hc);
@@ -845,6 +885,7 @@ TMH_private_get_instances_default_ID_kyc (const struct 
TMH_RequestHandler *rh,
 {
   struct TMH_MerchantInstance *mi;
 
+  (void) rh;
   mi = TMH_lookup_instance (hc->infix);
   if (NULL == mi)
   {
diff --git a/src/backend/taler-merchant-httpd_private-get-instances.c 
b/src/backend/taler-merchant-httpd_private-get-instances.c
index 3eedcd83..dc0f566f 100644
--- a/src/backend/taler-merchant-httpd_private-get-instances.c
+++ b/src/backend/taler-merchant-httpd_private-get-instances.c
@@ -29,7 +29,7 @@
  * @param value a `struct TMH_MerchantInstance *`
  * @return #GNUNET_OK (continue to iterate)
  */
-static int
+static enum GNUNET_GenericReturnValue
 add_instance (void *cls,
               const struct GNUNET_HashCode *key,
               void *value)
@@ -107,6 +107,7 @@ TMH_private_get_instances (const struct TMH_RequestHandler 
*rh,
 {
   json_t *ia;
 
+  (void) rh;
   (void) hc;
   ia = json_array ();
   GNUNET_assert (NULL != ia);
diff --git a/src/backend/taler-merchant-httpd_private-get-reserves-ID.c 
b/src/backend/taler-merchant-httpd_private-get-reserves-ID.c
index 5b1481a7..5545b02f 100644
--- a/src/backend/taler-merchant-httpd_private-get-reserves-ID.c
+++ b/src/backend/taler-merchant-httpd_private-get-reserves-ID.c
@@ -152,6 +152,7 @@ TMH_private_get_reserves_ID (const struct 
TMH_RequestHandler *rh,
   struct TALER_ReservePublicKeyP reserve_pub;
   bool tips;
 
+  (void) rh;
   if (GNUNET_OK !=
       GNUNET_STRINGS_string_to_data (hc->infix,
                                      strlen (hc->infix),
diff --git a/src/backend/taler-merchant-httpd_private-get-reserves.c 
b/src/backend/taler-merchant-httpd_private-get-reserves.c
index be0925d3..6621ffb4 100644
--- a/src/backend/taler-merchant-httpd_private-get-reserves.c
+++ b/src/backend/taler-merchant-httpd_private-get-reserves.c
@@ -94,6 +94,7 @@ TMH_private_get_reserves (const struct TMH_RequestHandler *rh,
   enum TALER_EXCHANGE_YesNoAll active;
   enum TALER_EXCHANGE_YesNoAll failures;
 
+  (void) rh;
   if (! (TALER_arg_to_yna (connection,
                            "active",
                            TALER_EXCHANGE_YNA_ALL,
diff --git a/src/backend/taler-merchant-httpd_private-get-tips-ID.c 
b/src/backend/taler-merchant-httpd_private-get-tips-ID.c
index 51089928..17002168 100644
--- a/src/backend/taler-merchant-httpd_private-get-tips-ID.c
+++ b/src/backend/taler-merchant-httpd_private-get-tips-ID.c
@@ -45,6 +45,7 @@ TMH_private_get_tips_ID (const struct TMH_RequestHandler *rh,
   bool fpu;
   json_t *pickups_json = NULL;
 
+  (void) rh;
   GNUNET_assert (NULL != hc->infix);
   // FIXME: support long-polling (client-side already implemented)
   if (GNUNET_OK !=
diff --git a/src/backend/taler-merchant-httpd_private-get-tips.c 
b/src/backend/taler-merchant-httpd_private-get-tips.c
index 4f358be2..91a05366 100644
--- a/src/backend/taler-merchant-httpd_private-get-tips.c
+++ b/src/backend/taler-merchant-httpd_private-get-tips.c
@@ -62,6 +62,7 @@ TMH_private_get_tips (const struct TMH_RequestHandler *rh,
   uint64_t offset;
   int64_t limit;
 
+  (void) rh;
   if (! (TALER_arg_to_yna (connection,
                            "expired",
                            TALER_EXCHANGE_YNA_NO,
diff --git a/src/backend/taler-merchant-httpd_private-get-transfers.c 
b/src/backend/taler-merchant-httpd_private-get-transfers.c
index 03a7beaa..c43781dd 100644
--- a/src/backend/taler-merchant-httpd_private-get-transfers.c
+++ b/src/backend/taler-merchant-httpd_private-get-transfers.c
@@ -103,6 +103,7 @@ TMH_private_get_transfers (const struct TMH_RequestHandler 
*rh,
   uint64_t offset;
   enum TALER_EXCHANGE_YesNoAll verified;
 
+  (void) rh;
   payto_uri = MHD_lookup_connection_value (connection,
                                            MHD_GET_ARGUMENT_KIND,
                                            "payto_uri");
diff --git a/src/backend/taler-merchant-httpd_qr.c 
b/src/backend/taler-merchant-httpd_qr.c
index 4539beed..59e80bf2 100644
--- a/src/backend/taler-merchant-httpd_qr.c
+++ b/src/backend/taler-merchant-httpd_qr.c
@@ -78,11 +78,11 @@ TMH_create_qrcode (const char *uri)
                             "style='shape-rendering: crispedges;'>\n",
                             qrc->width,
                             qrc->width);
-  for (unsigned int y = 0; y<qrc->width; y++)
+  for (unsigned int y = 0; y<(unsigned int) qrc->width; y++)
   {
-    for (unsigned int x = 0; x<qrc->width; x++)
+    for (unsigned int x = 0; x<(unsigned int) qrc->width; x++)
     {
-      unsigned int off = x + y * qrc->width;
+      unsigned int off = x + y * (unsigned int) qrc->width;
       if (0 == (qrc->data[off] & 1))
         continue;
       GNUNET_buffer_write_fstr (&buf,

-- 
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]