Skip to content

Commit

Permalink
Removed some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
hsm4 committed Nov 27, 2023
1 parent dc00d3d commit 379b3cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/source/CVCapture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ CVSize2i CVCapture::open(int deviceNum)
Utils::log("SLProject", "Exception during OpenCV video capture creation: %s", e.what());
}
#else
WebCameraFacing facing;
WebCameraFacing facing = WebCameraFacing::FRONT;
if (_videoType == VT_MAIN)
facing = WebCameraFacing::BACK;
else if (_videoType == VT_SCND)
Expand Down
7 changes: 5 additions & 2 deletions modules/utils/source/AverageTiming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ void AverageTiming::doGetTimingMessage(char* m)
{
blocks.push_back(block.second);
}
std::sort(blocks.begin(), blocks.end(), [](AverageTimingBlock* lhs, AverageTimingBlock* rhs) -> bool
std::sort(blocks.begin(),
blocks.end(),
[](AverageTimingBlock* lhs, AverageTimingBlock* rhs) -> bool
{ return lhs->posV < rhs->posV; });

// find reference time
Expand All @@ -142,7 +144,8 @@ void AverageTiming::doGetTimingMessage(char* m)
{
refTime = (*blocks.begin())->val.average();
// insert number of measurement calls
snprintf(m + strlen(m), sizeof(m), "Num. calls: %i\n", (int)(*blocks.begin())->nCalls);
volatile int sizeofm = sizeof(m); // workaround against a warning in the next line
snprintf(m + strlen(m), sizeofm, "Num. calls: %i\n", (int)(*blocks.begin())->nCalls);
}

// calculate longest blockname
Expand Down

0 comments on commit 379b3cf

Please sign in to comment.