Commit 8e428f4
committed
ui_cocoa: cast [NSWindow contentView] to (NSView*) for bounds call
GCC 4.0 (Xcode 3.1, PowerPC) reports:
ui_cocoa.m:629: error: incompatible types for argument 1
of 'setFrame:'
The receiver-side cast added in 47a7fd4 was not the actual fix —
this error is from the argument side. On the 10.5-10.9 SDKs:
@interface NSWindow ...
- (id)contentView;
contentView returns id, not NSView*. (Apple changed this to NSView*
only in 10.10+.) When GCC 4.0 sees [<id> bounds], it picks any
visible bounds selector — and cocoa_common.h imports
<QuartzCore/QuartzCore.h>, so both NSView (NSRect) and CALayer
(CGRect) are visible. On 32-bit 10.5 NSRect and CGRect are
incompatible types, so whichever way GCC picks, half the callers
get a type mismatch.
Cast the contentView result to (NSView*) so its bounds call
resolves unambiguously to NSView's NSRect version. Fix both
setFrame: call sites in the file (lines 629 and 726) at once;
they have identical shape and would otherwise fail in sequence.
Modern clang infers the correct type from receiver context; the
cast is a no-op there.1 parent 47a7fd4 commit 8e428f4
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
626 | 626 | | |
627 | 627 | | |
628 | 628 | | |
629 | | - | |
| 629 | + | |
630 | 630 | | |
631 | 631 | | |
632 | 632 | | |
| |||
723 | 723 | | |
724 | 724 | | |
725 | 725 | | |
726 | | - | |
| 726 | + | |
727 | 727 | | |
728 | 728 | | |
729 | 729 | | |
| |||
0 commit comments