summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Fl_Graphics_Driver.cxx10
-rw-r--r--src/Fl_Text_Display.cxx4
-rw-r--r--src/drivers/Android/Fl_Android_Window_Driver.cxx8
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx6
-rw-r--r--src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_rect.cxx4
-rw-r--r--src/drivers/Pico/Fl_Pico_Graphics_Driver.cxx3
-rw-r--r--src/drivers/PostScript/Fl_PostScript.cxx24
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx5
-rw-r--r--src/drivers/X11/Fl_X11_Window_Driver.cxx5
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx6
-rw-r--r--src/gl_start.cxx4
11 files changed, 45 insertions, 34 deletions
diff --git a/src/Fl_Graphics_Driver.cxx b/src/Fl_Graphics_Driver.cxx
index b6781914e..6eb670348 100644
--- a/src/Fl_Graphics_Driver.cxx
+++ b/src/Fl_Graphics_Driver.cxx
@@ -3,7 +3,7 @@
//
// Fl_Graphics_Driver class for the Fast Light Tool Kit (FLTK).
//
-// Copyright 2010-2018 by Bill Spitzak and others.
+// Copyright 2010-2020 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -463,7 +463,13 @@ void Fl_Graphics_Driver::polygon(int x0, int y0, int x1, int y1, int x2, int y2)
void Fl_Graphics_Driver::push_clip(int x, int y, int w, int h) {}
/** see fl_clip_box() */
-int Fl_Graphics_Driver::clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H) {return 0;}
+int Fl_Graphics_Driver::clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H) {
+ X = x;
+ Y = y;
+ W = w;
+ H = h;
+ return 0; // completely inside
+}
/** see fl_not_clipped() */
int Fl_Graphics_Driver::not_clipped(int x, int y, int w, int h) {return 1;}
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx
index 55cf709ed..863779254 100644
--- a/src/Fl_Text_Display.cxx
+++ b/src/Fl_Text_Display.cxx
@@ -1,7 +1,7 @@
//
// "$Id$"
//
-// Copyright 2001-2018 by Bill Spitzak and others.
+// Copyright 2001-2020 by Bill Spitzak and others.
// Original code Copyright Mark Edel. Permission to distribute under
// the LGPL for the FLTK library granted by Mark Edel.
//
@@ -3798,7 +3798,7 @@ void Fl_Text_Display::draw(void) {
// draw all of the text
if (damage() & (FL_DAMAGE_ALL | FL_DAMAGE_EXPOSE)) {
//printf("drawing all text\n");
- int X, Y, W, H;
+ int X = 0, Y = 0, W = 0, H = 0;
if (fl_clip_box(text_area.x, text_area.y, text_area.w, text_area.h,
X, Y, W, H)) {
// Draw text using the intersected clipping box...
diff --git a/src/drivers/Android/Fl_Android_Window_Driver.cxx b/src/drivers/Android/Fl_Android_Window_Driver.cxx
index 5781c0361..7a3e276fd 100644
--- a/src/drivers/Android/Fl_Android_Window_Driver.cxx
+++ b/src/drivers/Android/Fl_Android_Window_Driver.cxx
@@ -3,7 +3,7 @@
//
// Definition of Android window driver.
//
-// Copyright 2018 by Bill Spitzak and others.
+// Copyright 2018-2020 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -510,7 +510,8 @@ void Fl_WinAPI_Window_Driver::flush_double()
fl_end_offscreen();
}
- int X,Y,W,H; fl_clip_box(0,0,w(),h(),X,Y,W,H);
+ int X = 0, Y = 0, W = 0, H = 0;
+ fl_clip_box(0, 0, w(), h(), X, Y, W, H);
if (other_xid) fl_copy_offscreen(X, Y, W, H, other_xid, X, Y);
}
@@ -540,7 +541,8 @@ void Fl_WinAPI_Window_Driver::flush_overlay()
}
if (eraseoverlay) fl_clip_region(0);
- int X, Y, W, H; fl_clip_box(0, 0, w(), h(), X, Y, W, H);
+ int X = 0, Y = 0, W = 0, H = 0;
+ fl_clip_box(0, 0, w(), h(), X, Y, W, H);
if (other_xid) fl_copy_offscreen(X, Y, W, H, other_xid, X, Y);
if (overlay() == oWindow) oWindow->draw_overlay();
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx
index a4f4a472c..0533b3b5f 100644
--- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx
+++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx
@@ -3,7 +3,7 @@
//
// Windows image drawing code for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2018 by Bill Spitzak and others.
+// Copyright 1998-2020 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -125,8 +125,8 @@ static void innards(const uchar *buf, int X, int Y, int W, int H,
if (!linedelta) linedelta = W*fl_abs(delta);
- int x, y, w, h;
- fl_clip_box(X,Y,W,H,x,y,w,h);
+ int x = 0, y = 0, w = 0, h = 0;
+ fl_clip_box(X, Y, W, H, x, y, w, h);
if (w<=0 || h<=0) return;
if (buf) buf += (x-X)*delta + (y-Y)*linedelta;
diff --git a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_rect.cxx b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_rect.cxx
index 2af56c55c..a0ce203ea 100644
--- a/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_rect.cxx
+++ b/src/drivers/OpenGL/Fl_OpenGL_Graphics_Driver_rect.cxx
@@ -3,7 +3,7 @@
//
// Rectangle drawing routines for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2017 by Bill Spitzak and others.
+// Copyright 1998-2020 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -172,7 +172,7 @@ void Fl_OpenGL_Graphics_Driver::push_clip(int x, int y, int w, int h) {
int Fl_OpenGL_Graphics_Driver::clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H) {
// TODO: implement OpenGL clipping
- X = x; Y = y; W = w, H = h;
+ X = x; Y = y; W = w; H = h;
return 0;
}
diff --git a/src/drivers/Pico/Fl_Pico_Graphics_Driver.cxx b/src/drivers/Pico/Fl_Pico_Graphics_Driver.cxx
index e11c13437..ace311323 100644
--- a/src/drivers/Pico/Fl_Pico_Graphics_Driver.cxx
+++ b/src/drivers/Pico/Fl_Pico_Graphics_Driver.cxx
@@ -3,7 +3,7 @@
//
// Rectangle drawing routines for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2016 by Bill Spitzak and others.
+// Copyright 1998-2020 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -195,6 +195,7 @@ void Fl_Pico_Graphics_Driver::push_clip(int x, int y, int w, int h)
int Fl_Pico_Graphics_Driver::clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H)
{
+ X = x; Y = y; W = w; H = h;
return 0;
}
diff --git a/src/drivers/PostScript/Fl_PostScript.cxx b/src/drivers/PostScript/Fl_PostScript.cxx
index 1b6fed13e..5e7f6b4e0 100644
--- a/src/drivers/PostScript/Fl_PostScript.cxx
+++ b/src/drivers/PostScript/Fl_PostScript.cxx
@@ -3,7 +3,7 @@
//
// Classes Fl_PostScript_File_Device and Fl_PostScript_Graphics_Driver for the Fast Light Tool Kit (FLTK).
//
-// Copyright 2010-2016 by Bill Spitzak and others.
+// Copyright 2010-2020 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -1341,16 +1341,16 @@ void Fl_PostScript_Graphics_Driver::pop_clip() {
recover();
}
-int Fl_PostScript_Graphics_Driver::clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H){
- if(!clip_){
- X=x;Y=y;W=w;H=h;
+int Fl_PostScript_Graphics_Driver::clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H) {
+ if (!clip_) {
+ X = x; Y = y; W = w; H = h;
return 1;
}
- if(clip_->w < 0){
- X=x;Y=y;W=w;H=h;
+ if (clip_->w < 0) {
+ X = x; Y = y; W = w; H = h;
return 1;
}
- int ret=0;
+ int ret = 0;
if (x > (X=clip_->x)) {X=x; ret=1;}
if (y > (Y=clip_->y)) {Y=y; ret=1;}
if ((x+w) < (clip_->x+clip_->w)) {
@@ -1377,12 +1377,12 @@ int Fl_PostScript_Graphics_Driver::clip_box(int x, int y, int w, int h, int &X,
return ret;
}
-int Fl_PostScript_Graphics_Driver::not_clipped(int x, int y, int w, int h){
- if(!clip_) return 1;
- if(clip_->w < 0) return 1;
- int X, Y, W, H;
+int Fl_PostScript_Graphics_Driver::not_clipped(int x, int y, int w, int h) {
+ if (!clip_) return 1;
+ if (clip_->w < 0) return 1;
+ int X = 0, Y = 0, W = 0, H = 0;
clip_box(x, y, w, h, X, Y, W, H);
- if(W) return 1;
+ if (W) return 1;
return 0;
}
diff --git a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
index 78379712f..fb449754e 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
+++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
@@ -3,7 +3,7 @@
//
// Definition of Apple Cocoa window driver.
//
-// Copyright 1998-2018 by Bill Spitzak and others.
+// Copyright 1998-2020 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -334,7 +334,8 @@ void Fl_WinAPI_Window_Driver::flush_double()
fl_graphics_driver->gc(sgc);
#endif
}
- int X,Y,W,H; fl_clip_box(0,0,w(),h(),X,Y,W,H);
+ int X = 0, Y = 0, W = 0, H = 0;
+ fl_clip_box(0, 0, w(), h(), X, Y, W, H);
if (other_xid) fl_copy_offscreen(X, Y, W, H, other_xid, X, Y);
}
diff --git a/src/drivers/X11/Fl_X11_Window_Driver.cxx b/src/drivers/X11/Fl_X11_Window_Driver.cxx
index 1de2e5297..2ea16bf70 100644
--- a/src/drivers/X11/Fl_X11_Window_Driver.cxx
+++ b/src/drivers/X11/Fl_X11_Window_Driver.cxx
@@ -3,7 +3,7 @@
//
// Definition of X11 window driver.
//
-// Copyright 1998-2018 by Bill Spitzak and others.
+// Copyright 1998-2020 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -234,7 +234,8 @@ void Fl_X11_Window_Driver::flush_double(int erase_overlay)
fl_window = i->xid;
}
if (erase_overlay) fl_clip_region(0);
- int X,Y,W,H; fl_clip_box(0,0,w(),h(),X,Y,W,H);
+ int X = 0, Y = 0, W = 0, H = 0;
+ fl_clip_box(0, 0, w(), h(), X, Y, W, H);
if (other_xid) fl_copy_offscreen(X, Y, W, H, other_xid, X, Y);
}
diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx
index 688457a24..8fed7834b 100644
--- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx
+++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx
@@ -3,7 +3,7 @@
//
// Image drawing routines for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2018 by Bill Spitzak and others.
+// Copyright 1998-2020 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -474,8 +474,8 @@ static void innards(const uchar *buf, int X, int Y, int W, int H,
{
if (!linedelta) linedelta = W*abs(delta);
- int dx, dy, w, h;
- fl_clip_box(X,Y,W,H,dx,dy,w,h);
+ int dx = 0, dy = 0, w = 0, h = 0;
+ fl_clip_box(X, Y, W, H, dx, dy, w, h);
if (w<=0 || h<=0) return;
dx -= X;
dy -= Y;
diff --git a/src/gl_start.cxx b/src/gl_start.cxx
index c1e86107c..3f3589aaf 100644
--- a/src/gl_start.cxx
+++ b/src/gl_start.cxx
@@ -3,7 +3,7 @@
//
// OpenGL context routines for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2018 by Bill Spitzak and others.
+// Copyright 1998-2020 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -65,7 +65,7 @@ void gl_start() {
}
if (clip_state_number != fl_graphics_driver->fl_clip_state_number) {
clip_state_number = fl_graphics_driver->fl_clip_state_number;
- int x, y, w, h;
+ int x = 0, y = 0, w = 0, h = 0;
if (fl_clip_box(0, 0, Fl_Window::current()->w(), Fl_Window::current()->h(),
x, y, w, h)) {
fl_clip_region(Fl_Graphics_Driver::default_driver().XRectangleRegion(x,y,w,h));