From 9d9646fb124aee9255a6bc11a7af65bc54e94fb6 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Thu, 4 Apr 2024 23:40:29 +0200 Subject: [PATCH] Fix compiler warning, part 2 of #946 --- FL/Fl_Menu_Item.H | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/FL/Fl_Menu_Item.H b/FL/Fl_Menu_Item.H index 94035d097..a4f760645 100644 --- a/FL/Fl_Menu_Item.H +++ b/FL/Fl_Menu_Item.H @@ -1,7 +1,7 @@ // // Menu item header file for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2022 by Bill Spitzak and others. +// Copyright 1998-2024 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -318,7 +318,9 @@ struct FL_EXPORT Fl_Menu_Item { This method does not set the userdata() argument. \see Fl_Callback_p Fl_MenuItem::callback() const */ - void callback(Fl_Callback0*c) {callback_=(Fl_Callback*)c;} + void callback(Fl_Callback0 *c) { + callback_ = (Fl_Callback *)(void *)c; + } /** Sets the menu item's callback function and userdata() argument. @@ -326,7 +328,10 @@ struct FL_EXPORT Fl_Menu_Item { for the menu item's callback function. \see Fl_Callback_p Fl_MenuItem::callback() const */ - void callback(Fl_Callback1*c, long p=0) {callback_=(Fl_Callback*)c; user_data_=(void*)(fl_intptr_t)p;} + void callback(Fl_Callback1 *c, long p = 0) { + callback_ = (Fl_Callback *)(void *)c; + user_data_ = (void *)(fl_intptr_t)p; + } /** Gets the user_data() argument that is sent to the callback function.