Skip to content

Commit c4d0447

Browse files
Lagrang3ShahanaFarooqui
authored andcommitted
renepay: remove __PRETTY_FUNCTION__
Remove __PRETTY_FUNCTION__ in favor of __func__ Signed-off-by: Lagrang3 <[email protected]>
1 parent cc9b8b0 commit c4d0447

File tree

7 files changed

+32
-32
lines changed

7 files changed

+32
-32
lines changed

plugins/renepay/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ static const char *init(struct plugin *p,
8989
plugin_log(pay_plugin->plugin, LOG_UNUSUAL,
9090
"%s: uncertainty was updated but %d channels have "
9191
"been ignored.",
92-
__PRETTY_FUNCTION__, skipped_count);
92+
__func__, skipped_count);
9393

9494
plugin_set_memleak_handler(p, memleak_mark);
9595
return NULL;

plugins/renepay/mcf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,7 +1193,7 @@ static u32 find_positive_balance(
11931193
* algorithm does not come up with spurious flow cycles. */
11941194
while(balance[final_idx]<=0)
11951195
{
1196-
// printf("%s: node = %d\n",__PRETTY_FUNCTION__,final_idx);
1196+
// printf("%s: node = %d\n",__func__,final_idx);
11971197
u32 updated_idx=INVALID_INDEX;
11981198
struct gossmap_node *cur
11991199
= gossmap_node_byidx(gossmap,final_idx);

plugins/renepay/mods.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,13 @@ static bool success_data_from_listsendpays(const char *buf,
129129
plugin_err(
130130
pay_plugin->plugin,
131131
"%s (line %d) missing status token from json.",
132-
__PRETTY_FUNCTION__, __LINE__);
132+
__func__, __LINE__);
133133
const char *status = json_strdup(tmpctx, buf, status_tok);
134134
if (!status)
135135
plugin_err(
136136
pay_plugin->plugin,
137137
"%s (line %d) failed to allocate status string.",
138-
__PRETTY_FUNCTION__, __LINE__);
138+
__func__, __LINE__);
139139

140140
if (streq(status, "complete")) {
141141
/* FIXME we assume amount_msat is always present, but
@@ -160,7 +160,7 @@ static bool success_data_from_listsendpays(const char *buf,
160160
"%s (line %d) json_scan of "
161161
"listsendpay returns the "
162162
"following error: %s",
163-
__PRETTY_FUNCTION__, __LINE__, err);
163+
__func__, __LINE__, err);
164164
success->groupid = groupid;
165165
/* Now we know the payment completed. */
166166
if (!amount_msat_add(&success->deliver_msat,
@@ -170,7 +170,7 @@ static bool success_data_from_listsendpays(const char *buf,
170170
success->sent_msat, this_sent))
171171
plugin_err(pay_plugin->plugin,
172172
"%s (line %d) amount_msat overflow.",
173-
__PRETTY_FUNCTION__, __LINE__);
173+
__func__, __LINE__);
174174

175175
success->parts++;
176176
}
@@ -482,7 +482,7 @@ static struct command_result *refreshgossmap_cb(struct payment *payment)
482482
pay_plugin->plugin, LOG_UNUSUAL,
483483
"%s: uncertainty was updated but %d channels have "
484484
"been ignored.",
485-
__PRETTY_FUNCTION__, skipped_count);
485+
__func__, skipped_count);
486486
}
487487
return payment_continue(payment);
488488
}
@@ -597,7 +597,7 @@ static struct command_result *routehints_done(struct command *cmd UNUSED,
597597
plugin_log(pay_plugin->plugin, LOG_UNUSUAL,
598598
"%s: uncertainty was updated but %d channels have "
599599
"been ignored.",
600-
__PRETTY_FUNCTION__, skipped_count);
600+
__func__, skipped_count);
601601

602602
return payment_continue(payment);
603603
}
@@ -631,22 +631,22 @@ static struct command_result *compute_routes_cb(struct payment *payment)
631631
tal_count(routetracker->computed_routes))
632632
plugin_err(pay_plugin->plugin,
633633
"%s: no previously computed routes expected.",
634-
__PRETTY_FUNCTION__);
634+
__func__);
635635

636636
struct amount_msat feebudget, fees_spent, remaining;
637637

638638
/* Total feebudget */
639639
if (!amount_msat_sub(&feebudget, payment->payment_info.maxspend,
640640
payment->payment_info.amount))
641641
plugin_err(pay_plugin->plugin, "%s: fee budget is negative?",
642-
__PRETTY_FUNCTION__);
642+
__func__);
643643

644644
/* Fees spent so far */
645645
if (!amount_msat_sub(&fees_spent, payment->total_sent,
646646
payment->total_delivering))
647647
plugin_err(pay_plugin->plugin,
648648
"%s: total_delivering is greater than total_sent?",
649-
__PRETTY_FUNCTION__);
649+
__func__);
650650

651651
/* Remaining fee budget. */
652652
if (!amount_msat_sub(&feebudget, feebudget, fees_spent))
@@ -658,7 +658,7 @@ static struct command_result *compute_routes_cb(struct payment *payment)
658658
plugin_log(pay_plugin->plugin, LOG_UNUSUAL,
659659
"%s: Payment is pending with full amount already "
660660
"committed. We skip the computation of new routes.",
661-
__PRETTY_FUNCTION__);
661+
__func__);
662662
return payment_continue(payment);
663663
}
664664

@@ -724,7 +724,7 @@ static struct command_result *send_routes_cb(struct payment *payment)
724724
tal_count(routetracker->computed_routes) == 0) {
725725
plugin_log(pay_plugin->plugin, LOG_UNUSUAL,
726726
"%s: there are no routes to send, skipping.",
727-
__PRETTY_FUNCTION__);
727+
__func__);
728728
return payment_continue(payment);
729729
}
730730
struct command *cmd = payment_command(payment);
@@ -806,7 +806,7 @@ static struct command_result *collect_results_cb(struct payment *payment)
806806
"%s: received a success sendpay for this "
807807
"payment but the total delivering amount %s "
808808
"is less than the payment amount %s.",
809-
__PRETTY_FUNCTION__,
809+
__func__,
810810
fmt_amount_msat(tmpctx, payment->total_delivering),
811811
fmt_amount_msat(tmpctx,
812812
payment->payment_info.amount));
@@ -930,7 +930,7 @@ static struct command_result *pendingsendpays_done(struct command *cmd,
930930
payment_note(payment, LOG_DBG,
931931
"%s: Payment completed before computing the next "
932932
"round of routes.",
933-
__PRETTY_FUNCTION__);
933+
__func__);
934934
return payment_success(payment, &success.preimage);
935935
}
936936

@@ -950,7 +950,7 @@ static struct command_result *pendingsendpays_done(struct command *cmd,
950950
plugin_err(pay_plugin->plugin,
951951
"%s json_scan of listsendpay returns the "
952952
"following error: %s",
953-
__PRETTY_FUNCTION__, err);
953+
__func__, err);
954954

955955
if (streq(status, "pending")) {
956956
pending_group_id = groupid;
@@ -985,7 +985,7 @@ static struct command_result *pendingsendpays_done(struct command *cmd,
985985
plugin_err(pay_plugin->plugin,
986986
"%s json_scan of listsendpay returns the "
987987
"following error: %s",
988-
__PRETTY_FUNCTION__, err);
988+
__func__, err);
989989

990990
/* If we decide to create a new group, we base it on
991991
* max_group_id */
@@ -1011,7 +1011,7 @@ static struct command_result *pendingsendpays_done(struct command *cmd,
10111011
this_sent))
10121012
plugin_err(pay_plugin->plugin,
10131013
"%s (line %d) amount_msat overflow.",
1014-
__PRETTY_FUNCTION__, __LINE__);
1014+
__func__, __LINE__);
10151015
}
10161016
assert(!streq(status, "complete"));
10171017
}

plugins/renepay/routebuilder.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ struct route **get_routes(const tal_t *ctx,
229229
ctx, ecode, fail, PLUGIN_ERROR,
230230
"%s: flow is delivering to destination "
231231
"(%s) more than requested (%s)",
232-
__PRETTY_FUNCTION__,
232+
__func__,
233233
fmt_amount_msat(this_ctx, flows[i]->amount),
234234
fmt_amount_msat(this_ctx,
235235
amount_to_deliver));
@@ -285,7 +285,7 @@ struct route **get_routes(const tal_t *ctx,
285285
tal_report_error(
286286
ctx, ecode, fail, PLUGIN_ERROR,
287287
"%s failed to build route from flow.",
288-
__PRETTY_FUNCTION__);
288+
__func__);
289289
goto function_fail;
290290
}
291291

@@ -347,7 +347,7 @@ struct route **get_routes(const tal_t *ctx,
347347
ctx, ecode, fail, PLUGIN_ERROR,
348348
"%s routing fees (%s) exceed fee "
349349
"budget (%s).",
350-
__PRETTY_FUNCTION__,
350+
__func__,
351351
fmt_amount_msat(this_ctx, fee),
352352
fmt_amount_msat(this_ctx, feebudget));
353353
goto function_fail;
@@ -361,7 +361,7 @@ struct route **get_routes(const tal_t *ctx,
361361
ctx, ecode, fail, PLUGIN_ERROR,
362362
"%s: route delivering to destination (%s) "
363363
"is more than requested (%s)",
364-
__PRETTY_FUNCTION__,
364+
__func__,
365365
fmt_amount_msat(this_ctx, delivering),
366366
fmt_amount_msat(this_ctx,
367367
amount_to_deliver));

plugins/renepay/routefail.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct command_result *routefail_start(const tal_t *ctx, struct route *route,
3333
if (payment == NULL)
3434
plugin_err(pay_plugin->plugin,
3535
"%s: payment with hash %s not found.",
36-
__PRETTY_FUNCTION__,
36+
__func__,
3737
fmt_sha256(tmpctx, &route->key.payment_hash));
3838

3939
r->payment = payment;

plugins/renepay/routetracker.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ static struct payment *route_get_payment_verify(struct route *route)
1313
if (!payment)
1414
plugin_err(pay_plugin->plugin,
1515
"%s: no payment associated with routekey %s",
16-
__PRETTY_FUNCTION__,
16+
__func__,
1717
fmt_routekey(tmpctx, &route->key));
1818
return payment;
1919
}
@@ -162,14 +162,14 @@ static void route_pending_register(struct routetracker *routetracker,
162162
if (route_map_get(pay_plugin->pending_routes, &route->key))
163163
plugin_err(pay_plugin->plugin,
164164
"%s: tracking a route (%s) duplicate?",
165-
__PRETTY_FUNCTION__,
165+
__func__,
166166
fmt_routekey(tmpctx, &route->key));
167167

168168
if (!route_map_del(routetracker->sent_routes, route))
169169
plugin_err(pay_plugin->plugin,
170170
"%s: tracking a route (%s) not computed by this "
171171
"payment call",
172-
__PRETTY_FUNCTION__,
172+
__func__,
173173
fmt_routekey(tmpctx, &route->key));
174174

175175
uncertainty_commit_htlcs(pay_plugin->uncertainty, route);
@@ -179,7 +179,7 @@ static void route_pending_register(struct routetracker *routetracker,
179179
!tal_add_destructor2(route, remove_route,
180180
pay_plugin->pending_routes))
181181
plugin_err(pay_plugin->plugin, "%s: failed to register route.",
182-
__PRETTY_FUNCTION__);
182+
__func__);
183183

184184
if (!amount_msat_add(&payment->total_sent, payment->total_sent,
185185
route_sends(route)) ||
@@ -188,7 +188,7 @@ static void route_pending_register(struct routetracker *routetracker,
188188
route_delivers(route))) {
189189
plugin_err(pay_plugin->plugin,
190190
"%s: amount_msat arithmetic overflow.",
191-
__PRETTY_FUNCTION__);
191+
__func__);
192192
}
193193
}
194194

@@ -249,7 +249,7 @@ static struct command_result *sendpay_failed(struct command *cmd,
249249
if (!route_map_del(routetracker->sent_routes, route))
250250
plugin_err(pay_plugin->plugin,
251251
"%s: route (%s) is not marked as sent",
252-
__PRETTY_FUNCTION__,
252+
__func__,
253253
fmt_routekey(tmpctx, &route->key));
254254
tal_free(route);
255255
return command_still_pending(cmd);
@@ -290,7 +290,7 @@ void payment_collect_results(struct payment *payment,
290290
"%s: current groupid=%" PRIu64
291291
", but recieved a sendpay result with "
292292
"groupid=%" PRIu64,
293-
__PRETTY_FUNCTION__, payment->groupid,
293+
__func__, payment->groupid,
294294
r->key.groupid);
295295
continue;
296296
}
@@ -314,7 +314,7 @@ void payment_collect_results(struct payment *payment,
314314
plugin_err(pay_plugin->plugin,
315315
"%s: routes do not add up to "
316316
"payment total amount.",
317-
__PRETTY_FUNCTION__);
317+
__func__);
318318
}
319319
}
320320
for (size_t i = 0; i < ncompleted; i++)

plugins/renepay/test/run-route_map.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static void destroy_route(
3232
struct route_map * map)
3333
{
3434
printf("calling %s with %s\n",
35-
__PRETTY_FUNCTION__,
35+
__func__,
3636
fmt_routekey(tmpctx,&route->key));
3737
route_map_del(map, route);
3838
}

0 commit comments

Comments
 (0)