diff options
author | Stephen Hines <srhines@google.com> | 2018-09-26 15:06:52 -0700 |
---|---|---|
committer | Stephen Hines <srhines@google.com> | 2018-09-26 15:06:52 -0700 |
commit | 891f019d60607816fc482c09cbd360f6d60f89fc (patch) | |
tree | 7c8aeee0187199fd4ee4afb34bc1df667e127a14 | |
parent | e9a61bf14149fe527257429c28819fb571812921 (diff) | |
download | media-891f019d60607816fc482c09cbd360f6d60f89fc.tar.gz |
Fix invalid logical constant creation in sdm845.
This code incorrectly uses || to combine a bunch of state constants. The
next Clang warns on this buggy pattern.
hardware/qcom/sdm845/media/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp:1097:40: error: use of logical '||' with constant operand [-Werror,-Wconstant-logical-operand]
if (eState == (OMX_StateLoaded || OMX_StateWaitForResources
^ ~~~~~~~~~~~~~~~~~~~~~~~~~
hardware/qcom/sdm845/media/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp:1097:40: note: use '|' for a bitwise operation
if (eState == (OMX_StateLoaded || OMX_StateWaitForResources
^~
|
Bug: http://b/110779387
Test: Build with new toolchain.
Change-Id: If791d503a43740f83189f181964931a26cb77fe2
-rw-r--r-- | mm-video-v4l2/vidc/venc/src/omx_video_base.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp b/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp index 016f5cb9..ca03063a 100644 --- a/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp +++ b/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp @@ -1094,9 +1094,9 @@ OMX_ERRORTYPE omx_video::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp, /*******************************/ else if (m_state == OMX_StateInvalid) { /* State Transition from Inavlid to any state */ - if (eState == (OMX_StateLoaded || OMX_StateWaitForResources - || OMX_StateIdle || OMX_StateExecuting - || OMX_StatePause || OMX_StateInvalid)) { + if (eState == OMX_StateLoaded || eState == OMX_StateWaitForResources || + eState == OMX_StateIdle || eState == OMX_StateExecuting || + eState == OMX_StatePause || eState == OMX_StateInvalid) { DEBUG_PRINT_ERROR("ERROR: OMXCORE-SM: Invalid -->Loaded"); post_event(OMX_EventError,OMX_ErrorInvalidState,\ OMX_COMPONENT_GENERATE_EVENT); |