Skip to content

Commit

Permalink
Fix type of bit values (fixes compiler warning)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
stweil committed Jul 15, 2017
1 parent dc8745e commit f527715
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ccstruct/blobbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f527715

Please sign in to comment.