Strum / Strums_Mental_VCV_Modules

Strum's Mental Modules for VCV Rack
BSD 3-Clause "New" or "Revised" License
63 stars 15 forks source link

Compiling 0.4.0 Errors (Bool casting) #12

Closed metaphorz closed 6 years ago

metaphorz commented 6 years ago

On the Mac (10.12 Sierra):

I checked out 0.4.0 of Rack and trying to complete the source. I am getting these type of errors:

src/MentalPatchMatrix.cpp:30:5: error: type 'double' cannot be narrowed to 'bool' in initializer list [-Wc++11-narrowing] {{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}, ^~~ src/MentalPatchMatrix.cpp:30:5: note: insert an explicit cast to silence this issue {{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}, ^~~ ..........

I could change the "0.0" values to "0". Maybe an explicit cast is better?

metaphorz commented 6 years ago

I think I have it working on the Mac. @Strum: should I email you a zip? the zip would include the following files:

Demo_Patches (folder) plugin.dylib res (folder)

-p

PatchworkBoy commented 6 years ago

Just submitted a pull request fixing this. Alternatively, pop open src/MentalPatchMatrix.cpp and replace...

  bool switch_states[10][10] =
  {{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},
  {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},
  {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},
  {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},
  {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},
  {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},
  {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},
  {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},
  {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0},
  {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}};

with

  bool switch_states[10][10] =
  {{0,0,0,0,0,0,0,0,0,0},
  {0,0,0,0,0,0,0,0,0,0},
  {0,0,0,0,0,0,0,0,0,0},
  {0,0,0,0,0,0,0,0,0,0},
  {0,0,0,0,0,0,0,0,0,0},
  {0,0,0,0,0,0,0,0,0,0},
  {0,0,0,0,0,0,0,0,0,0},
  {0,0,0,0,0,0,0,0,0,0},
  {0,0,0,0,0,0,0,0,0,0},
  {0,0,0,0,0,0,0,0,0,0}};

A boolean type can only equal 0 or 1.
0.0 does NOT equal 0, so 0.0 cannot be used for a boolean value.

Mac build: plugin.dylib.zip

Strum commented 6 years ago

I don't get this issue when compiling under windows.

I see the problem, it's a simple fix, will sort it out later on, busy today.

metaphorz commented 6 years ago

It was an easy fix. Built this earlier. For those with Macs, it works on my machine (running Sierra). Hoping that my attachment below works.

Strums_Mental_VCV_Modules.zip

Strum commented 6 years ago

Thanks @metaphorz , iv'e added it to the repo.

Let me know if you find any other bugs

I know the CV ins on the cartesian sequencer aren't working right and I'm having a similar problem with the 4 to 1 Mux in the Muxes module. I think everything else is working pretty much as it should, just need the new look now but I've got a few more to build before I worry too much about that. See what the guys that are working on skins come up with.