core-lightning/tools/test/enum.c
Rusty Russell b1738c5b89 tools: fix 32 bit compile error
```
tools/test/enum.c: In function ‘fromwire_test_enum’:
tools/test/enum.c:11:34: error: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘size_t {aka unsigned int}’ [-Werror=format=]
  printf("fromwire_test_enum at %ld\n", *max);
```

and:

```
devtools/print_wire.c: In function ‘printwire_tlvs’:
devtools/print_wire.c:201:22: error: format ‘%ld’ expects argument of type ‘long int’, but argument 2 has type ‘u64 {aka long long unsigned int}’ [-Werror=format=]
    printf("**TYPE #%ld UNKNOWN for TLV %s**\n", type, fieldname);
                      ^
```
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-07-25 11:41:48 +08:00

19 lines
426 B
C

#include "enum.h"
#include <stdio.h>
void towire_test_enum(u8 **pptr, const enum test_enum test_enum)
{
printf("this would have been the towire for enum %u\n", test_enum);
}
enum test_enum fromwire_test_enum(const u8 **cursor, size_t *max)
{
printf("fromwire_test_enum at %zu\n", *max);
return TEST_ONE;
}
void printwire_test_enum(const char *fieldname, const enum test_enum *test_enum)
{
printf("%u\n", *test_enum);
}