kfix / ddcctl

DDC monitor controls (brightness) for Mac OSX command line
GNU General Public License v3.0
1.86k stars 150 forks source link

fix warning about nullable NSPointerArray values of _displayIDs #116

Closed kfix closed 2 years ago

kfix commented 3 years ago

fixes this:

cc -Wall -DDEBUG -c -o build/debug/DDC.o src/DDC.c
cc -Wall -DDEBUG -o bin/debug/ddcctl -lobjc -framework IOKit -framework AppKit -framework Foundation build/debug/DDC.o ./src/ddcctl.m
./src/ddcctl.m:412:38: warning: cast to smaller integer type 'CGDirectDisplayID' (aka 'unsigned int') from 'void * _Nullable' [-Wvoid-pointer-to-int-cast]
        CGDirectDisplayID cdisplay = (CGDirectDisplayID)[_displayIDs pointerAtIndex:displayId - 1];
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
kfix commented 2 years ago

I guess it still works but my Big Sur 11.6.1 MBP2017 (AMD) isn't able to read VCPs on anything right now!