FLTK logo

STR #3283

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Return to Bugs & Features | Roadmap 1.3 | SVN ⇄ GIT ]

STR #3283

Application:FLTK Library
Status:1 - Closed w/Resolution
Priority:3 - Moderate, e.g. unable to compile the software
Scope:2 - Specific to an operating system
Subsystem:Core Library
Summary:Long should be changed to void*
Version:1.3-current
Created By:smasherprog
Assigned To:AlbrechtS
Fix Version:1.3.4
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

No files


Trouble Report Comments:


Name/Time/Date Text  
 
#1 smasherprog
05:31 Feb 01, 2016
File FL\Widget.h Line 848

  void do_callback(Fl_Widget* o,long arg) {do_callback(o, arg);}
Should be
  void do_callback(Fl_Widget* o,void* arg) {do_callback(o, arg);}

MSVC compiles long as 32 bits, which will cause errors if arg is a pointer type. Also, the type is cast to a void* anyway

FL\Widget.h line 576

  void callback(Fl_Callback1*cb, long p=0) {callback_=(Fl_Callback*)cb; user_data_=(void*)p;}

  void callback(Fl_Callback1*cb, void* p=0) {callback_=(Fl_Callback*)cb; user_data_=(void*)p;}

FL\Widget.h line 598
  void argument(long v) {user_data_ = (void*)v;}
Should be  
void argument(void* v) {user_data_ = v;}

FL\FL_Menu_Item.h
line 243
  void callback(Fl_Callback1*c, long p=0) {callback_=(Fl_Callback*)c; user_data_=(void*)p;}
Should be
  void callback(Fl_Callback1*c, void* p=0) {callback_ (Fl_Callback*)c; user_data_=p;}

Same for FL\FL_Menu_Item.h

  void argument(long v) {user_data_ = (void*)v;}
  void do_callback(Fl_Widget* o,long arg) const {callback_(o, (void*)arg);}
 
 
#2 smasherprog
05:35 Feb 01, 2016
Just realized, these functions already exist.

My proposed solution is to use size_t instead of void*
This way, casts wont throw warnings.
 
 
#3 AlbrechtS
10:36 Feb 01, 2016
Thanks for the report.

These issues are fixed in our subversion repository. Please try the subversion (svn) download, or use a recent snapshot (see download page). FLTK 1.3.4 will be released soon.

Please report if you still see these warnings (you shouldn't).

We need both versions and in particular the one with 'long' arguments for backwards compatibility. We used similar casts with (fl_)intptr_t.
 
 
#4 AlbrechtS
07:35 Feb 29, 2016
This STR has not been updated by the submitter for two or more weeks and has been closed as required by the FLTK Configuration Management Plan. If the issue still requires resolution, please re-submit a new STR.  
     

Return to Bugs & Features ]

 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.