summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-04-14 11:07:12 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-04-14 11:07:56 +0200
commitd83d89679beb0d92b140684230936d264a182679 (patch)
treed865b8e7634129c9942da85425552580de1234d2
parent1e99a00c65d3eaba724a3743dd79c25996756521 (diff)
Fix for issue #429 : Segfault with Ctrl+/- with current git version
-rw-r--r--FL/Fl_Bitmap.H4
-rw-r--r--FL/Fl_Pixmap.H4
-rw-r--r--src/Fl_Bitmap.cxx2
-rw-r--r--src/Fl_Pixmap.cxx2
4 files changed, 6 insertions, 6 deletions
diff --git a/FL/Fl_Bitmap.H b/FL/Fl_Bitmap.H
index e0fc2244d..23fd79abd 100644
--- a/FL/Fl_Bitmap.H
+++ b/FL/Fl_Bitmap.H
@@ -50,8 +50,8 @@ public:
Fl_Bitmap(const char *bits, int W, int H) :
Fl_Image(W,H,0), array((const uchar *)bits), alloc_array(0), id_(0), cache_w_(0),cache_h_(0) {data((const char **)&array, 1);}
virtual ~Fl_Bitmap();
- virtual Fl_Image *copy(int W, int H);
- Fl_Image *copy() { return Fl_Image::copy(); }
+ virtual Fl_Image *copy(int W, int H) const;
+ Fl_Image *copy() const { return Fl_Image::copy(); }
virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0);
void draw(int X, int Y) {draw(X, Y, w(), h(), 0, 0);}
virtual void label(Fl_Widget*w);
diff --git a/FL/Fl_Pixmap.H b/FL/Fl_Pixmap.H
index c446a92be..caa0e9371 100644
--- a/FL/Fl_Pixmap.H
+++ b/FL/Fl_Pixmap.H
@@ -63,8 +63,8 @@ public:
/** The constructors create a new pixmap from the specified XPM data. */
explicit Fl_Pixmap(const uchar* const * D) : Fl_Image(-1,0,1), alloc_data(0), id_(0), mask_(0) {set_data((const char*const*)D); measure();}
virtual ~Fl_Pixmap();
- virtual Fl_Image *copy(int W, int H);
- Fl_Image *copy() { return Fl_Image::copy(); }
+ virtual Fl_Image *copy(int W, int H) const;
+ Fl_Image *copy() const { return Fl_Image::copy(); }
virtual void color_average(Fl_Color c, float i);
virtual void desaturate();
virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0);
diff --git a/src/Fl_Bitmap.cxx b/src/Fl_Bitmap.cxx
index f760ac979..cbe997827 100644
--- a/src/Fl_Bitmap.cxx
+++ b/src/Fl_Bitmap.cxx
@@ -55,7 +55,7 @@ void Fl_Bitmap::label(Fl_Menu_Item* m) {
m->label(FL_IMAGE_LABEL, (const char*)this);
}
-Fl_Image *Fl_Bitmap::copy(int W, int H) {
+Fl_Image *Fl_Bitmap::copy(int W, int H) const {
Fl_Bitmap *new_image; // New RGB image
uchar *new_array; // New array for image data
diff --git a/src/Fl_Pixmap.cxx b/src/Fl_Pixmap.cxx
index e6c6cc4c3..e8725102a 100644
--- a/src/Fl_Pixmap.cxx
+++ b/src/Fl_Pixmap.cxx
@@ -125,7 +125,7 @@ void Fl_Pixmap::copy_data() {
alloc_data = 1;
}
-Fl_Image *Fl_Pixmap::copy(int W, int H) {
+Fl_Image *Fl_Pixmap::copy(int W, int H) const {
Fl_Pixmap *new_image; // New pixmap
if (!data()) { // happens with bad pixmap data
return new Fl_Pixmap((char *const*)0);