diff options
| author | Stephen Hines <srhines@google.com> | 2018-09-06 09:04:07 -0700 |
|---|---|---|
| committer | Michael Bestas <mkbestas@lineageos.org> | 2019-02-24 18:31:44 +0100 |
| commit | 406a31fc933bebb4968bdaf4ba1a61fa225a360d (patch) | |
| tree | ea91164d03b195bb8a466cbd2cf9db91a5c7a886 | |
| parent | 10fa1b4155ebee93cbb28feeda32c4b8f478f919 (diff) | |
| download | android_hardware_qcom_media-lineage-16.0-caf-8996.tar.gz android_hardware_qcom_media-lineage-16.0-caf-8996.tar.bz2 android_hardware_qcom_media-lineage-16.0-caf-8996.zip | |
Fix invalid logical constant creation.lineage-16.0-caf-8996
This code incorrectly uses || to combine a bunch of state constants. The
next Clang warns on this buggy pattern.
hardware/qcom/media/msm8996/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp:1130:40:
error: use of logical '||' with constant operand
[-Werror,-Wconstant-logical-operand]
if (eState == (OMX_StateLoaded || OMX_StateWaitForResources
^ ~~~~~~~~~~~~~~~~~~~~~~~~~
hardware/qcom/media/msm8996/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp:1130:40:
note: use '|' for a bitwise operation
if (eState == (OMX_StateLoaded || OMX_StateWaitForResources
^~
|
Bug: http://b/110779387
Test: ./test_compiler.py --build-only --target aosp_sailfish-eng --no-clean-built-target ../../ --clang-path ../../prebuilts/clang/host/linux-x86/llvm-toolchain-dev/
Change-Id: I7332508f0f9827c7968a4680fe42eedffb3714e7
Signed-off-by: D. Andrei Măceș <andrei@unlegacy-android.org>
| -rw-r--r-- | mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp | 8 | ||||
| -rw-r--r-- | mm-video-v4l2/vidc/venc/src/omx_video_base.cpp | 8 |
2 files changed, 8 insertions, 8 deletions
diff --git a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp index 04e964f7..845e722d 100644 --- a/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp +++ b/mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp @@ -3228,10 +3228,10 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp, /* Current State is Invalid */ /*******************************/ 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)) { + /* State Transition from Invalid to any state */ + if (eState == OMX_StateLoaded || eState == OMX_StateWaitForResources || + eState == OMX_StateIdle || eState == OMX_StateExecuting || + eState == OMX_StatePause || eState == OMX_StateInvalid) { DEBUG_PRINT_ERROR("ERROR::send_command_proxy(): Invalid -->Loaded"); post_event(OMX_EventError,OMX_ErrorInvalidState,\ OMX_COMPONENT_GENERATE_EVENT); 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 f9f96593..7893a5fd 100644 --- a/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp +++ b/mm-video-v4l2/vidc/venc/src/omx_video_base.cpp @@ -1138,10 +1138,10 @@ OMX_ERRORTYPE omx_video::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp, /* Current State is Invalid */ /*******************************/ 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)) { + /* State Transition from Invalid to any state */ + 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); |
