Skip to content

Commit eca5906

Browse files
committed
Merge pull request opencv#9746 from alalek:fix_msvs2017_warning
2 parents b872d14 + 1f18282 commit eca5906

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

modules/calib3d/src/fisheye.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ double cv::fisheye::stereoCalibrate(InputArrayOfArrays objectPoints, InputArrayO
928928
intrinsicRight_errors.isEstimate = intrinsicRight.isEstimate;
929929

930930
std::vector<uchar> selectedParams;
931-
std::vector<int> tmp(6 * (n_images + 1), 1);
931+
std::vector<uchar> tmp(6 * (n_images + 1), 1);
932932
selectedParams.insert(selectedParams.end(), intrinsicLeft.isEstimate.begin(), intrinsicLeft.isEstimate.end());
933933
selectedParams.insert(selectedParams.end(), intrinsicRight.isEstimate.begin(), intrinsicRight.isEstimate.end());
934934
selectedParams.insert(selectedParams.end(), tmp.begin(), tmp.end());

modules/core/src/command_line_parser.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,14 @@ static const char* get_type_name(int type)
6969
return "unknown";
7070
}
7171

72+
// std::tolower is int->int
73+
static char char_tolower(char ch)
74+
{
75+
return (char)std::tolower((int)ch);
76+
}
7277
static bool parse_bool(std::string str)
7378
{
74-
std::transform(str.begin(), str.end(), str.begin(), ::tolower);
79+
std::transform(str.begin(), str.end(), str.begin(), char_tolower);
7580
std::istringstream is(str);
7681
bool b;
7782
is >> (str.size() > 1 ? std::boolalpha : std::noboolalpha) >> b;

modules/core/src/ocl.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,11 @@ static cl_device_id selectOpenCLDevice()
993993
return NULL;
994994
}
995995
#else
996+
// std::tolower is int->int
997+
static char char_tolower(char ch)
998+
{
999+
return (char)std::tolower((int)ch);
1000+
}
9961001
static cl_device_id selectOpenCLDevice()
9971002
{
9981003
std::string platform, deviceName;
@@ -1077,7 +1082,7 @@ static cl_device_id selectOpenCLDevice()
10771082
{
10781083
int deviceType = 0;
10791084
std::string tempStrDeviceType = deviceTypes[t];
1080-
std::transform( tempStrDeviceType.begin(), tempStrDeviceType.end(), tempStrDeviceType.begin(), tolower );
1085+
std::transform(tempStrDeviceType.begin(), tempStrDeviceType.end(), tempStrDeviceType.begin(), char_tolower);
10811086

10821087
if (tempStrDeviceType == "gpu" || tempStrDeviceType == "dgpu" || tempStrDeviceType == "igpu")
10831088
deviceType = Device::TYPE_GPU;

modules/stitching/src/exposure_compensate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void ExposureCompensator::feed(const std::vector<Point> &corners, const std::vec
6363
{
6464
std::vector<std::pair<UMat,uchar> > level_masks;
6565
for (size_t i = 0; i < masks.size(); ++i)
66-
level_masks.push_back(std::make_pair(masks[i], 255));
66+
level_masks.push_back(std::make_pair(masks[i], (uchar)255));
6767
feed(corners, images, level_masks);
6868
}
6969

0 commit comments

Comments
 (0)