NicePlayer icon indicating copy to clipboard operation
NicePlayer copied to clipboard

Build fails for i386 due to CGPoint/NSPoint mismatches

Open ryandesign opened this issue 6 years ago • 0 comments

Building for x86_64 works but building for i386 fails:

/path/to/NicePlayer-0.98/Plugin Sources/DVDPlayer/DVDPlayerView.m:
311:11: error: initializing 'CGPoint' (aka 'struct CGPoint') with an expression of incompatible type 'NSPoint' (aka 'struct _NSPoint')
                CGPoint point = [anEvent locationInWindow];
                        ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~
/path/to/NicePlayer-0.98/Plugin Sources/DVDPlayer/DVDPlayerView.m:319:10: error: initializing 'CGPoint' (aka 'struct CGPoint') with an expression of incompatible type 'NSPoint' (aka 'struct _NSPoint')
        CGPoint point = [anEvent locationInWindow];
                ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~

On x86_64, CGPoint and NSPoint are the same thing, but on i386 they are not, so it is important to use the correct type as documented and convert between them as needed, for example using NSPointFromCGPoint.

For example, locationInWindow is documented as returning an NSPoint but here you're assigning it to a CGPoint.

ryandesign avatar Oct 17 '18 05:10 ryandesign