woutgg / ofxGenericDmx

an OpenFrameworks addon currently usable for both Enttec as well as generic DMX devices based on the FTDI USB chip
http://github.com/woutgg/ofxGenericDmx
MIT License
30 stars 8 forks source link

not compiling on mac os 11.16.1 #14

Closed vanbalen closed 2 years ago

vanbalen commented 2 years ago

I get the following error:

of_v0.11.2/addons/ofxGenericDmx/src/DmxUsbProDevice.cpp:204:3: Non-constant-expression cannot be narrowed from type 'unsigned int' to 'unsigned char' in initializer list

on these 2 lines:

int r;
    unsigned char reqParams[2] = {
        userConfigLength & 0xFF,
        ( userConfigLength >> 8 ) & 0xFF

(I'm an OF newbie and first time playing with DMX, using enttec dmx pro usb)

woutgg commented 2 years ago

Hi,

That seems to be due to changes in more recent compiler versions, I happened to run into it myself with another project.

I have not tried it myself, but this should fix it:

unsigned char reqParams[2] = {
    static_cast<unsigned char>(userConfigLength & 0xFF),
    static_cast<unsigned char>(( userConfigLength >> 8 ) & 0xFF)
};

Please let me know if that fixes it, and good luck with your DMX endeavours. :)

vanbalen commented 2 years ago

thnx so much, that worked!

woutgg commented 2 years ago

You're welcome!