Skip to content

Commit

Permalink
common/bolt11: fix 32-bit compilation.
Browse files Browse the repository at this point in the history
Fixes d9fed06:

```
common/bolt11.c:868:31: error: format specifies type 'size_t' (aka 'unsigned long') but the argument has type 'u64' (aka 'unsigned long long') [-Werror,-Wformat]
                                           bech32_charset[type], field_len);
                                                                 ^~~~~~~~~
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed Jan 30, 2023
1 parent 2dec805 commit 9221f30
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions common/bolt11.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static struct bolt11 *decode_fail(struct bolt11 *b11, char **fail,
*/
static const char *unknown_field(struct bolt11 *b11,
struct hash_u5 *hu5,
const u5 **data, size_t *field_len,
const u5 **data, u64 *field_len,
u5 type)
{
struct bolt11_field *extra = tal(b11, struct bolt11_field);
Expand All @@ -157,7 +157,7 @@ static const char *unknown_field(struct bolt11 *b11,
* Otherwise copy into dst without padding, set have_flag if non-NULL. */
static const char *pull_expected_length(struct bolt11 *b11,
struct hash_u5 *hu5,
const u5 **data, size_t *field_len,
const u5 **data, u64 *field_len,
size_t expected_length,
u5 type,
bool *have_flag,
Expand All @@ -179,7 +179,7 @@ static const char *pull_expected_length(struct bolt11 *b11,
static const char *decode_p(struct bolt11 *b11,
const struct feature_set *our_features,
struct hash_u5 *hu5,
const u5 **data, size_t *field_len,
const u5 **data, u64 *field_len,
bool *have_p)
{
/* BOLT #11:
Expand Down Expand Up @@ -207,7 +207,7 @@ static const char *decode_p(struct bolt11 *b11,
static const char *decode_d(struct bolt11 *b11,
const struct feature_set *our_features,
struct hash_u5 *hu5,
const u5 **data, size_t *field_len,
const u5 **data, u64 *field_len,
bool *have_d)
{
u8 *desc;
Expand Down Expand Up @@ -236,7 +236,7 @@ static const char *decode_d(struct bolt11 *b11,
static const char *decode_h(struct bolt11 *b11,
const struct feature_set *our_features,
struct hash_u5 *hu5,
const u5 **data, size_t *field_len,
const u5 **data, u64 *field_len,
bool *have_h)
{
const char *err;
Expand Down Expand Up @@ -266,7 +266,7 @@ static const char *decode_h(struct bolt11 *b11,
static const char *decode_x(struct bolt11 *b11,
const struct feature_set *our_features,
struct hash_u5 *hu5,
const u5 **data, size_t *field_len,
const u5 **data, u64 *field_len,
bool *have_x)
{
const char *err;
Expand All @@ -290,7 +290,7 @@ static const char *decode_x(struct bolt11 *b11,
static const char *decode_c(struct bolt11 *b11,
const struct feature_set *our_features,
struct hash_u5 *hu5,
const u5 **data, size_t *field_len,
const u5 **data, u64 *field_len,
bool *have_c)
{
u64 c;
Expand All @@ -314,7 +314,7 @@ static const char *decode_c(struct bolt11 *b11,
static const char *decode_n(struct bolt11 *b11,
const struct feature_set *our_features,
struct hash_u5 *hu5,
const u5 **data, size_t *field_len,
const u5 **data, u64 *field_len,
bool *have_n)
{
assert(!*have_n);
Expand All @@ -335,7 +335,7 @@ static const char *decode_n(struct bolt11 *b11,
static const char *decode_s(struct bolt11 *b11,
const struct feature_set *our_features,
struct hash_u5 *hu5,
const u5 **data, size_t *field_len,
const u5 **data, u64 *field_len,
bool *have_s)
{
const char *err;
Expand Down Expand Up @@ -364,7 +364,7 @@ static const char *decode_s(struct bolt11 *b11,
static const char *decode_f(struct bolt11 *b11,
const struct feature_set *our_features,
struct hash_u5 *hu5,
const u5 **data, size_t *field_len,
const u5 **data, u64 *field_len,
bool *have_f)
{
u64 version;
Expand Down Expand Up @@ -466,7 +466,7 @@ static void towire_route_info(u8 **pptr, const struct route_info *route_info)
static const char *decode_r(struct bolt11 *b11,
const struct feature_set *our_features,
struct hash_u5 *hu5,
const u5 **data, size_t *field_len,
const u5 **data, u64 *field_len,
bool *have_r)
{
const u8 *r8;
Expand Down Expand Up @@ -518,7 +518,7 @@ static void shift_bitmap_down(u8 *bitmap, size_t bits)
static const char *decode_9(struct bolt11 *b11,
const struct feature_set *our_features,
struct hash_u5 *hu5,
const u5 **data, size_t *field_len,
const u5 **data, u64 *field_len,
bool *have_9)
{
size_t flen = (*field_len * 5 + 7) / 8;
Expand Down Expand Up @@ -565,7 +565,7 @@ static const char *decode_9(struct bolt11 *b11,
static const char *decode_m(struct bolt11 *b11,
const struct feature_set *our_features,
struct hash_u5 *hu5,
const u5 **data, size_t *field_len,
const u5 **data, u64 *field_len,
bool *have_m)
{
const char *err;
Expand Down Expand Up @@ -617,7 +617,7 @@ struct decoder {
const char *(*decode)(struct bolt11 *b11,
const struct feature_set *our_features,
struct hash_u5 *hu5,
const u5 **data, size_t *field_len,
const u5 **data, u64 *field_len,
bool *have_field);
};

Expand Down Expand Up @@ -864,7 +864,7 @@ struct bolt11 *bolt11_decode_nosig(const tal_t *ctx, const char *str,
if (problem)
return decode_fail(b11, fail, "%s", problem);
if (field_len)
return decode_fail(b11, fail, "%c: extra %zu bytes",
return decode_fail(b11, fail, "%c: extra %"PRIu64" bytes",
bech32_charset[type], field_len);
}

Expand Down

0 comments on commit 9221f30

Please sign in to comment.