Author: fabien
Date: 2008-02-20 16:43:54 -0800 (Wed, 20 Feb 2008)
New Revision: 6038
Log:
Various fixes after recent (and non recent) modifications leading to a broken
win32/VC6 version.
Now compiling and running again under VC6
Jesus, this fltk2 is again full of bug, guys try to check more your
modifications impact on other platforms, especially when committing huge
changes...
Modified:
trunk/fltk/filename.h
trunk/src/Widget.cxx
trunk/src/filename_isdir.cxx
trunk/src/win32/run.cxx
trunk/test/mandelbrot.cxx
Modified: trunk/fltk/filename.h
===================================================================
--- trunk/fltk/filename.h 2008-02-20 18:55:36 UTC (rev 6037)
+++ trunk/fltk/filename.h 2008-02-21 00:43:54 UTC (rev 6038)
@@ -34,6 +34,16 @@
#ifndef DOXYGEN
// dirent (what a pain)...
+// FC: UNDER WIN32/VC6 long long is undefined, so use __int64 instead
+// for cross platform type compatibility though in fact VC6 uses
+// a 32 bit long to calculate size in the stat struct so don't expect
+// to handle >4GB files here...
+#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__MINGW32__) &&
(_MSC_VER==1200)
+typedef unsigned __int64 FL_FILESIZE_T;
+#else
+typedef unsigned long long FL_FILESIZE_T;
+#endif
+
#if defined(__WATCOMC__)
# include <sys/types.h>
@@ -96,7 +106,7 @@
FL_API bool filename_match(const char *, const char *pattern); // glob match
FL_API bool filename_exist(const char*);
FL_API bool filename_isdir(const char*);
-FL_API long long unsigned filename_size(const char *); // return size of file
+FL_API FL_FILESIZE_T filename_size(const char *); // return size of file
FL_API long int filename_mtime(const char *); // return modification time
typedef int (File_Sort_F)(const dirent*const*, const dirent*const*);
Modified: trunk/src/Widget.cxx
===================================================================
--- trunk/src/Widget.cxx 2008-02-20 18:55:36 UTC (rev 6037)
+++ trunk/src/Widget.cxx 2008-02-21 00:43:54 UTC (rev 6038)
@@ -1053,12 +1053,13 @@
set();
Group* g = parent();
int my_index = g->find( this );
- for( int i = my_index-1; i >= 0; --i ) {
+ int i;
+ for(i = my_index-1; i >= 0; --i ) {
Widget* c = g->child(i);
if( RADIO != c->type() ) break;
c->clear();
}
- for( int i = my_index+1; i < g->children(); ++i ) {
+ for(i = my_index+1; i < g->children(); ++i ) {
Widget* c = g->child(i);
if( RADIO != c->type() ) break;
c->clear();
Modified: trunk/src/filename_isdir.cxx
===================================================================
--- trunk/src/filename_isdir.cxx 2008-02-20 18:55:36 UTC (rev 6037)
+++ trunk/src/filename_isdir.cxx 2008-02-21 00:43:54 UTC (rev 6038)
@@ -72,9 +72,9 @@
}
/** Returns the size of the file in bytes. Returns zero if it does not exist.*/
-unsigned long long fltk::filename_size(const char* name) {
+FL_FILESIZE_T fltk::filename_size(const char* name) {
if (!fill_stat(name)) return 0;
- return (unsigned long long)last_stat.st_size;
+ return (FL_FILESIZE_T)last_stat.st_size;
}
/**
Modified: trunk/src/win32/run.cxx
===================================================================
--- trunk/src/win32/run.cxx 2008-02-20 18:55:36 UTC (rev 6037)
+++ trunk/src/win32/run.cxx 2008-02-21 00:43:54 UTC (rev 6038)
@@ -675,7 +675,7 @@
}
bool fltk::warp_mouse(int x, int y) {
- return SetCursorPos(x, y);
+ return SetCursorPos(x, y) ? true : false;
}
////////////////////////////////////////////////////////////////
Modified: trunk/test/mandelbrot.cxx
===================================================================
--- trunk/test/mandelbrot.cxx 2008-02-20 18:55:36 UTC (rev 6037)
+++ trunk/test/mandelbrot.cxx 2008-02-21 00:43:54 UTC (rev 6038)
@@ -223,7 +223,7 @@
delete[] buffer; buffer = 0; new_display();
}
}
- fltk::Widget::layout();
+ Widget::layout();
}
//
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit