diff -urN fltk-1.3.x-r7709/FL/Fl_Menu_Item.H fltk-1.3.x-r7709_mod/FL/Fl_Menu_Item.H
--- fltk-1.3.x-r7709/FL/Fl_Menu_Item.H	2010-04-16 21:55:45.000000000 +0400
+++ fltk-1.3.x-r7709_mod/FL/Fl_Menu_Item.H	2010-10-01 21:45:20.000000000 +0400
@@ -241,7 +241,7 @@
     and casting the long to a void* and may not be
     portable to some machines.
   */
-  long argument() const {return (long)user_data_;}
+  long argument() const {return (long)(intptr_t)user_data_;}
   /**
     For convenience you can also define the callback as taking a long
     argument.  This is implemented by casting this to a Fl_Callback
diff -urN fltk-1.3.x-r7709/FL/Fl_Widget.H fltk-1.3.x-r7709_mod/FL/Fl_Widget.H
--- fltk-1.3.x-r7709/FL/Fl_Widget.H	2010-07-01 19:01:49.000000000 +0400
+++ fltk-1.3.x-r7709_mod/FL/Fl_Widget.H	2010-10-01 21:48:43.000000000 +0400
@@ -31,6 +31,12 @@
 #ifndef Fl_Widget_H
 #define Fl_Widget_H
 
+#ifdef __GNUC__
+#include <stdint.h>
+#else // MSVC is tested
+#include <stdlib.h>
+#endif
+
 #include "Enumerations.H"
 
 class Fl_Widget;
@@ -596,7 +602,7 @@
 
   /** Gets the current user data (long) argument that is passed to the callback function.
    */
-  long argument() const {return (long)user_data_;}
+  long argument() const {return (long)(intptr_t)user_data_;}
 
   /** Sets the current user data (long) argument that is passed to the callback function.
       \todo The user data value must be implemented using a \em union to avoid 
diff -urN fltk-1.3.x-r7709/fluid/fluid.cxx fltk-1.3.x-r7709_mod/fluid/fluid.cxx
--- fltk-1.3.x-r7709/fluid/fluid.cxx	2010-04-12 09:18:38.000000000 +0400
+++ fltk-1.3.x-r7709_mod/fluid/fluid.cxx	2010-10-01 21:45:20.000000000 +0400
@@ -1977,7 +1977,7 @@
     // don't need theses handles inherited by child process:
     clean_close(pin[0]); clean_close(pout[1]); clean_close(perr[1]);
     HANDLE & h = *mode == 'r' ? pout[0] : pin[1];
-    _fpt = _fdopen(_open_osfhandle((long) h,_O_BINARY),mode);
+    _fpt = _fdopen(_open_osfhandle((intptr_t) h,_O_BINARY),mode);
     h= INVALID_HANDLE_VALUE;  // reset the handle pointer that is shared
     // with _fpt so we don't free it twice
   }
diff -urN fltk-1.3.x-r7709/fluid/Fl_Widget_Type.cxx fltk-1.3.x-r7709_mod/fluid/Fl_Widget_Type.cxx
--- fltk-1.3.x-r7709/fluid/Fl_Widget_Type.cxx	2010-10-01 06:45:57.000000000 +0400
+++ fltk-1.3.x-r7709_mod/fluid/Fl_Widget_Type.cxx	2010-10-01 21:45:20.000000000 +0400
@@ -1133,7 +1133,7 @@
 {0}};
 
 void align_cb(Fl_Button* i, void *v) {
-  Fl_Align b = Fl_Align(long(i->user_data()));
+  Fl_Align b = Fl_Align(intptr_t(i->user_data()));
   if (v == LOAD) {
     if (current_widget->is_menu_item()) {i->deactivate(); return;} else i->activate();
     i->value(current_widget->o->align() & b);
@@ -1181,7 +1181,7 @@
     }
   } else {
     const Fl_Menu_Item *mi = i->menu() + i->value();
-    Fl_Align b = Fl_Align(long(mi->user_data()));
+    Fl_Align b = Fl_Align(intptr_t(mi->user_data()));
     int mod = 0;
     for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
       if (o->selected && o->is_widget()) {
@@ -1210,7 +1210,7 @@
     }
   } else {
     const Fl_Menu_Item *mi = i->menu() + i->value();
-    Fl_Align b = Fl_Align(long(mi->user_data()));
+    Fl_Align b = Fl_Align(intptr_t(mi->user_data()));
     int mod = 0;
     for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
       if (o->selected && o->is_widget()) {
@@ -1302,7 +1302,7 @@
 // "v_attributes" let user type in random code for attribute settings:
 
 void v_input_cb(Fl_Input* i, void* v) {
-  int n = int(long(i->user_data()));
+  int n = int(intptr_t(i->user_data()));
   if (v == LOAD) {
     i->static_value(current_widget->extra_code(n));
   } else {
diff -urN fltk-1.3.x-r7709/src/fl_ask.cxx fltk-1.3.x-r7709_mod/src/fl_ask.cxx
--- fltk-1.3.x-r7709/src/fl_ask.cxx	2010-09-27 15:29:05.000000000 +0400
+++ fltk-1.3.x-r7709_mod/src/fl_ask.cxx	2010-10-01 21:45:20.000000000 +0400
@@ -72,7 +72,7 @@
 // pointer to one of the buttons or an Fl_Window* pointer to the
 // message window (message_form).
 static void button_cb(Fl_Widget *, void *val) {
-  ret_val = (int)(long)val;
+  ret_val = (int)(intptr_t)val;
   message_form->hide();
 }
 
diff -urN fltk-1.3.x-r7709/src/fl_open_uri.cxx fltk-1.3.x-r7709_mod/src/fl_open_uri.cxx
--- fltk-1.3.x-r7709/src/fl_open_uri.cxx	2010-01-01 21:30:49.000000000 +0300
+++ fltk-1.3.x-r7709_mod/src/fl_open_uri.cxx	2010-10-01 21:45:20.000000000 +0400
@@ -124,7 +124,7 @@
 #ifdef WIN32
   if (msg) snprintf(msg, msglen, "open %s", uri);
 
-  return (int)ShellExecute(HWND_DESKTOP, "open", uri, NULL, NULL, SW_SHOW) > 32;
+  return (int)(ShellExecute(HWND_DESKTOP, "open", uri, NULL, NULL, SW_SHOW) > (void*)32);
 
 #elif defined(__APPLE__)
   char	*argv[3];			// Command-line arguments
diff -urN fltk-1.3.x-r7709/test/arc.cxx fltk-1.3.x-r7709_mod/test/arc.cxx
--- fltk-1.3.x-r7709/test/arc.cxx	2009-01-01 19:35:13.000000000 +0300
+++ fltk-1.3.x-r7709_mod/test/arc.cxx	2010-10-01 21:45:20.000000000 +0400
@@ -64,9 +64,9 @@
 
 Drawing *d;
 
-void slider_cb(Fl_Widget* o, void* v) {
+void slider_cb(Fl_Widget* o, long v) {
   Fl_Slider* s = (Fl_Slider*)o;
-  args[long(v)] = s->value();
+  args[v] = s->value();
   d->redraw();
 }
 
@@ -84,7 +84,7 @@
     s->step(1);
     s->value(args[n]);
     s->align(FL_ALIGN_LEFT);
-    s->callback(slider_cb, (void*)n);
+    s->callback(slider_cb, n);
   }
 
   window.end();
diff -urN fltk-1.3.x-r7709/test/cursor.cxx fltk-1.3.x-r7709_mod/test/cursor.cxx
--- fltk-1.3.x-r7709/test/cursor.cxx	2009-04-21 13:09:37.000000000 +0400
+++ fltk-1.3.x-r7709_mod/test/cursor.cxx	2010-10-01 21:45:20.000000000 +0400
@@ -38,8 +38,8 @@
 
 Fl_Hor_Value_Slider *cursor_slider;
 
-void choice_cb(Fl_Widget *, void *v) {
-  cursor = (Fl_Cursor)(long)v;
+void choice_cb(Fl_Widget *, void* v) {
+  cursor = (Fl_Cursor)(intptr_t)v;
   cursor_slider->value(cursor);
   fl_cursor(cursor,fg,bg);
 }
diff -urN fltk-1.3.x-r7709/test/curve.cxx fltk-1.3.x-r7709_mod/test/curve.cxx
--- fltk-1.3.x-r7709/test/curve.cxx	2009-01-01 19:35:13.000000000 +0300
+++ fltk-1.3.x-r7709_mod/test/curve.cxx	2010-10-01 21:45:20.000000000 +0400
@@ -81,9 +81,9 @@
   d->redraw();
 }
 
-void slider_cb(Fl_Widget* o, void* v) {
+void slider_cb(Fl_Widget* o, long v) {
   Fl_Slider* s = (Fl_Slider*)o;
-  args[long(v)] = s->value();
+  args[v] = s->value();
   d->redraw();
 }
 
@@ -100,7 +100,7 @@
     s->step(1);
     s->value(args[n]);
     s->align(FL_ALIGN_LEFT);
-    s->callback(slider_cb, (void*)n);
+    s->callback(slider_cb, n);
   }
   Fl_Toggle_Button but(50,y,50,25,"points");
   but.callback(points_cb);
diff -urN fltk-1.3.x-r7709/test/fractals.cxx fltk-1.3.x-r7709_mod/test/fractals.cxx
--- fltk-1.3.x-r7709/test/fractals.cxx	2009-01-01 19:35:13.000000000 +0300
+++ fltk-1.3.x-r7709_mod/test/fractals.cxx	2010-10-01 21:45:20.000000000 +0400
@@ -768,11 +768,11 @@
 /***************************************************************/
 
 // FLTK-style callbacks to Glut menu callback translators:
-void setlevel(Fl_Widget*, void *value) {setlevel(long(value));}
+void setlevel(Fl_Widget*, void *value) {setlevel(intptr_t(value));}
 
-void choosefract(Fl_Widget*, void *value) {choosefract(long(value));}
+void choosefract(Fl_Widget*, void *value) {choosefract(intptr_t(value));}
 
-void handlemenu(Fl_Widget*, void *value) {handlemenu(long(value));}
+void handlemenu(Fl_Widget*, void *value) {handlemenu(intptr_t(value));}
 
 #include <FL/Fl_Button.H>
 #include <FL/Fl_Group.H>
diff -urN fltk-1.3.x-r7709/test/input.cxx fltk-1.3.x-r7709_mod/test/input.cxx
--- fltk-1.3.x-r7709/test/input.cxx	2009-04-23 19:32:19.000000000 +0400
+++ fltk-1.3.x-r7709_mod/test/input.cxx	2010-10-01 21:45:20.000000000 +0400
@@ -63,9 +63,9 @@
   for (int i=0; i<5; i++) test(input[i]);
 }
 
-void color_cb(Fl_Widget* button, void* v) {
+void color_cb(Fl_Widget* button, long v) {
   Fl_Color c;
-  switch ((long)v) {
+  switch (v) {
   case 0: c = FL_BACKGROUND2_COLOR; break;
   case 1: c = FL_SELECTION_COLOR; break;
   default: c = FL_FOREGROUND_COLOR; break;
@@ -127,14 +127,14 @@
   b->tooltip("Print widgets that have changed() flag set");
 
   b = new Fl_Button(220,y1,100,25,"color"); y1 += 25;
-  b->color(input[0]->color()); b->callback(color_cb, (void*)0);
+  b->color(input[0]->color()); b->callback(color_cb, 0);
   b->tooltip("Color behind the text");
   b = new Fl_Button(220,y1,100,25,"selection_color"); y1 += 25;
-  b->color(input[0]->selection_color()); b->callback(color_cb, (void*)1);
+  b->color(input[0]->selection_color()); b->callback(color_cb, 1);
   b->labelcolor(fl_contrast(FL_BLACK,b->color()));
   b->tooltip("Color behind selected text");
   b = new Fl_Button(220,y1,100,25,"textcolor"); y1 += 25;
-  b->color(input[0]->textcolor()); b->callback(color_cb, (void*)2);
+  b->color(input[0]->textcolor()); b->callback(color_cb, 2);
   b->labelcolor(fl_contrast(FL_BLACK,b->color()));
   b->tooltip("Color of the text");
 
diff -urN fltk-1.3.x-r7709/test/keyboard.cxx fltk-1.3.x-r7709_mod/test/keyboard.cxx
--- fltk-1.3.x-r7709/test/keyboard.cxx	2009-04-21 13:09:37.000000000 +0400
+++ fltk-1.3.x-r7709_mod/test/keyboard.cxx	2010-10-01 21:45:20.000000000 +0400
@@ -109,14 +109,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)
diff -urN fltk-1.3.x-r7709/test/line_style.cxx fltk-1.3.x-r7709_mod/test/line_style.cxx
--- fltk-1.3.x-r7709/test/line_style.cxx	2009-04-21 13:09:37.000000000 +0400
+++ fltk-1.3.x-r7709_mod/test/line_style.cxx	2010-10-01 21:45:20.000000000 +0400
@@ -57,10 +57,10 @@
   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()),
-    (long)(sliders[3]->value()),
+    (intptr_t)(choice[0]->mvalue()->user_data()) +
+    (intptr_t)(choice[1]->mvalue()->user_data()) +
+    (intptr_t)(choice[2]->mvalue()->user_data()),
+    (intptr_t)(sliders[3]->value()),
     buf);
   
   // draw the defined fl_rect and fl_vertex first and then
diff -urN fltk-1.3.x-r7709/test/scroll.cxx fltk-1.3.x-r7709_mod/test/scroll.cxx
--- fltk-1.3.x-r7709/test/scroll.cxx	2009-01-01 19:35:13.000000000 +0300
+++ fltk-1.3.x-r7709_mod/test/scroll.cxx	2010-10-01 21:45:20.000000000 +0400
@@ -71,7 +71,7 @@
 }
 
 void type_cb(Fl_Widget*, void* v) {
-  thescroll->type((uchar)((long)v));
+  thescroll->type((uchar)(intptr_t)(v));
   thescroll->redraw();
 }
 
@@ -87,7 +87,7 @@
 };
 
 void align_cb(Fl_Widget*, void* v) {
-  thescroll->scrollbar.align((uchar)((long)v));
+  thescroll->scrollbar.align((uchar)((intptr_t)v));
   thescroll->redraw();
 }
 
diff -urN fltk-1.3.x-r7709/test/table.cxx fltk-1.3.x-r7709_mod/test/table.cxx
--- fltk-1.3.x-r7709/test/table.cxx	2010-01-23 16:48:50.000000000 +0300
+++ fltk-1.3.x-r7709_mod/test/table.cxx	2010-10-01 21:45:20.000000000 +0400
@@ -273,19 +273,19 @@
 
 void tablebox_choice_cb(Fl_Widget *w, void *data)
 {
-    G_table->table_box((Fl_Boxtype)(long)data);
+    G_table->table_box((Fl_Boxtype)(intptr_t)data);
     G_table->redraw();
 }
 
 void widgetbox_choice_cb(Fl_Widget *w, void *data)
 {
-    G_table->box((Fl_Boxtype)(long)data);
+    G_table->box((Fl_Boxtype)(intptr_t)data);
     G_table->resize(G_table->x(), G_table->y(), G_table->w(), G_table->h());
 }
 
 void type_choice_cb(Fl_Widget *w, void *data)
 {
-    G_table->type((Fl_Table_Row::TableRowSelectMode)(long)data);
+    G_table->type((Fl_Table_Row::TableRowSelectMode)(intptr_t)data);
 }
 
 Fl_Menu_Item tablebox_choices[] = {
