]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
fix loop unsigned compare
authorBastian Dehn <hhaalo@arcor.de>
Thu, 9 Oct 2025 18:30:35 +0000 (20:30 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Thu, 9 Oct 2025 18:30:35 +0000 (20:30 +0200)
CMakeLists.txt
src/kds_s2000w_image_converter_netpbm.c

index 54f5f938db2d7ea55540be76a023a0329c4ed982..bbdc72f323fa9e2f373baaf87a271026e96fb2af 100644 (file)
@@ -7,11 +7,11 @@ PROJECT("kds-s2000w-net")
 SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "release")
 
 IF(CMAKE_BUILD_TYPE STREQUAL "Release")
-       SET(CMAKE_C_FLAGS "-std=c99 -fPIC -Wall -Wextra -Werror -pedantic" CACHE STRING "compiler flags" FORCE)
+       SET(CMAKE_C_FLAGS "-std=c99 -fPIC -Wall -Wextra -Wno-unused-parameter -Werror -pedantic" CACHE STRING "compiler flags" FORCE)
 ENDIF()
 
 IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
-       SET(CMAKE_C_FLAGS "-std=c99 -fPIC -Wall -Wextra -pedantic -g" CACHE STRING "debug compiler flags" FORCE)
+       SET(CMAKE_C_FLAGS "-std=c99 -fPIC -Wall -Wextra -Wno-unused-parameter -pedantic -g" CACHE STRING "debug compiler flags" FORCE)
 ENDIF()
 
 IF (RUN_TESTS)
@@ -21,6 +21,7 @@ IF (RUN_TESTS)
 -ftest-coverage \
 -Wall \
 -Wextra \
+-Wno-unused-parameter \
 -pedantic \
 -g \
 -fsanitize=address \
index 9ff11bddcaa1c3931918908ed8e83f266bc93576..f2f1c2162e85cf4fa2cb47758f9c7ba43e3d0625 100644 (file)
@@ -196,7 +196,7 @@ void _kds_s2000w_image_converter_write_bw_pnm(uint8_t* data,
 
        uint32_t curr_width = 0;
        uint32_t curr_height = 0;
-       for (int i = 0; i < size; i++) {
+       for (uint32_t i = 0; i < size; i++) {
                _kds_s2000w_image_converter_set_pixels(data[i], &pixels[curr_height][curr_width]);
                curr_width += 8;