-more bool cleanup

This commit is contained in:
Christian Grothoff 2022-02-28 22:46:24 +01:00
parent 3d4e580699
commit a8d9e7e0a6
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
2 changed files with 13 additions and 14 deletions

View File

@ -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.tiny),
GNUNET_PQ_query_param_bool (td->details.deposits.done), GNUNET_PQ_query_param_bool (td->details.deposits.done),
GNUNET_PQ_query_param_bool (td->details.deposits.extension_blocked), 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), &td->details.deposits.extension_details_serial_id),
GNUNET_PQ_query_param_end GNUNET_PQ_query_param_end
}; };

View File

@ -458,7 +458,6 @@ lrbt_cb_table_auditors (void *cls,
for (unsigned int i = 0; i<num_results; i++) for (unsigned int i = 0; i<num_results; i++)
{ {
uint8_t is_active8 = 0;
struct GNUNET_PQ_ResultSpec rs[] = { struct GNUNET_PQ_ResultSpec rs[] = {
GNUNET_PQ_result_spec_uint64 ("serial", GNUNET_PQ_result_spec_uint64 ("serial",
&td.serial), &td.serial),
@ -468,8 +467,8 @@ lrbt_cb_table_auditors (void *cls,
&td.details.auditors.auditor_url), &td.details.auditors.auditor_url),
GNUNET_PQ_result_spec_string ("auditor_name", GNUNET_PQ_result_spec_string ("auditor_name",
&td.details.auditors.auditor_name), &td.details.auditors.auditor_name),
GNUNET_PQ_result_spec_auto_from_type ("is_active", GNUNET_PQ_result_spec_bool ("is_active",
&is_active8), &td.details.auditors.is_active),
GNUNET_PQ_result_spec_timestamp ("last_change", GNUNET_PQ_result_spec_timestamp ("last_change",
&td.details.auditors.last_change), &td.details.auditors.last_change),
GNUNET_PQ_result_spec_end GNUNET_PQ_result_spec_end
@ -484,7 +483,6 @@ lrbt_cb_table_auditors (void *cls,
ctx->error = true; ctx->error = true;
return; return;
} }
td.details.auditors.is_active = (0 != is_active8);
ctx->cb (ctx->cb_cls, ctx->cb (ctx->cb_cls,
&td); &td);
GNUNET_PQ_cleanup_result (rs); GNUNET_PQ_cleanup_result (rs);
@ -908,8 +906,7 @@ lrbt_cb_table_deposits (void *cls,
for (unsigned int i = 0; i<num_results; i++) for (unsigned int i = 0; i<num_results; i++)
{ {
uint8_t tiny = 0; /* initialized to make compiler happy */ bool no_extension;
uint8_t done = 0; /* initialized to make compiler happy */
struct GNUNET_PQ_ResultSpec rs[] = { struct GNUNET_PQ_ResultSpec rs[] = {
GNUNET_PQ_result_spec_uint64 ( GNUNET_PQ_result_spec_uint64 (
"serial", "serial",
@ -950,18 +947,20 @@ lrbt_cb_table_deposits (void *cls,
GNUNET_PQ_result_spec_uint64 ( GNUNET_PQ_result_spec_uint64 (
"wire_target_serial_id", "wire_target_serial_id",
&td.details.deposits.wire_target_serial_id), &td.details.deposits.wire_target_serial_id),
GNUNET_PQ_result_spec_auto_from_type ( GNUNET_PQ_result_spec_bool (
"tiny", "tiny",
&td.details.deposits.tiny), &td.details.deposits.tiny),
GNUNET_PQ_result_spec_auto_from_type ( GNUNET_PQ_result_spec_bool (
"done", "done",
&td.details.deposits.done), &td.details.deposits.done),
GNUNET_PQ_result_spec_auto_from_type ( GNUNET_PQ_result_spec_auto_from_type (
"extension_blocked", "extension_blocked",
&td.details.deposits.extension_blocked), &td.details.deposits.extension_blocked),
GNUNET_PQ_result_spec_allow_null (
GNUNET_PQ_result_spec_uint64 ( GNUNET_PQ_result_spec_uint64 (
"extension_details_serial_id", "extension_details_serial_id",
&td.details.deposits.extension_details_serial_id), &td.details.deposits.extension_details_serial_id),
&no_extension),
GNUNET_PQ_result_spec_end GNUNET_PQ_result_spec_end
}; };
@ -974,8 +973,6 @@ lrbt_cb_table_deposits (void *cls,
ctx->error = true; ctx->error = true;
return; return;
} }
td.details.deposits.tiny = (0 != tiny);
td.details.deposits.done = (0 != done);
ctx->cb (ctx->cb_cls, ctx->cb (ctx->cb_cls,
&td); &td);
GNUNET_PQ_cleanup_result (rs); GNUNET_PQ_cleanup_result (rs);