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

conditional statement possible error #8

Open
ahadji05 opened this issue Oct 26, 2023 · 1 comment
Open

conditional statement possible error #8

ahadji05 opened this issue Oct 26, 2023 · 1 comment

Comments

@ahadji05
Copy link

ahadji05 commented Oct 26, 2023

In Butterworth.cpp , in this piece of code (line 201):

    // correct the overall gain
    if(filter == kLoPass || filter == kBandPass){ // pre-blt is okay for S-plane
        ba[0] = preBLTgain * (preBLTgain / gain); // 2nd term is how much BLT boosts,
    }
    else if(filter == kHiPass || kBandStop){ // HF gain != DC gain
        ba[0] = 1 / ba[0];
    }

My compiler complains about the line: else if(filter == kHiPass || kBandStop){ // HF gain != DC gain

error: converting the enum constant to a boolean [-Werror,-Wint-in-bool-context]
    else if(filter == kHiPass || kBandStop){ // HF gain != DC gain

I am using: icpx -Wall -Wextra -pedantic -Werror -Wno-unused-parameter

@ruohoruotsi
Copy link
Owner

Thank you for filing the issue ... what version of C++ compiler are you using, on what platform? This code is a bit old and so, it may need a PR to update it to modern compilers. Looking fwd>> to your response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants