Fixed a few warnings from a picky compiler setting.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11086 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
8717f1b252
commit
40e9ae6e61
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user