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
This commit is contained in:
Albrecht Schlosser 2016-04-05 20:35:29 +00:00
parent b4a28580b0
commit d2a6ac8b6b
3 changed files with 7 additions and 7 deletions

View File

@ -8,7 +8,7 @@
#include <FL/Fl.H>
#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..
//////////////////////////

View File

@ -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;

View File

@ -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