From 8fb6d9f65038fad8e483fde8c51b67fef637f073 Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Fri, 19 Oct 2012 16:08:10 +0400 Subject: [PATCH] Fix Android build warnings --- modules/core/src/arithm.cpp | 8 ++++---- samples/cpp/stitching_detailed.cpp | 11 +++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/modules/core/src/arithm.cpp b/modules/core/src/arithm.cpp index 10ca872a98..66d979f64f 100644 --- a/modules/core/src/arithm.cpp +++ b/modules/core/src/arithm.cpp @@ -1228,10 +1228,10 @@ static int actualScalarDepth(const double* data, int len) maxval = MAX(maxval, ival); } return i < len ? CV_64F : - minval >= 0 && maxval <= UCHAR_MAX ? CV_8U : - minval >= SCHAR_MIN && maxval <= SCHAR_MAX ? CV_8S : - minval >= 0 && maxval <= USHRT_MAX ? CV_16U : - minval >= SHRT_MIN && maxval <= SHRT_MAX ? CV_16S : + minval >= 0 && maxval <= (int)UCHAR_MAX ? CV_8U : + minval >= (int)SCHAR_MIN && maxval <= (int)SCHAR_MAX ? CV_8S : + minval >= 0 && maxval <= (int)USHRT_MAX ? CV_16U : + minval >= (int)SHRT_MIN && maxval <= (int)SHRT_MAX ? CV_16S : CV_32S; } diff --git a/samples/cpp/stitching_detailed.cpp b/samples/cpp/stitching_detailed.cpp index cbd050d7c4..73d139e41b 100644 --- a/samples/cpp/stitching_detailed.cpp +++ b/samples/cpp/stitching_detailed.cpp @@ -326,7 +326,10 @@ static int parseCmdArgs(int argc, char** argv) int main(int argc, char* argv[]) { +#if ENABLE_LOG int64 app_start_time = getTickCount(); +#endif + cv::setBreakOnError(true); int retval = parseCmdArgs(argc, argv); @@ -345,7 +348,9 @@ int main(int argc, char* argv[]) bool is_work_scale_set = false, is_seam_scale_set = false, is_compose_scale_set = false; LOGLN("Finding features..."); +#if ENABLE_LOG int64 t = getTickCount(); +#endif Ptr finder; if (features_type == "surf") @@ -420,7 +425,9 @@ int main(int argc, char* argv[]) LOGLN("Finding features, time: " << ((getTickCount() - t) / getTickFrequency()) << " sec"); LOG("Pairwise matching"); +#if ENABLE_LOG t = getTickCount(); +#endif vector pairwise_matches; BestOf2NearestMatcher matcher(try_gpu, match_conf); matcher(features, pairwise_matches); @@ -516,7 +523,9 @@ int main(int argc, char* argv[]) } LOGLN("Warping images (auxiliary)... "); +#if ENABLE_LOG t = getTickCount(); +#endif vector corners(num_images); vector masks_warped(num_images); @@ -634,7 +643,9 @@ int main(int argc, char* argv[]) masks.clear(); LOGLN("Compositing..."); +#if ENABLE_LOG t = getTickCount(); +#endif Mat img_warped, img_warped_s; Mat dilated_mask, seam_mask, mask, mask_warped;