From 3e6e57d3c5db42455895d0ab04a19c5e49634fd5 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Tue, 7 Oct 2025 18:10:51 +0200 Subject: [PATCH] rename converter methods --- src/kds_s2000w_pixel_converter.c | 4 ++-- src/kds_s2000w_pixel_converter.h | 4 ++-- tests/kds_s2000w_pixel_converter_tests.c | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/kds_s2000w_pixel_converter.c b/src/kds_s2000w_pixel_converter.c index e97d5db..7b5717e 100644 --- a/src/kds_s2000w_pixel_converter.c +++ b/src/kds_s2000w_pixel_converter.c @@ -2,12 +2,12 @@ #define TENTH 10 -uint32_t kds_s2000w_pixel_converter_pixel_to_tenth_of_inch(uint32_t dpi, uint32_t pixel) +uint32_t kds_s2000w_pixel_converter_pixel_to_tenth_inch(uint32_t dpi, uint32_t pixel) { return pixel * TENTH / dpi; } -uint32_t kds_s2000w_pixel_converter_tenth_of_inch_to_pixel(uint32_t dpi, uint32_t tenth_inch) +uint32_t kds_s2000w_pixel_converter_tenth_inch_to_pixel(uint32_t dpi, uint32_t tenth_inch) { return tenth_inch * dpi / TENTH; } \ No newline at end of file diff --git a/src/kds_s2000w_pixel_converter.h b/src/kds_s2000w_pixel_converter.h index 374f8e3..5586723 100644 --- a/src/kds_s2000w_pixel_converter.h +++ b/src/kds_s2000w_pixel_converter.h @@ -2,7 +2,7 @@ #define KDS_S2000W_PIXEL_CONVERTER_H #include -uint32_t kds_s2000w_pixel_converter_pixel_to_tenth_of_inch(uint32_t dpi, uint32_t pixel); -uint32_t kds_s2000w_pixel_converter_tenth_of_inch_to_pixel(uint32_t dpi, uint32_t tenth_inch); +uint32_t kds_s2000w_pixel_converter_pixel_to_tenth_inch(uint32_t dpi, uint32_t pixel); +uint32_t kds_s2000w_pixel_converter_tenth_inch_to_pixel(uint32_t dpi, uint32_t tenth_inch); #endif \ No newline at end of file diff --git a/tests/kds_s2000w_pixel_converter_tests.c b/tests/kds_s2000w_pixel_converter_tests.c index 43afee4..49c34e0 100644 --- a/tests/kds_s2000w_pixel_converter_tests.c +++ b/tests/kds_s2000w_pixel_converter_tests.c @@ -10,17 +10,17 @@ void kds_s2000w_max_tl_x_pixel_to_tenth_inch_test() uint32_t dpi = 300; uint32_t pixel = 2250; - uint32_t tenth_inch = kds_s2000w_pixel_converter_pixel_to_tenth_of_inch(dpi, pixel); + uint32_t tenth_inch = kds_s2000w_pixel_converter_pixel_to_tenth_inch(dpi, pixel); assert_int_equal(tenth_inch, 75); } -void kds_s2000w_max_tl_x_tenth_of_inch_to_pixel_test() +void kds_s2000w_max_tl_x_tenth_inch_to_pixel_test() { uint32_t dpi = 300; uint32_t tenth_inch = 75; - uint32_t pixel = kds_s2000w_pixel_converter_tenth_of_inch_to_pixel(dpi, tenth_inch); + uint32_t pixel = kds_s2000w_pixel_converter_tenth_inch_to_pixel(dpi, tenth_inch); assert_int_equal(pixel, 2250); } @@ -29,7 +29,7 @@ int main() { const struct CMUnitTest tests[] = { cmocka_unit_test(kds_s2000w_max_tl_x_pixel_to_tenth_inch_test), - cmocka_unit_test(kds_s2000w_max_tl_x_tenth_of_inch_to_pixel_test) + cmocka_unit_test(kds_s2000w_max_tl_x_tenth_inch_to_pixel_test) }; return cmocka_run_group_tests(tests, NULL, NULL); -- 2.47.3