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!)


#5

In the tip… line 3079 should be:

 pluginRespondsToDPIChanges = plugin.pluginCanDo ("supportsViewDpiScaling") > 0;

Rail


#6

https://github.com/WeAreROLI/JUCE-dev/commit/688b3f71e1d9912022f233ea1309d97ad51af567