Sunshine icon indicating copy to clipboard operation
Sunshine copied to clipboard

Fix compiler warning

Open istori1 opened this issue 1 year ago • 2 comments

Description

Compiler warning

/run/build/sunshine/src/platform/linux/graphics.cpp:40:9: warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses]
   40 |     if (!size() == 0) {
      |         ^       ~~
/run/build/sunshine/src/platform/linux/graphics.cpp:40:9: note: add parentheses after the '!' to evaluate the comparison first
   40 |     if (!size() == 0) {
      |         ^           
      |          (          )
/run/build/sunshine/src/platform/linux/graphics.cpp:40:9: note: add parentheses around left hand side expression to silence this warning
   40 |     if (!size() == 0) {
      |         ^
      |         (      )
1 warning generated.

Issues Fixed or Closed

Type of Change

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] Dependency update (updates to dependencies)
  • [ ] Documentation update (changes to documentation)
  • [ ] Repository update (changes to repository files, e.g. .github/...)

Checklist

  • [ ] My code follows the style guidelines of this project
  • [ ] I have performed a self-review of my own code
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch must be updated before it can be merged. You must also Allow edits from maintainers.

  • [x] I want maintainers to keep my branch updated

istori1 avatar Apr 01 '24 22:04 istori1

What compiler are you using?

ReenigneArcher avatar Apr 01 '24 22:04 ReenigneArcher

Clang++ 17

There are other warnings produced. This one looks very easy to solve.

istori1 avatar Apr 01 '24 23:04 istori1

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 6.49%. Comparing base (b7aa811) to head (724bebf).

Additional details and impacted files
@@           Coverage Diff           @@
##           nightly   #2349   +/-   ##
=======================================
  Coverage     6.49%   6.49%           
=======================================
  Files           85      85           
  Lines        18384   18384           
  Branches      8348    8348           
=======================================
  Hits          1194    1194           
  Misses       16149   16149           
  Partials      1041    1041           
Flag Coverage Δ
Linux 4.43% <0.00%> (ø)
Windows 2.01% <ø> (ø)
macOS-12 8.72% <ø> (+0.01%) :arrow_up:
macOS-13 8.07% <ø> (+0.01%) :arrow_up:
macOS-14 8.38% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/platform/linux/graphics.cpp 1.13% <0.00%> (ø)

codecov[bot] avatar Apr 02 '24 02:04 codecov[bot]