Skip to content

Commit 048bb51

Browse files
author
dejan
committed
This commit contains:
- A fix for filename_list() function in filename_list.cxx . On GNU/Linux sort should be casted to proper type. - Fix for image_transform.cxx demo application which makes it ready fro successfull build - after Bill's change, as he suggested, I had to cast object of Widget type in order to get value. git-svn-id: http://seriss.com/public/fltk/fltk/trunk@4849 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
1 parent 8a6612b commit 048bb51

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

src/filename_list.cxx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
// a "user friendly" sorting function that puts numbered files into the
2828
// order the user expects.
2929

30-
#include <config.h>
31-
#include <fltk/filename.h>
32-
#include <fltk/string.h>
33-
#include <fltk/utf.h>
30+
#include "../config.h"
3431
#include <ctype.h>
3532
#include <string.h>
3633
#include <stdio.h>
34+
#include <fltk/string.h>
35+
#include <fltk/utf.h>
36+
#include <fltk/filename.h>
3737

3838
#if ! HAVE_SCANDIR
3939
int scandir (const char *dir, dirent ***namelist,
@@ -56,8 +56,10 @@ int fltk::filename_list(const char *d, dirent ***list,
5656
// do this even for our own internal version because some compilers
5757
// will not cast it to the non-const version! Egad. So we have to
5858
// use if's to go to what the various systems use:
59-
#if HAVE_SCANDIR && !defined(__APPLE__)
59+
#if HAVE_SCANDIR && !defined(__APPLE__) && !defined(__linux)
6060
int n = scandir(d, list, 0, sort);
61+
#elif HAVE_SCANDIR && defined(__linux)
62+
int n = scandir(d, list, 0, (int(*)(const void*,const void*))sort);
6163
#elif defined(__hpux) || defined(__CYGWIN__)
6264
// HP-UX, Cygwin define the comparison function like this:
6365
int n = scandir(d, list, 0, (int(*)(const dirent **, const dirent **))sort);

src/scandir.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ linking) can be used on all such machines.
2626
2727
*/
2828

29-
#include <config.h>
29+
#include "../config.h"
3030
#if ! HAVE_SCANDIR
3131
# if defined(_WIN32) && !defined(__CYGWIN__)
3232
# include "win32/scandir.cxx"

test/image_transform.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ void noalpha_cb(Widget* o, void*) {
8888
}
8989

9090
void alpha_cb(Widget* o, void*) {
91-
alpha = o->value(); image = false;
91+
92+
alpha = reinterpret_cast<Button*>(o)->value(); image = false;
9293
d->redraw();
9394
}
9495

0 commit comments

Comments
 (0)