diff --git a/include/nana/paint/detail/image_bmp.hpp b/include/nana/paint/detail/image_bmp.hpp index e7b27c35..f5493881 100644 --- a/include/nana/paint/detail/image_bmp.hpp +++ b/include/nana/paint/detail/image_bmp.hpp @@ -82,7 +82,7 @@ namespace nana{ namespace paint return false; std::unique_ptr buffer(new char[static_cast(size)]); - + ifs.read(buffer.get(), size); if(size == ifs.gcount()) { @@ -94,7 +94,7 @@ namespace nana{ namespace paint //Bitmap file is 4byte-aligned for each line. std::size_t bytes_per_line; - const std::size_t height_pixels = abs(info->bmiHeader.biHeight); + const std::size_t height_pixels = std::abs(info->bmiHeader.biHeight); if(0 == info->bmiHeader.biSizeImage) bytes_per_line = (((info->bmiHeader.biWidth * info->bmiHeader.biBitCount + 31) & ~31) >> 3); else @@ -204,7 +204,7 @@ namespace nana{ namespace paint d = dpend; s -= bytes_per_line; } - } + } } else if(2 == info->bmiHeader.biBitCount) { @@ -257,7 +257,7 @@ namespace nana{ namespace paint d = dpend; s -= bytes_per_line; } - } + } } else if(1 == info->bmiHeader.biBitCount) { @@ -310,7 +310,7 @@ namespace nana{ namespace paint d = dpend; s -= bytes_per_line; } - } + } } } } diff --git a/source/gui/layout_utility.cpp b/source/gui/layout_utility.cpp index 7f72db0c..d59e89c3 100644 --- a/source/gui/layout_utility.cpp +++ b/source/gui/layout_utility.cpp @@ -18,11 +18,11 @@ namespace nana //overlap test if overlaped between r1 and r2 bool overlap(const rectangle& r1, const rectangle& r2) { - if (r1.y + long long(r1.height) <= r2.y) return false; - if(r1.y >= r2.y + long long(r2.height)) return false; + if (r1.y + (long long)(r1.height) <= r2.y) return false; + if(r1.y >= r2.y + (long long)(r2.height)) return false; - if(r1.x + long long(r1.width) <= r2.x) return false; - if(r1.x >= r2.x + long long(r2.width)) return false; + if(r1.x + (long long)(r1.width) <= r2.x) return false; + if(r1.x >= r2.x + (long long)(r2.width)) return false; return true; } @@ -255,7 +255,7 @@ namespace nana ref_s.width = static_cast(ref_s.height * rate_input); else if (rate_input > rate_ref) ref_s.height = static_cast(ref_s.width / rate_input); - + return ref_s; }