]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
change type check with stdint
authorBastian Dehn <hhaalo@arcor.de>
Sat, 8 Feb 2025 19:01:28 +0000 (20:01 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 8 Feb 2025 19:01:28 +0000 (20:01 +0100)
src/kds_s2000w_image_type_check.c
src/kds_s2000w_image_type_check.h

index ed5957d30b14ac2e5e2dd619391edafc873da618..f405ca652ba90c35055a182eee3f12873af8b9b5 100644 (file)
@@ -2,7 +2,7 @@
 #include "kds_s2000w_debug.h"
 #include "kds_s2000w_image_type_check.h"
 
-int kds_s2000w_image_type_check_is_tiff(blobdata* image)
+uint8_t kds_s2000w_image_type_check_is_tiff(blobdata* image)
 {
        kds_s2000w_debug_printf(ALL, "kds_s2000w_image_type_check_is_tiff");
 
@@ -11,7 +11,7 @@ int kds_s2000w_image_type_check_is_tiff(blobdata* image)
 
        char* image_data = (char*) image->data;
 
-       int result = image_data[0] == (char)0x49;
+       uint8_t result = image_data[0] == (char)0x49;
        result = result && image_data[1] == (char)0x49;
        result = result && image_data[2] == (char)0x2A;
        result = result && image_data[3] == (char)0x00;
@@ -25,7 +25,7 @@ int kds_s2000w_image_type_check_is_tiff(blobdata* image)
        return result && image_data[3] == (char)0x2A;
 }
 
-int kds_s2000w_image_type_check_is_pnm(blobdata* image)
+uint8_t kds_s2000w_image_type_check_is_pnm(blobdata* image)
 {
        kds_s2000w_debug_printf(ALL, "kds_s2000w_image_type_check_is_pnm");
 
@@ -39,7 +39,7 @@ int kds_s2000w_image_type_check_is_pnm(blobdata* image)
        return strncmp(image_data, "P4", 2) == 0;
 }
 
-int kds_s2000w_image_type_check_is_jpeg(blobdata* image)
+uint8_t kds_s2000w_image_type_check_is_jpeg(blobdata* image)
 {
        kds_s2000w_debug_printf(ALL, "kds_s2000w_image_type_check_is_jpeg");
 
@@ -48,6 +48,6 @@ int kds_s2000w_image_type_check_is_jpeg(blobdata* image)
 
        char* image_data = (char*) image->data;
 
-       int result = image_data[0] == (char)0xff;
+       uint8_t result = image_data[0] == (char)0xff;
        return result && image_data[1] == (char)0xd8;
 }
\ No newline at end of file
index 9de38aeabc5f7608676ed80ff376b35c0ea841b0..d82665face07c267f4636ffe722e6b3e5c93ec13 100644 (file)
@@ -1,9 +1,10 @@
 #ifndef KDS_S2000W_IMAGE_TYPE_CHECK_H
 #define KDS_S2000W_IMAGE_TYPE_CHECK_H
+#include <stdint.h>
 #include "kds_s2000w_image_converter.h"
 
-int kds_s2000w_image_type_check_is_tiff(blobdata* image);
-int kds_s2000w_image_type_check_is_pnm(blobdata* image);
-int kds_s2000w_image_type_check_is_jpeg(blobdata* image);
+uint8_t kds_s2000w_image_type_check_is_tiff(blobdata* image);
+uint8_t kds_s2000w_image_type_check_is_pnm(blobdata* image);
+uint8_t kds_s2000w_image_type_check_is_jpeg(blobdata* image);
 
 #endif
\ No newline at end of file