[go: up one dir, main page]

Menu

#382 resid: fix deprecated-enum-float-conversion warnings

v3.x
closed-accepted
gpz
resid (28)
enhancement
2024-08-19
2024-08-03
No

Just a couple of explicit casts to fix a warning when compiling in c++20 mode

../../../vice-git/src/resid/sid.cc: In member function ‘bool reSID::SID::set_sampling_parameters(double, reSID::sampling_method, double, double, double)’:
../../../vice-git/src/resid/sid.cc:591:14: warning: arithmetic between enumeration type ‘reSID::SID::<unnamed enum>’ and floating-point type ‘double’ is deprecated [-Wdeprecated-enum-float-conversion]
  591 |     if (FIR_N*clock_freq/sample_freq >= RINGSIZE) {
      |         ~~~~~^~~~~~~~~~~
../../../vice-git/src/resid/sid.cc:591:38: warning: comparison of floating-point type ‘double’ with enumeration type ‘reSID::SID::<unnamed enum>’ is deprecated [-Wdeprecated-enum-float-conversion]
  591 |     if (FIR_N*clock_freq/sample_freq >= RINGSIZE) {
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
1 Attachments

Discussion

  • Leandro Nini

    Leandro Nini - 2024-08-06

    BTW, I see VICE now requires c++11, is that true for resid too?
    It would be even better replacing that enum values with constexpr definitions maybe.

     
  • gpz

    gpz - 2024-08-19

    If you feel that you need to use C++11 in reSID, just do it :)

    applied in r45315 - thanks!

     
  • gpz

    gpz - 2024-08-19
    • status: open --> closed-accepted
    • assigned_to: gpz
     

Log in to post a comment.