From d2a6ac8b6bc7aac7ee8d280210287b0583ad9883 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Tue, 5 Apr 2016 20:35:29 +0000 Subject: [PATCH] Fix compiler warnings found with gcc 4.0.4. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@11534 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/Fl_Tree_Item_Array.H | 2 +- test/animated.cxx | 10 +++++----- test/pixmap_browser.cxx | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/FL/Fl_Tree_Item_Array.H b/FL/Fl_Tree_Item_Array.H index f876458cb..786dce84c 100644 --- a/FL/Fl_Tree_Item_Array.H +++ b/FL/Fl_Tree_Item_Array.H @@ -8,7 +8,7 @@ #include #include "Fl_Export.H" -class FL_EXPORT Fl_Tree_Item; // forward decl must *precede* first doxygen comment block +class Fl_Tree_Item; // forward decl must *precede* first doxygen comment block // or doxygen will not document our class.. ////////////////////////// diff --git a/test/animated.cxx b/test/animated.cxx index 961a10099..10a3f7dac 100644 --- a/test/animated.cxx +++ b/test/animated.cxx @@ -55,9 +55,9 @@ static void make_images() { // A fading sphere uchar alpha = 255; if (i < FRAMES / 2) - alpha = 255 * (i / ((float) FRAMES / 2)); + alpha = (uchar)(255 * (i / ((float) FRAMES / 2))); else - alpha = 255 * (((FRAMES / 2) - (i - FRAMES / 2)) / ((float) FRAMES / 2)); + alpha = (uchar)(255 * (((FRAMES / 2) - (i - FRAMES / 2)) / ((float) FRAMES / 2))); const int spherew = 60; const int spherex = (DIM - spherew) / 2; @@ -73,11 +73,11 @@ static void make_images() { continue; const float fill = dist / maxdist; - const uchar grey = fill * 255; + const uchar grey = (uchar)(fill * 255); uchar myalpha = alpha; if (fill > 0.9) - myalpha *= (1.0f - fill) * 10; + myalpha = (uchar)(myalpha * (1.0f - fill) * 10); data[y * DIM * 4 + x * 4 + 0] = grey; data[y * DIM * 4 + x * 4 + 1] = grey; @@ -89,7 +89,7 @@ static void make_images() { // A moving blob const float pos = (i / (float) FRAMES) * 2 - 0.5; - const int xoffset = pos * DIM; + const int xoffset = (int)(pos * DIM); const int yoffset = 2 * DIM / 3; const int w = DIM / 4; diff --git a/test/pixmap_browser.cxx b/test/pixmap_browser.cxx index c226e4bcf..89b498105 100644 --- a/test/pixmap_browser.cxx +++ b/test/pixmap_browser.cxx @@ -69,7 +69,7 @@ void load_file(const char *n) { float fw = img->w() / float(b->w()); float fh = img->h() / float(b->h()); float f = fw > fh ? fw : fh; - b->image(img->copy(img->w()/f, img->h()/f)); + b->image(img->copy(int(img->w()/f), int(img->h()/f))); img->release(); } #endif