summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Fl_Copy_Surface.cxx6
-rw-r--r--src/Fl_Image.cxx28
-rw-r--r--src/Fl_Native_File_Chooser_WIN32.cxx1
-rw-r--r--src/Fl_win32.cxx6
4 files changed, 21 insertions, 20 deletions
diff --git a/src/Fl_Copy_Surface.cxx b/src/Fl_Copy_Surface.cxx
index 53fcc1460..716aacfdc 100644
--- a/src/Fl_Copy_Surface.cxx
+++ b/src/Fl_Copy_Surface.cxx
@@ -88,10 +88,10 @@ Fl_Copy_Surface::Fl_Copy_Surface(int w, int h) : Fl_Surface_Device(NULL)
int vmm = GetDeviceCaps(hdc, VERTSIZE);
int vdots = GetDeviceCaps(hdc, VERTRES);
ReleaseDC(NULL, hdc);
- float factorw = (100. * hmm) / hdots;
- float factorh = (100. * vmm) / vdots;
+ float factorw = (100.f * hmm) / hdots;
+ float factorh = (100.f * vmm) / vdots;
- RECT rect; rect.left = 0; rect.top = 0; rect.right = w * factorw; rect.bottom = h * factorh;
+ RECT rect; rect.left = 0; rect.top = 0; rect.right = (LONG)(w * factorw); rect.bottom = (LONG)(h * factorh);
gc = CreateEnhMetaFile (NULL, NULL, &rect, NULL);
if (gc != NULL) {
SetTextAlign(gc, TA_BASELINE|TA_LEFT);
diff --git a/src/Fl_Image.cxx b/src/Fl_Image.cxx
index 32b2de609..2bad72c85 100644
--- a/src/Fl_Image.cxx
+++ b/src/Fl_Image.cxx
@@ -428,7 +428,7 @@ Fl_Image *Fl_RGB_Image::copy(int W, int H) {
for (dy = 0; dy < H; dy++) {
float oldy = dy * yscale;
if (oldy >= h())
- oldy = h() - 1;
+ oldy = (float)(h() - 1);
const float yfract = oldy - (unsigned) oldy;
for (dx = 0; dx < W; dx++) {
@@ -436,17 +436,17 @@ Fl_Image *Fl_RGB_Image::copy(int W, int H) {
float oldx = dx * xscale;
if (oldx >= w())
- oldx = w() - 1;
+ oldx = (float)(w() - 1);
const float xfract = oldx - (unsigned) oldx;
- const unsigned leftx = oldx;
- const unsigned lefty = oldy;
- const unsigned rightx = oldx + 1 >= w() ? oldx : oldx + 1;
- const unsigned righty = oldy;
- const unsigned dleftx = oldx;
- const unsigned dlefty = oldy + 1 >= h() ? oldy : oldy + 1;
- const unsigned drightx = rightx;
- const unsigned drighty = dlefty;
+ const unsigned leftx = (unsigned)oldx;
+ const unsigned lefty = (unsigned)oldy;
+ const unsigned rightx = (unsigned)(oldx + 1 >= w() ? oldx : oldx + 1);
+ const unsigned righty = (unsigned)oldy;
+ const unsigned dleftx = (unsigned)oldx;
+ const unsigned dlefty = (unsigned)(oldy + 1 >= h() ? oldy : oldy + 1);
+ const unsigned drightx = (unsigned)rightx;
+ const unsigned drighty = (unsigned)dlefty;
uchar left[4], right[4], downleft[4], downright[4];
memcpy(left, array + lefty * line_d + leftx * d(), d());
@@ -457,10 +457,10 @@ Fl_Image *Fl_RGB_Image::copy(int W, int H) {
int i;
if (d() == 4) {
for (i = 0; i < 3; i++) {
- left[i] *= left[3] / 255.0f;
- right[i] *= right[3] / 255.0f;
- downleft[i] *= downleft[3] / 255.0f;
- downright[i] *= downright[3] / 255.0f;
+ left[i] = (uchar)(left[i] * left[3] / 255.0f);
+ right[i] = (uchar)(right[i] * right[3] / 255.0f);
+ downleft[i] = (uchar)(downleft[i] * downleft[3] / 255.0f);
+ downright[i] = (uchar)(downright[i] * downright[3] / 255.0f);
}
}
diff --git a/src/Fl_Native_File_Chooser_WIN32.cxx b/src/Fl_Native_File_Chooser_WIN32.cxx
index 560dc8002..4c38db6a8 100644
--- a/src/Fl_Native_File_Chooser_WIN32.cxx
+++ b/src/Fl_Native_File_Chooser_WIN32.cxx
@@ -140,6 +140,7 @@ Fl_Native_File_Chooser::Fl_Native_File_Chooser(int val) {
memset((void*)_ofn_ptr, 0, sizeof(OPENFILENAMEW));
_ofn_ptr->lStructSize = sizeof(OPENFILENAMEW);
_ofn_ptr->hwndOwner = NULL;
+ _ofn_ptr.hwndOwner = 0L;
memset((void*)_binf_ptr, 0, sizeof(BROWSEINFOW));
_pathnames = NULL;
_tpathnames = 0;
diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx
index c96c5335a..10e8141da 100644
--- a/src/Fl_win32.cxx
+++ b/src/Fl_win32.cxx
@@ -787,9 +787,9 @@ void Fl::paste(Fl_Widget &receiver, int clipboard, const char *type) {
int vmm = GetDeviceCaps(hdc, VERTSIZE);
int vdots = GetDeviceCaps(hdc, VERTRES);
ReleaseDC(NULL, hdc);
- float factorw = (100. * hmm) / hdots;
- float factorh = (100. * vmm) / vdots + 0.5;
- width /= factorw; height /= factorh; // convert to screen pixel unit
+ float factorw = (100.f * hmm) / hdots;
+ float factorh = (100.f * vmm) / vdots + 0.5f;
+ width = (int)(width/factorw); height = (int)(height/factorh); // convert to screen pixel unit
RECT rect = {0, 0, width, height};
Fl_Offscreen off = fl_create_offscreen(width, height);
fl_begin_offscreen(off);