From 287e07ebaa5fbcf9be0ce0cb1981798fc04bc9f1 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 27 Sep 2024 13:06:20 -0400 Subject: Make function parameters const wherever possible The early history of this code didn't tend to make parameters const, but the "const density" is high enough now that I often find myself wondering if something is mutable for some reason, or just old and sloppier. So, eliminate this confusion by making (hopefully) all function parameters const if possible. --- test/test_reader.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'test/test_reader.c') diff --git a/test/test_reader.c b/test/test_reader.c index 9e2edd17..e185b915 100644 --- a/test/test_reader.c +++ b/test/test_reader.c @@ -108,7 +108,10 @@ test_read_string(void) /// Reads a null byte after a statement, then succeeds again (like a socket) static size_t -eof_test_read(void* buf, size_t size, size_t nmemb, void* stream) +eof_test_read(void* const buf, + const size_t size, + const size_t nmemb, + void* const stream) { assert(size == 1); assert(nmemb == 1); @@ -144,7 +147,7 @@ eof_test_read(void* buf, size_t size, size_t nmemb, void* stream) } static int -eof_test_error(void* stream) +eof_test_error(void* const stream) { (void)stream; return 0; -- cgit v1.2.1