File fltk-1.1.10-intptr_t.patch of Package fltk
--- test/cursor.cxx
+++ test/cursor.cxx
@@ -25,6 +25,8 @@
// http://www.fltk.org/str.php
//
+#include <inttypes.h>
+
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Hor_Value_Slider.H>
@@ -39,7 +41,7 @@
Fl_Hor_Value_Slider *cursor_slider;
void choice_cb(Fl_Widget *, void *v) {
- cursor = (Fl_Cursor)(long)v;
+ cursor = (Fl_Cursor)(intptr_t)v;
cursor_slider->value(cursor);
fl_cursor(cursor,fg,bg);
}
--- test/input.cxx
+++ test/input.cxx
@@ -26,6 +26,7 @@
//
#include <stdio.h>
+#include <inttypes.h>
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Input.H>
@@ -61,7 +62,7 @@
void color_cb(Fl_Widget* button, void* v) {
Fl_Color c;
- switch ((long)v) {
+ switch ((intptr_t)v) {
case 0: c = FL_BACKGROUND2_COLOR; break;
case 1: c = FL_SELECTION_COLOR; break;
default: c = FL_FOREGROUND_COLOR; break;
--- test/keyboard.cxx
+++ test/keyboard.cxx
@@ -40,6 +40,7 @@
//
+#include <inttypes.h>
#include "keyboard_ui.h"
#include <string.h>
@@ -109,14 +110,14 @@
for (int i = 0; i < window->children(); i++) {
Fl_Widget* b = window->child(i);
if (b->callback() == (Fl_Callback*)key_cb) {
- int i = (long)b->user_data();
+ int i = (intptr_t)b->user_data();
if (!i) i = b->label()[0];
Fl_Button *btn = ((Fl_Button*)b);
int state = Fl::event_key(i);
if (btn->value()!=state)
btn->value(state);
} else if (b->callback() == (Fl_Callback*)shift_cb) {
- int i = (long)b->user_data();
+ int i = (intptr_t)b->user_data();
Fl_Button *btn = ((Fl_Button*)b);
int state = Fl::event_state(i);
if (btn->value()!=state)
--- test/line_style.cxx
+++ test/line_style.cxx
@@ -25,6 +25,7 @@
// http://www.fltk.org/str.php
//
+#include <inttypes.h>
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Value_Slider.H>
@@ -54,9 +55,9 @@
buf[3] = char(sliders[7]->value());
buf[4] = 0;
fl_line_style(
- (long)(choice[0]->mvalue()->user_data()) +
- (long)(choice[1]->mvalue()->user_data()) +
- (long)(choice[2]->mvalue()->user_data()),
+ (intptr_t)(choice[0]->mvalue()->user_data()) +
+ (intptr_t)(choice[1]->mvalue()->user_data()) +
+ (intptr_t)(choice[2]->mvalue()->user_data()),
(long)(sliders[3]->value()),
buf);
fl_rect(10,10,w()-20,h()-20);
--- test/scroll.cxx
+++ test/scroll.cxx
@@ -25,6 +25,7 @@
// http://www.fltk.org/str.php
//
+#include <inttypes.h>
#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Scroll.H>