Skip to content

Commit

Permalink
Remove bitwise operator to satisfy misra c++
Browse files Browse the repository at this point in the history
  • Loading branch information
fspindle committed Jul 4, 2024
1 parent b5f1d9a commit 682da93
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions modules/core/src/image/vpImageConvert_yuv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,13 @@ namespace
{
void vpSAT(int &c)
{
if (c & (~255)) {
if (c < 0) {
c = 0;
}
else {
const unsigned int val_255 = 255;
c = val_255;
}
const unsigned int val_255 = 255;
if (c < 0) {
c = 0;
}
else if (c > val_255) {

c = val_255;
}
}
};
Expand Down

0 comments on commit 682da93

Please sign in to comment.