Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BaseTrackTableModel: Fix confusing DEBUG_ASSERT logic
Clang complains about this, and although it's a false positive the code is confusing and can be simplified. Fixes: /home/runner/work/mixxx/mixxx/src/library/basetracktablemodel.cpp:478:9: error: variable 'absoluteHeightOfCoverartToolTip' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] VERIFY_OR_DEBUG_ASSERT(primaryScreen) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/runner/work/mixxx/mixxx/src/util/assert.h:62:42: note: expanded from macro 'VERIFY_OR_DEBUG_ASSERT' #define VERIFY_OR_DEBUG_ASSERT(cond) if ((!(cond)) && mixxx_maybe_debug_assert_return_true(#cond, __FILE__, __LINE__, ASSERT_FUNCTION)) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/runner/work/mixxx/mixxx/src/library/basetracktablemodel.cpp:484:30: note: uninitialized use occurs here QPixmap pixmap = QPixmap(absoluteHeightOfCoverartToolTip, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/runner/work/mixxx/mixxx/src/library/basetracktablemodel.cpp:478:9: note: remove the 'if' if its condition is always true VERIFY_OR_DEBUG_ASSERT(primaryScreen) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/runner/work/mixxx/mixxx/src/util/assert.h:62:38: note: expanded from macro 'VERIFY_OR_DEBUG_ASSERT' #define VERIFY_OR_DEBUG_ASSERT(cond) if ((!(cond)) && mixxx_maybe_debug_assert_return_true(#cond, __FILE__, __LINE__, ASSERT_FUNCTION)) ^ /home/runner/work/mixxx/mixxx/src/library/basetracktablemodel.cpp:478:9: error: variable 'absoluteHeightOfCoverartToolTip' is used uninitialized whenever '&&' condition is false [-Werror,-Wsometimes-uninitialized] VERIFY_OR_DEBUG_ASSERT(primaryScreen) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/runner/work/mixxx/mixxx/src/util/assert.h:62:42: note: expanded from macro 'VERIFY_OR_DEBUG_ASSERT' #define VERIFY_OR_DEBUG_ASSERT(cond) if ((!(cond)) && mixxx_maybe_debug_assert_return_true(#cond, __FILE__, __LINE__, ASSERT_FUNCTION)) ^~~~~~~~~ /home/runner/work/mixxx/mixxx/src/library/basetracktablemodel.cpp:484:30: note: uninitialized use occurs here QPixmap pixmap = QPixmap(absoluteHeightOfCoverartToolTip, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/runner/work/mixxx/mixxx/src/library/basetracktablemodel.cpp:478:9: note: remove the '&&' if its condition is always true VERIFY_OR_DEBUG_ASSERT(primaryScreen) { ^ /home/runner/work/mixxx/mixxx/src/util/assert.h:62:42: note: expanded from macro 'VERIFY_OR_DEBUG_ASSERT' #define VERIFY_OR_DEBUG_ASSERT(cond) if ((!(cond)) && mixxx_maybe_debug_assert_return_true(#cond, __FILE__, __LINE__, ASSERT_FUNCTION)) ^ /home/runner/work/mixxx/mixxx/src/library/basetracktablemodel.cpp:471:49: note: initialize the variable 'absoluteHeightOfCoverartToolTip' to silence this warning unsigned int absoluteHeightOfCoverartToolTip; ^
- Loading branch information