Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix compiler warnings for -Wimplicit-int-float-conversion (#1373)
longやunsigned longの変数をdoubleに暗黙的に変換している箇所は 精度が失う可能性があるとclangに指摘されたため明示的にキャスト `static_cast<double>()`を使いコンパイラに意図した変更であると伝えます。 clang 17のレポート (file pathを一部省略) ``` src/article/drawareabase.cpp:5452:46: warning: implicit conversion from 'gint64' (aka 'long') to 'double' may lose precision [-Wimplicit-int-float-conversion] 5452 | m_deceleration.elapsed += ( current_time - m_deceleration.last_time ) * kDecelerationRatio; | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ ~ src/image/imageadmin.cpp:850:44: warning: implicit conversion from 'size_type' (aka 'unsigned long') to 'double' may lose precision [-Wimplicit-int-float-conversion] 850 | double upper = m_list_view.size() * ICON_SIZE; | ~~~~~ ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ ```
- Loading branch information