Skip to content

Commit

Permalink
Fix warnings detected with Apple clang version 16.0.0 (clang-1600.0.2…
Browse files Browse the repository at this point in the history
…6.3) on Sonoma 14.7
  • Loading branch information
fspindle committed Sep 19, 2024
1 parent dc477b2 commit e0ce967
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 33 deletions.
2 changes: 1 addition & 1 deletion modules/core/include/visp3/core/vpIoTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ template<typename T> void npz_save(std::string zipname, std::string fname, const
//write everything
fwrite(&local_header[0], sizeof(char), local_header.size(), fp);
fwrite(&npy_header[0], sizeof(char), npy_header.size(), fp);
fwrite(data, sizeof(T), nels, fp);
fwrite(&data[0], sizeof(T), nels, fp);
fwrite(&global_header[0], sizeof(char), global_header.size(), fp);
fwrite(&footer[0], sizeof(char), footer.size(), fp);
fclose(fp);
Expand Down
4 changes: 2 additions & 2 deletions modules/core/test/image/testImageOwnership.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ int main(int /* argc */, const char ** /* argv */)
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
{
unsigned char *bitmap = new unsigned char[12];
vpImage<unsigned char> I = std::move(vpImage<unsigned char>(bitmap, 3, 4, false));
vpImage<unsigned char> I = vpImage<unsigned char>(bitmap, 3, 4, false);
if (bitmap != I.bitmap) {
std::cout << "std::move(vpImage) failed" << std::endl;
return EXIT_FAILURE;
Expand All @@ -152,7 +152,7 @@ int main(int /* argc */, const char ** /* argv */)
}
{
unsigned char *bitmap = new unsigned char[12];
vpImage<unsigned char> I(std::move(vpImage<unsigned char>(bitmap, 3, 4, false)));
vpImage<unsigned char> I(vpImage<unsigned char>(bitmap, 3, 4, false));
if (bitmap != I.bitmap) {
std::cout << "vpImage(td::move(vpImage)) failed" << std::endl;
return EXIT_FAILURE;
Expand Down
2 changes: 2 additions & 0 deletions modules/sensor/src/rgb-depth/realsense/vpRealSense2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

#define MANUAL_POINTCLOUD 1

#if defined(VISP_HAVE_PCL) && defined(VISP_HAVE_PCL_COMMON)
namespace
{
bool operator==(const rs2_extrinsics &lhs, const rs2_extrinsics &rhs)
Expand All @@ -64,6 +65,7 @@ bool operator==(const rs2_extrinsics &lhs, const rs2_extrinsics &rhs)
return true;
}
} // namespace
#endif

BEGIN_VISP_NAMESPACE
/*!
Expand Down
30 changes: 0 additions & 30 deletions modules/sensor/test/rgb-depth/testRealSense2_D435_opencv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,36 +101,6 @@ unsigned char getDepthColor(const std::vector<uint32_t> &histogram, float z, flo
return static_cast<unsigned char>(histogram[static_cast<uint32_t>(z * depth_scale)] * 255 / histogram[0xFFFF]);
}

void getNativeFrame(const rs2::frame &frame, unsigned char *const data)
{
auto vf = frame.as<rs2::video_frame>();
int size = vf.get_width() * vf.get_height();

switch (frame.get_profile().format()) {
case RS2_FORMAT_RGB8:
case RS2_FORMAT_BGR8:
memcpy(data, frame.get_data(), size * 3);
break;

case RS2_FORMAT_RGBA8:
case RS2_FORMAT_BGRA8:
memcpy(data, frame.get_data(), size * 4);
break;

case RS2_FORMAT_Y16:
case RS2_FORMAT_Z16:
memcpy(data, frame.get_data(), size * 2);
break;

case RS2_FORMAT_Y8:
memcpy(data, frame.get_data(), size);
break;

default:
break;
}
}

void frame_to_mat(const rs2::frame &f, cv::Mat &img)
{
auto vf = f.as<rs2::video_frame>();
Expand Down

0 comments on commit e0ce967

Please sign in to comment.