Skip to content

Commit

Permalink
Fixed warnings produced by clang-9.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mshabunin committed Jan 30, 2019
1 parent e2dbf05 commit ea3dc78
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion modules/core/include/opencv2/core/persistence.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ class CV_EXPORTS_W FileStorage
BASE64 = 64, //!< flag, write rawdata in Base64 by default. (consider using WRITE_BASE64)
WRITE_BASE64 = BASE64 | WRITE, //!< flag, enable both WRITE and BASE64
};
enum
enum State
{
UNDEFINED = 0,
VALUE_EXPECTED = 1,
Expand Down
8 changes: 0 additions & 8 deletions modules/core/src/persistence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,14 +342,6 @@ static inline void writeReal(uchar* p, double fval)
class FileStorage::Impl : public FileStorage_API
{
public:
enum State
{
UNDEFINED = 0,
VALUE_EXPECTED = 1,
NAME_EXPECTED = 2,
INSIDE_MAP = 4
};

void init()
{
flags = 0;
Expand Down
7 changes: 7 additions & 0 deletions modules/core/test/test_ptr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,14 @@ TEST(Core_Ptr, assignment)

{
Ptr<Reporter> p1(new Reporter(&deleted1));
#if defined(__clang__) && (__clang_major__ >= 9) && !defined(__APPLE__)
CV_DO_PRAGMA(GCC diagnostic push)
CV_DO_PRAGMA(GCC diagnostic ignored "-Wself-assign-overloaded")
#endif
p1 = p1;
#if defined(__clang__) && (__clang_major__ >= 9) && !defined(__APPLE__)
CV_DO_PRAGMA(GCC diagnostic pop)
#endif
EXPECT_FALSE(deleted1);
}

Expand Down
2 changes: 1 addition & 1 deletion modules/gapi/include/opencv2/gapi/gcompoundkernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ template<typename T> struct tuple_wrap_helper
template<typename... Objs>
struct tuple_wrap_helper<std::tuple<Objs...>>
{
static std::tuple<Objs...> get(std::tuple<Objs...>&& objs) { return objs; }
static std::tuple<Objs...> get(std::tuple<Objs...>&& objs) { return std::forward<std::tuple<Objs...>>(objs); }
};

template<typename, typename, typename>
Expand Down
2 changes: 1 addition & 1 deletion modules/stitching/src/camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Mat CameraParams::K() const
Mat_<double> k = Mat::eye(3, 3, CV_64F);
k(0,0) = focal; k(0,2) = ppx;
k(1,1) = focal * aspect; k(1,2) = ppy;
return k;
return std::move(k);
}

} // namespace detail
Expand Down
8 changes: 4 additions & 4 deletions modules/video/src/optical_flow_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ CV_EXPORTS_W Mat readOpticalFlow( const String& path )
Mat_<Point2f> flow;
std::ifstream file(path.c_str(), std::ios_base::binary);
if ( !file.good() )
return flow; // no file - return empty matrix
return std::move(flow); // no file - return empty matrix

float tag;
file.read((char*) &tag, sizeof(float));
if ( tag != FLOW_TAG_FLOAT )
return flow;
return std::move(flow);

int width, height;

Expand All @@ -76,14 +76,14 @@ CV_EXPORTS_W Mat readOpticalFlow( const String& path )
if ( !file.good() )
{
flow.release();
return flow;
return std::move(flow);
}

flow(i, j) = u;
}
}
file.close();
return flow;
return std::move(flow);
}

CV_EXPORTS_W bool writeOpticalFlow( const String& path, InputArray flow )
Expand Down

0 comments on commit ea3dc78

Please sign in to comment.