summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2025-03-30 00:38:10 +0100
committerMatthias Melcher <github@matthiasm.com>2025-03-30 00:38:10 +0100
commitbd9d1bc03809586d81a547a7a8acce903482910b (patch)
tree4b7fd3f97b41669c2b2e399fe6bd5365989697cf
parentb2b5e47ede75f0b3df06ed28537b459d79b9f867 (diff)
Fixes a couple of compiler warnings on AppleClang.
-rw-r--r--fluid/CMakeLists.txt13
-rw-r--r--src/Fl_Screen_Driver.cxx4
-rw-r--r--src/Fl_cocoa.mm12
3 files changed, 8 insertions, 21 deletions
diff --git a/fluid/CMakeLists.txt b/fluid/CMakeLists.txt
index bb28c2b9a..d1900b297 100644
--- a/fluid/CMakeLists.txt
+++ b/fluid/CMakeLists.txt
@@ -255,16 +255,3 @@ if(UNIX)
)
endforeach()
endif(UNIX)
-
-# Additional warnings during development
-
-if(APPLE)
- if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
- target_compile_options(fluid-lib PRIVATE
- -Wall -Wextra -Wpedantic -Werror
- -Wno-zero-as-null-pointer-constant
- -Wno-missing-field-initializers
- -Wno-unused-parameter
- )
- endif()
-endif(APPLE)
diff --git a/src/Fl_Screen_Driver.cxx b/src/Fl_Screen_Driver.cxx
index 05461a2a1..d7a794726 100644
--- a/src/Fl_Screen_Driver.cxx
+++ b/src/Fl_Screen_Driver.cxx
@@ -385,7 +385,7 @@ void Fl_Screen_Driver::rescale_all_windows_from_screen(int screen, float f, floa
Fl_Window *win = Fl::first_window();
while (win) {
if (!win->parent() && (Fl_Window_Driver::driver(win)->screen_num() == screen) &&
- win->user_data() != &Fl_Screen_Driver::transient_scale_display) {
+ win->user_data() != (void*)&Fl_Screen_Driver::transient_scale_display) {
count++;
}
win = Fl::next_window(win);
@@ -396,7 +396,7 @@ void Fl_Screen_Driver::rescale_all_windows_from_screen(int screen, float f, floa
win = Fl::first_window(); // memorize all top-level windows
while (win) {
if (!win->parent() && (Fl_Window_Driver::driver(win)->screen_num() == screen) &&
- win->user_data() != &Fl_Screen_Driver::transient_scale_display) {
+ win->user_data() != (void*)&Fl_Screen_Driver::transient_scale_display) {
win_array[i++] = win;
}
win = Fl::next_window(win);
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 468c4b0d0..1e3e68637 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -686,7 +686,7 @@ void Fl_Cocoa_Screen_Driver::breakMacEventLoop()
}
return self;
}
-- (Fl_Window *)getFl_Window;
+- (Fl_Window *)getFl_Window
{
return w;
}
@@ -1525,13 +1525,13 @@ static FLWindowDelegate *flwindowdelegate_instance = nil;
Fl::handle(FL_HIDE, window);
fl_unlock_function();
}
-- (void)windowWillEnterFullScreen:(NSNotification *)notif;
+- (void)windowWillEnterFullScreen:(NSNotification *)notif
{
FLWindow *nsw = (FLWindow*)[notif object];
Fl_Window *window = [nsw getFl_Window];
window->_set_fullscreen();
}
-- (void)windowWillExitFullScreen:(NSNotification *)notif;
+- (void)windowWillExitFullScreen:(NSNotification *)notif
{
FLWindow *nsw = (FLWindow*)[notif object];
Fl_Window *window = [nsw getFl_Window];
@@ -3251,7 +3251,7 @@ void Fl_Cocoa_Window_Driver::makeWindow()
w->set_visible();
if ( w->border() || (!w->modal() && !w->tooltip_window() &&
- w->user_data() != &Fl_Screen_Driver::transient_scale_display) ) Fl::handle(FL_FOCUS, w);
+ w->user_data() != (void*)&Fl_Screen_Driver::transient_scale_display) ) Fl::handle(FL_FOCUS, w);
[cw setDelegate:[FLWindowDelegate singleInstance]];
if (show_iconic()) {
show_iconic(0);
@@ -4747,7 +4747,7 @@ static CGImageRef capture_decorated_window_SCK(NSWindow *nswin) {
}
win = Fl::next_window(win);
}
- CGWindowID target_id = [nswin windowNumber];
+ CGWindowID target_id = (CGWindowID)[nswin windowNumber];
NSRect r = [nswin frame];
int W = r.size.width, H = r.size.height;
[SCShareableContent getCurrentProcessShareableContentWithCompletionHandler: // macOS 14.4
@@ -4791,7 +4791,7 @@ static CGImageRef capture_decorated_window_SCK(NSWindow *nswin) {
while (!capture_err && !capture) CFRunLoopRun();
if (capture_err) return NULL;
// ScreenCaptureKit bug cont'd: restore modified styleMasks.
- for (int i = 0, count = [xid_array count]; i < count; i++) {
+ for (int i = 0, count = (int)[xid_array count]; i < count; i++) {
NSUInteger mask;
[(NSData*)[mask_array objectAtIndex:i] getBytes:&mask length:sizeof(NSUInteger)];
NSWindow *xid = (NSWindow*)[xid_array objectAtIndex:i];