Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler warnings for -Wenum-float-conversion #1284

Merged
merged 1 commit into from Nov 4, 2023

Commits on Nov 4, 2023

  1. Fix compiler warnings for -Wenum-float-conversion

    無名列挙型の値がdobule型の変数と算術演算しているとコンパイラーの警告で
    指摘されたためconstexpr定数に変更して修正します。
    
    clang-17のレポート
    ```
    src/image/imageadmin.cpp:978:41: warning: compound assignment of floating-point type 'double' from enumeration type '(unnamed enum at ../src/global.h:10:1)' [-Wenum-float-conversion]
      978 |         if( scroll == SCROLL_LEFT ) pos -= ICON_SIZE;
          |                                     ~~~ ^  ~~~~~~~~~
    src/image/imageadmin.cpp:979:18: warning: compound assignment of floating-point type 'double' from enumeration type '(unnamed enum at ../src/global.h:10:1)' [-Wenum-float-conversion]
      979 |         else pos += ICON_SIZE;
          |              ~~~ ^  ~~~~~~~~~
    src/article/drawareabase.cpp:2305:47: warning: arithmetic between enumeration type '(unnamed enum at /home/ma8ma/var/repos/JDim/weverythingclang17-unity/../src/article/drawareabase.cpp:57:1)' and floating-point type 'double' [-Wenum-float-conversion]
     2305 |     constexpr const double r = AUTOSCR_CIRCLE / 2.0;
          |                                ~~~~~~~~~~~~~~ ^ ~~~
    ```
    ma8ma committed Nov 4, 2023
    Configuration menu
    Copy the full SHA
    da515f5 View commit details
    Browse the repository at this point in the history