From 633d7c2c5f053241665754957a23a543772b0ec9 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Thu, 11 Aug 2016 12:37:30 +0000 Subject: [PATCH] Fix one compiler warning and one error on Windows 64-bit. These warnings and errors were found using gcc 6.1 (64-bit) under Windows. The error in examples/howto-add_fd-and-popen.cxx (-fpermissive) is due to the wrong definition of Fl_FD_Handler under Windows 64-bit (FL_SOCKET!). This should really be fixed in a better way in FLTK 1.4. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@11870 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- examples/howto-add_fd-and-popen.cxx | 4 +++- examples/tree-custom-sort.cxx | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/howto-add_fd-and-popen.cxx b/examples/howto-add_fd-and-popen.cxx index a8247c37f..0131f4018 100644 --- a/examples/howto-add_fd-and-popen.cxx +++ b/examples/howto-add_fd-and-popen.cxx @@ -44,7 +44,9 @@ FILE *G_fp = NULL; // Handler for add_fd() -- called whenever the ping command outputs a new line of data -void HandleFD(int fd, void *data) { +// Note: FL_SOCKET as 1st argument is used to fix a compiler error(!) on Windows 64-bit. +// Unfortunately we need this in FLTK 1.3 - should hopefully be fixed in 1.4 with a better solution. +void HandleFD(FL_SOCKET fd, void *data) { Fl_Multi_Browser *brow = (Fl_Multi_Browser*)data; char s[1024]; if ( fgets(s, 1023, G_fp) == NULL ) { // read the line of data diff --git a/examples/tree-custom-sort.cxx b/examples/tree-custom-sort.cxx index 40571f513..5f14946ee 100644 --- a/examples/tree-custom-sort.cxx +++ b/examples/tree-custom-sort.cxx @@ -29,7 +29,7 @@ Fl_Tree *G_tree = 0; // Resort the tree void MySortCallback(Fl_Widget*, void *data) { - int dir = int(long(data)); // forward or reverse + int dir = int(fl_intptr_t(data)); // forward or reverse Fl_Tree_Item *i = G_tree->root(); // Bubble sort for ( int ax=0; axchildren(); ax++ ) {