summaryrefslogtreecommitdiff
path: root/src/bank-lib
diff options
context:
space:
mode:
authorMarcello Stanisci <stanisci.m@gmail.com>2018-10-22 16:59:09 +0200
committerMarcello Stanisci <stanisci.m@gmail.com>2018-10-22 16:59:09 +0200
commit60c533562cdac20a7343daef654144f161f348eb (patch)
treec546a31d8a4348e48b573c2fc94ecd702f862b9b /src/bank-lib
parente83964badb5c266992f5b1312b31aa6a14d392e5 (diff)
downloadexchange-60c533562cdac20a7343daef654144f161f348eb.tar.gz
exchange-60c533562cdac20a7343daef654144f161f348eb.tar.bz2
exchange-60c533562cdac20a7343daef654144f161f348eb.zip
Fix compiler warnings.
This reverts changes made in b0d00823eb96de733510354. The warnings are fixed by changing the functions signatures, instead of casting their pointers.
Diffstat (limited to 'src/bank-lib')
-rw-r--r--src/bank-lib/bank_api_admin.c23
-rw-r--r--src/bank-lib/bank_api_history.c23
-rw-r--r--src/bank-lib/bank_api_reject.c19
3 files changed, 34 insertions, 31 deletions
diff --git a/src/bank-lib/bank_api_admin.c b/src/bank-lib/bank_api_admin.c
index a18b95c3f..3a1ec4efa 100644
--- a/src/bank-lib/bank_api_admin.c
+++ b/src/bank-lib/bank_api_admin.c
@@ -70,16 +70,17 @@ struct TALER_BANK_AdminAddIncomingHandle
*
* @param cls the `struct TALER_BANK_AdminAddIncomingHandle`
* @param response_code HTTP response code, 0 on error
- * @param json parsed JSON result, NULL on error
+ * @param response parsed JSON result, NULL on error
*/
static void
handle_admin_add_incoming_finished (void *cls,
long response_code,
- const json_t *json)
+ const void *response)
{
struct TALER_BANK_AdminAddIncomingHandle *aai = cls;
uint64_t row_id = UINT64_MAX;
enum TALER_ErrorCode ec;
+ const json_t *j = response;
aai->job = NULL;
switch (response_code)
@@ -96,7 +97,7 @@ handle_admin_add_incoming_finished (void *cls,
};
if (GNUNET_OK !=
- GNUNET_JSON_parse (json,
+ GNUNET_JSON_parse (j,
spec,
NULL, NULL))
{
@@ -111,27 +112,27 @@ handle_admin_add_incoming_finished (void *cls,
case MHD_HTTP_BAD_REQUEST:
/* This should never happen, either us or the bank is buggy
(or API version conflict); just pass JSON reply to the application */
- ec = TALER_BANK_parse_ec_ (json);
+ ec = TALER_BANK_parse_ec_ (j);
break;
case MHD_HTTP_FORBIDDEN:
/* Access denied */
- ec = TALER_BANK_parse_ec_ (json);
+ ec = TALER_BANK_parse_ec_ (j);
break;
case MHD_HTTP_UNAUTHORIZED:
/* Nothing really to verify, bank says one of the signatures is
invalid; as we checked them, this should never happen, we
should pass the JSON reply to the application */
- ec = TALER_BANK_parse_ec_ (json);
+ ec = TALER_BANK_parse_ec_ (j);
break;
case MHD_HTTP_NOT_FOUND:
/* Nothing really to verify, this should never
happen, we should pass the JSON reply to the application */
- ec = TALER_BANK_parse_ec_ (json);
+ ec = TALER_BANK_parse_ec_ (j);
break;
case MHD_HTTP_INTERNAL_SERVER_ERROR:
/* Server had an internal issue; we should retry, but this API
leaves this to the application */
- ec = TALER_BANK_parse_ec_ (json);
+ ec = TALER_BANK_parse_ec_ (j);
break;
default:
/* unexpected response code */
@@ -139,7 +140,7 @@ handle_admin_add_incoming_finished (void *cls,
"Unexpected response code %u\n",
(unsigned int) response_code);
GNUNET_break (0);
- ec = TALER_BANK_parse_ec_ (json);
+ ec = TALER_BANK_parse_ec_ (j);
response_code = 0;
break;
}
@@ -147,7 +148,7 @@ handle_admin_add_incoming_finished (void *cls,
response_code,
ec,
row_id,
- json);
+ j);
TALER_BANK_admin_add_incoming_cancel (aai);
}
@@ -247,7 +248,7 @@ TALER_BANK_admin_add_incoming (struct GNUNET_CURL_Context *ctx,
aai->job = GNUNET_CURL_job_add (ctx,
eh,
GNUNET_NO,
- (GC_JCC) &handle_admin_add_incoming_finished,
+ &handle_admin_add_incoming_finished,
aai);
return aai;
}
diff --git a/src/bank-lib/bank_api_history.c b/src/bank-lib/bank_api_history.c
index 46be1085a..844f9b0cd 100644
--- a/src/bank-lib/bank_api_history.c
+++ b/src/bank-lib/bank_api_history.c
@@ -169,15 +169,16 @@ parse_account_history (struct TALER_BANK_HistoryHandle *hh,
*
* @param cls the `struct TALER_BANK_HistoryHandle`
* @param response_code HTTP response code, 0 on error
- * @param json parsed JSON result, NULL on error
+ * @param response parsed JSON result, NULL on error
*/
static void
handle_history_finished (void *cls,
long response_code,
- const json_t *json)
+ const void *response)
{
struct TALER_BANK_HistoryHandle *hh = cls;
enum TALER_ErrorCode ec;
+ const json_t *j = response;
hh->job = NULL;
switch (response_code)
@@ -188,7 +189,7 @@ handle_history_finished (void *cls,
case MHD_HTTP_OK:
if (GNUNET_OK !=
parse_account_history (hh,
- json))
+ j))
{
GNUNET_break_op (0);
response_code = 0;
@@ -204,27 +205,27 @@ handle_history_finished (void *cls,
case MHD_HTTP_BAD_REQUEST:
/* This should never happen, either us or the bank is buggy
(or API version conflict); just pass JSON reply to the application */
- ec = TALER_BANK_parse_ec_ (json);
+ ec = TALER_BANK_parse_ec_ (j);
break;
case MHD_HTTP_FORBIDDEN:
/* Access denied */
- ec = TALER_BANK_parse_ec_ (json);
+ ec = TALER_BANK_parse_ec_ (j);
break;
case MHD_HTTP_UNAUTHORIZED:
/* Nothing really to verify, bank says one of the signatures is
invalid; as we checked them, this should never happen, we
should pass the JSON reply to the application */
- ec = TALER_BANK_parse_ec_ (json);
+ ec = TALER_BANK_parse_ec_ (j);
break;
case MHD_HTTP_NOT_FOUND:
/* Nothing really to verify, this should never
happen, we should pass the JSON reply to the application */
- ec = TALER_BANK_parse_ec_ (json);
+ ec = TALER_BANK_parse_ec_ (j);
break;
case MHD_HTTP_INTERNAL_SERVER_ERROR:
/* Server had an internal issue; we should retry, but this API
leaves this to the application */
- ec = TALER_BANK_parse_ec_ (json);
+ ec = TALER_BANK_parse_ec_ (j);
break;
default:
/* unexpected response code */
@@ -232,7 +233,7 @@ handle_history_finished (void *cls,
"Unexpected response code %u\n",
(unsigned int) response_code);
GNUNET_break (0);
- ec = TALER_BANK_parse_ec_ (json);
+ ec = TALER_BANK_parse_ec_ (j);
response_code = 0;
break;
}
@@ -242,7 +243,7 @@ handle_history_finished (void *cls,
TALER_BANK_DIRECTION_NONE,
0LLU,
NULL,
- json);
+ j);
TALER_BANK_history_cancel (hh);
}
@@ -350,7 +351,7 @@ TALER_BANK_history (struct GNUNET_CURL_Context *ctx,
hh->job = GNUNET_CURL_job_add (ctx,
eh,
GNUNET_NO,
- (GC_JCC) &handle_history_finished,
+ &handle_history_finished,
hh);
return hh;
}
diff --git a/src/bank-lib/bank_api_reject.c b/src/bank-lib/bank_api_reject.c
index 00a49bd16..5e7a1ac29 100644
--- a/src/bank-lib/bank_api_reject.c
+++ b/src/bank-lib/bank_api_reject.c
@@ -70,15 +70,16 @@ struct TALER_BANK_RejectHandle
*
* @param cls the `struct TALER_BANK_RejectHandle`
* @param response_code HTTP response code, 0 on error
- * @param json parsed JSON result, NULL on error
+ * @param response parsed JSON result, NULL on error
*/
static void
handle_reject_finished (void *cls,
long response_code,
- const json_t *json)
+ const void *response)
{
struct TALER_BANK_RejectHandle *rh = cls;
enum TALER_ErrorCode ec;
+ const json_t *j = response;
rh->job = NULL;
switch (response_code)
@@ -97,27 +98,27 @@ handle_reject_finished (void *cls,
case MHD_HTTP_BAD_REQUEST:
/* This should never happen, either us or the bank is buggy
(or API version conflict); just pass JSON reply to the application */
- ec = TALER_BANK_parse_ec_ (json);
+ ec = TALER_BANK_parse_ec_ (j);
break;
case MHD_HTTP_FORBIDDEN:
/* Access denied */
- ec = TALER_BANK_parse_ec_ (json);
+ ec = TALER_BANK_parse_ec_ (j);
break;
case MHD_HTTP_UNAUTHORIZED:
/* Nothing really to verify, bank says one of the signatures is
invalid; as we checked them, this should never happen, we
should pass the JSON reply to the application */
- ec = TALER_BANK_parse_ec_ (json);
+ ec = TALER_BANK_parse_ec_ (j);
break;
case MHD_HTTP_NOT_FOUND:
/* Nothing really to verify, this should never
happen, we should pass the JSON reply to the application */
- ec = TALER_BANK_parse_ec_ (json);
+ ec = TALER_BANK_parse_ec_ (j);
break;
case MHD_HTTP_INTERNAL_SERVER_ERROR:
/* Server had an internal issue; we should retry, but this API
leaves this to the application */
- ec = TALER_BANK_parse_ec_ (json);
+ ec = TALER_BANK_parse_ec_ (j);
break;
default:
/* unexpected response code */
@@ -125,7 +126,7 @@ handle_reject_finished (void *cls,
"Unexpected response code %u\n",
(unsigned int) response_code);
GNUNET_break (0);
- ec = TALER_BANK_parse_ec_ (json);
+ ec = TALER_BANK_parse_ec_ (j);
response_code = 0;
break;
}
@@ -215,7 +216,7 @@ TALER_BANK_reject (struct GNUNET_CURL_Context *ctx,
rh->job = GNUNET_CURL_job_add (ctx,
eh,
GNUNET_NO,
- (GC_JCC) &handle_reject_finished,
+ &handle_reject_finished,
rh);
return rh;
}