summaryrefslogtreecommitdiff
path: root/src/drivers/PostScript/Fl_PostScript.cxx
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2020-01-15 21:23:26 +0100
committerAlbrecht Schlosser <albrechts.fltk@online.de>2020-01-15 21:23:26 +0100
commitdfaab4ae9004fa636bb11fdc4846a11a16e81ebb (patch)
treef958ef65e4104c15f66a3e144776f41a95385f0e /src/drivers/PostScript/Fl_PostScript.cxx
parent3265d439f351d3a4d48bb1f99047f24134f1e5aa (diff)
Fix uninitialized vars in calls to fl_clip_box() (issue #6)
The main fixes are only to avoid static code analyzer warnings reported in issue #5, but there are also minor bug fixes included. These bug fixes are more of theoretical concerns though. Close #6.
Diffstat (limited to 'src/drivers/PostScript/Fl_PostScript.cxx')
-rw-r--r--src/drivers/PostScript/Fl_PostScript.cxx24
1 files changed, 12 insertions, 12 deletions
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;
}