juce_VSTPluginFormat.cpp warning


#1
vstSupportsBypass = pluginCanDo ("bypass");

generates a warning C4800: ‘int’: forcing value to bool ‘true’ or ‘false’ (performance warning)

cast the value to a bool.

vstSupportsBypass = (pluginCanDo ("bypass") == 1);

Rail


#2

Thanks, I’ll get that sorted.


#3

When converting an int to a bool, it’s a good idea to get into the habit of using != 0 rather than == 1 :slight_smile:


#4

(oh, whoops… to clarify: pretty much the only time my comment above isn’t true is when you’re dealing with VST canDo return values, which are actually tri-state… I should read posts more thoroughly before replying!)