aferrero2707 / PhotoFlow

A fully non-destructive photo retouching program providing a complete layer-based workflow including RAW image development.
http://aferrero2707.github.io/PhotoFlow
GNU General Public License v3.0
308 stars 36 forks source link

Please fix clang warnings #189

Closed yurivict closed 4 years ago

yurivict commented 5 years ago

clang-8 prints these and other warnings:

/usr/ports/graphics/photoflow/work/PhotoFlow-da84a071/src/rt/rtengine/dcraw.cc:994:4: warning: add explicit braces to avoid dangling else [-Wdangling-else]
          else ip[col][c] = (ip[col-width][c] + ip[col+width][c] + 1) >> 1;
          ^
/usr/ports/graphics/photoflow/work/PhotoFlow-da84a071/src/rt/rtengine/dcraw.cc:8575:30: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand]
      is_raw += (i = get4()) && 1;
                             ^  ~
/usr/ports/graphics/photoflow/work/PhotoFlow-da84a071/src/rt/rtengine/dcraw.cc:8575:30: note: use '&' for a bitwise operation
      is_raw += (i = get4()) && 1;
                             ^~
                             &
/usr/ports/graphics/photoflow/work/PhotoFlow-da84a071/src/rt/rtengine/dcraw.cc:8575:30: note: remove constant to silence this warning
      is_raw += (i = get4()) && 1;
                            ~^~~~
2 warnings generated.
/usr/ports/graphics/photoflow/work/PhotoFlow-da84a071/src/external/rawspeed/src/librawspeed/common/Common.h:141:18: warning: variable declaration in a constexpr function is a C++14 extension [-Wc++14-extensions]
  constexpr auto BitWidthOfT = CHAR_BIT * sizeof(T);
                 ^
/usr/ports/graphics/photoflow/work/PhotoFlow-da84a071/src/external/rawspeed/src/librawspeed/common/Common.h:144:11: warning: variable declaration in a constexpr function is a C++14 extension [-Wc++14-extensions]
  const T maxVal = (T(1) << nBits) - T(1);
          ^
/usr/ports/graphics/photoflow/work/PhotoFlow-da84a071/src/external/rawspeed/src/librawspeed/common/Common.h:138:3: warning: use of this statement in a constexpr function is a C++14 extension [-Wc++14-extensions]
  assert(nBits <= 16);
  ^
/usr/include/assert.h:51:19: note: expanded from macro 'assert'
#define assert(e)       ((void)0)
                        ^
In file included from /usr/ports/graphics/photoflow/work/PhotoFlow-da84a071/src/legacy/operations/raw_developer.cc:35:
In file included from /usr/ports/graphics/photoflow/work/PhotoFlow-da84a071/src/legacy/operations/raw_preprocessor.hh:38:
In file included from /usr/ports/graphics/photoflow/work/PhotoFlow-da84a071/src/legacy/operations/../../operations/raw_image.hh:59:
In file included from /usr/ports/graphics/photoflow/work/PhotoFlow-da84a071/src/external/rawspeed/src/librawspeed/RawSpeed-API.h:28:
/usr/ports/graphics/photoflow/work/PhotoFlow-da84a071/src/external/rawspeed/src/librawspeed/common/Common.h:155:3: warning: use of this statement in a constexpr function is a C++14 extension [-Wc++14-extensions]
  value = std::max(value, T(0));
  ^
10 warnings generated.
aferrero2707 commented 5 years ago

All those warnings (and several additional ones) should be fixed in current stable branch.

Thanks for the heads up!

aferrero2707 commented 4 years ago

There are no more warnings with clang from Apple LLVM version 10.0.1, therefore I am closing the issue.