Skip to content

Commit

Permalink
Improved compatibility with newer compilers.
Browse files Browse the repository at this point in the history
  • Loading branch information
peci1 committed Jan 4, 2025
1 parent 42f9da0 commit c9da877
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cras_cpp_common/src/log_utils/nodelet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const static std::string NOT_SET {"getNameFn is not set!"}; // NOLINT
NodeletLogHelper::NodeletLogHelper(const GetNameFn& getNameFn) : getNameFn(getNameFn)
{
if (!this->getNameFn)
this->getNameFn = [](){ return NOT_SET; };
this->getNameFn = []() -> const std::string& { return NOT_SET; };
}

void NodeletLogHelper::initializeLogLocationImpl(
Expand Down
4 changes: 2 additions & 2 deletions image_transport_codecs/src/codecs/compressed_depth_codec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ cv::Mat CompressedDepthCodec::decodeRVL(const std::vector<uint8_t>& compressed)
if (rows == 0 || cols == 0)
{
CRAS_ERROR_THROTTLE(1.0, "Received malformed RVL-encoded image. Size %ix%i contains zero.", cols, rows);
return {0, 0, CV_16UC1};
return cv::Mat(0, 0, CV_16UC1);
}

// Sanity check - the best compression ratio is 4x; we leave some buffer, so we check whether the output image would
Expand All @@ -389,7 +389,7 @@ cv::Mat CompressedDepthCodec::decodeRVL(const std::vector<uint8_t>& compressed)
if (numPixels > std::numeric_limits<int>::max() || numPixels > static_cast<uint64_t>(compressed.size()) * 5)
{
CRAS_ERROR_THROTTLE(1.0, "Received malformed RVL-encoded image. It reports size %ux%u.", cols, rows);
return {0, 0, CV_16UC1};
return cv::Mat(0, 0, CV_16UC1);
}

cv::Mat decompressed(rows, cols, CV_16UC1);
Expand Down

0 comments on commit c9da877

Please sign in to comment.