Skip to content

Commit

Permalink
Merge pull request #3214 from Carbenium/type-limits
Browse files Browse the repository at this point in the history
Fix warnings reported by Wtype-limits and re-enable the warning on GCC
  • Loading branch information
connortechnology committed Apr 13, 2021
2 parents 95249d5 + 0676f71 commit cfefe3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
2 changes: 1 addition & 1 deletion cmake/compiler/gcc/settings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ target_compile_options(zm-warning-interface
-Wextra
-Wformat-security
-Wno-cast-function-type
-Wno-type-limits
$<$<VERSION_LESS_EQUAL:$<CXX_COMPILER_VERSION>,10>:-Wno-clobbered>
-Wno-unused-parameter
-Woverloaded-virtual)

Expand Down
16 changes: 2 additions & 14 deletions src/zm_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2051,10 +2051,6 @@ void Image::Annotate(
for ( unsigned int y = lo_line_y, r = 0; y < hi_line_y && r < char_height; y++, r++, ptr += width ) {
unsigned char *temp_ptr = ptr;
for ( unsigned int x = lo_line_x, c = 0; x < hi_line_x && c < line_len; c++ ) {
if ( line[c] > 0xFF ) {
Warning("Unsupported character %c in %s", line[c], line);
continue;
}
uint64_t f = font_bitmap[(line[c] * char_height) + r];
if ( !bg_trans ) memset(temp_ptr, bg_bw_col, char_width);
while ( f != 0 ) {
Expand All @@ -2072,10 +2068,6 @@ void Image::Annotate(
for ( unsigned int y = lo_line_y, r = 0; y < hi_line_y && r < char_height; y++, r++, ptr += wc ) {
unsigned char *temp_ptr = ptr;
for ( unsigned int x = lo_line_x, c = 0; x < hi_line_x && c < line_len; c++ ) {
if ( line[c] > 0xFF ) {
Warning("Unsupported character %c in %s", line[c], line);
continue;
}
uint64_t f = font_bitmap[(line[c] * char_height) + r];
if ( !bg_trans ) {
for ( int i = 0; i < char_width; i++ ) { // We need to set individual r,g,b components
Expand Down Expand Up @@ -2104,10 +2096,6 @@ void Image::Annotate(
for ( unsigned int y = lo_line_y, r = 0; y < hi_line_y && r < char_height; y++, r++, ptr += wc ) {
Rgb* temp_ptr = (Rgb*)ptr;
for ( unsigned int x = lo_line_x, c = 0; x < hi_line_x && c < line_len; c++ ) {
if ( line[c] > 0xFF ) {
Warning("Unsupported character %c in %s", line[c], line);
continue;
}
uint64_t f = font_bitmap[(line[c] * char_height) + r];
if ( !bg_trans ) {
for ( int i = 0; i < char_width; i++ )
Expand Down Expand Up @@ -4732,8 +4720,8 @@ void ssse3_convert_yuyv_gray8(const uint8_t* col1, uint8_t* result, unsigned lon

/* YUYV to RGB24 - relocated from zm_local_camera.cpp */
__attribute__((noinline)) void zm_convert_yuyv_rgb(const uint8_t* col1, uint8_t* result, unsigned long count) {
unsigned int r,g,b;
unsigned int y1,y2,u,v;
int32 r,g,b;
int32 y1,y2,u,v;
for(unsigned int i=0; i < count; i += 2, col1 += 4, result += 6) {
y1 = col1[0];
u = col1[1];
Expand Down

0 comments on commit cfefe3f

Please sign in to comment.