diff --git a/example/library/library.c b/example/library/library.c index 4f1618e1..c4ea4a8e 100644 --- a/example/library/library.c +++ b/example/library/library.c @@ -25,12 +25,12 @@ for a C compiler $cc, such as clang or gcc. #define DST_BUFFER_SIZE (1024 * 1024) -size_t lgtm_len = 20; - +// lgtm_ptr and lgtm_len hold a flate-encoded "LGTM" message. uint8_t lgtm_ptr[] = { 0xf3, 0xc9, 0xcf, 0xcf, 0x2e, 0x56, 0x48, 0xcf, 0xcf, 0x4f, 0x51, 0x28, 0xc9, 0x57, 0xc8, 0x4d, 0xd5, 0xe3, 0x02, 0x00, }; +size_t lgtm_len = 20; // ignore_return_value suppresses errors from -Wall -Werror. static void ignore_return_value(int ignored) {} diff --git a/example/peterface/peterface.c b/example/peterface/peterface.c index b64f7598..e89e5601 100644 --- a/example/peterface/peterface.c +++ b/example/peterface/peterface.c @@ -108,20 +108,18 @@ func main() { if err != nil { log.Fatal(err) } - fmt.Printf("size_t pjw_len = %d;\n\n", len(data)) fmt.Printf("uint8_t pjw_ptr[] = {\n") for _, c := range data { fmt.Printf("%#02x,", c) } fmt.Printf("\n};\n") + fmt.Printf("size_t pjw_len = %d;\n", len(data)) } ---- and piping the result through clang-format. */ -size_t pjw_len = 158; - uint8_t pjw_ptr[] = { 0x47, 0x49, 0x46, 0x38, 0x39, 0x61, 0x20, 0x00, 0x20, 0x00, 0xf0, 0x01, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x21, 0xf9, 0x04, 0x00, 0x00, @@ -138,3 +136,4 @@ uint8_t pjw_ptr[] = { 0x24, 0x38, 0x76, 0x23, 0x08, 0x16, 0xb8, 0xf8, 0x98, 0xd6, 0x50, 0x00, 0x00, 0x3b, }; +size_t pjw_len = 158;