From f527715933298157368baed7df4a7819a860565e Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Thu, 13 Jul 2017 10:45:01 +0200 Subject: [PATCH] Fix type of bit values (fixes compiler warning) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A single bit cannot represent a signed integer value, so it must be an unsigned integer. This fixes a compiler warning: In file included from ../ccutil/clst.h:24:0, from ../ccstruct/blobbox.h:23, from workingpartset.h:24, from workingpartset.cpp:21: ../ccstruct/blobbox.h: In member function ‘void BLOBNBOX::set_reduced_box(TBOX)’: ../ccutil/host.h:79:25: warning: overflow in conversion from ‘int’ to ‘signed char:1’ changes value from ‘1’ to ‘-1’ [-Woverflow] #define TRUE 1 ^ ../ccstruct/blobbox.h:236:17: note: in expansion of macro ‘TRUE’ reduced = TRUE; ^~~~ Signed-off-by: Stefan Weil --- ccstruct/blobbox.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ccstruct/blobbox.h b/ccstruct/blobbox.h index d56dc2ff08..6ec8bef0c8 100644 --- a/ccstruct/blobbox.h +++ b/ccstruct/blobbox.h @@ -233,7 +233,7 @@ class BLOBNBOX:public ELIST_LINK } void set_reduced_box(TBOX new_box) { red_box = new_box; - reduced = TRUE; + reduced = true; } inT32 enclosed_area() const { return area; @@ -503,8 +503,8 @@ class BLOBNBOX:public ELIST_LINK TBOX box; // bounding box TBOX red_box; // bounding box int area:30; // enclosed area - int joined:1; // joined to prev - int reduced:1; // reduced box set + unsigned joined:1; // joined to prev + unsigned reduced:1; // reduced box set int repeated_set_; // id of the set of repeated blobs TabType left_tab_type_; // Indicates tab-stop assessment TabType right_tab_type_; // Indicates tab-stop assessment