summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2018-09-06 09:04:07 -0700
committerMichael Bestas <mkbestas@lineageos.org>2019-02-26 14:44:09 +0100
commit125f38c753284ee15f6258782b41fcaffa41f42c (patch)
tree06d24c04ce4be3f7fc50dd2a5f73933418f940d0
parent9a441ee9c4c23862febce735c215a6a9efd9cbe3 (diff)
downloadandroid_hardware_qcom_media-lineage-16.0-caf-8998.tar.gz
android_hardware_qcom_media-lineage-16.0-caf-8998.tar.bz2
android_hardware_qcom_media-lineage-16.0-caf-8998.zip
Fix invalid logical constant creation.lineage-16.0-caf-8998
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.cpp8
-rw-r--r--mm-video-v4l2/vidc/venc/src/omx_video_base.cpp8
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);