diff options
author | Slávek Banko <[email protected]> | 2015-07-12 12:10:55 +0200 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2015-07-12 12:12:06 +0200 |
commit | 1dcb573683c89fd490c2bbff00d3966dcbc95ece (patch) | |
tree | 8b2f1ef605eeb6f83124a450eeaaf447cf8253e7 | |
parent | 54a5c5731642a8d39289ac022561a561ba1dc190 (diff) | |
download | ksquirrel-1dcb573683c89fd490c2bbff00d3966dcbc95ece.tar.gz ksquirrel-1dcb573683c89fd490c2bbff00d3966dcbc95ece.zip |
Fix FTBFS with clang
Signed-off-by: Slávek Banko <[email protected]>
(cherry picked from commit 9a4419b617a931aa96ce6aa5b7f13a0af209dd31)
-rw-r--r-- | ksquirrel/ksquirrelpart/sq_glwidget_helpers.cpp | 1 | ||||
-rw-r--r-- | ksquirrel/ksquirrelpart/sq_glwidget_stuff.cpp | 6 | ||||
-rw-r--r-- | ksquirrel/sq_glwidget_helpers.cpp | 1 | ||||
-rw-r--r-- | ksquirrel/sq_glwidget_stuff.cpp | 6 |
4 files changed, 12 insertions, 2 deletions
diff --git a/ksquirrel/ksquirrelpart/sq_glwidget_helpers.cpp b/ksquirrel/ksquirrelpart/sq_glwidget_helpers.cpp index b407a86..0dd96c0 100644 --- a/ksquirrel/ksquirrelpart/sq_glwidget_helpers.cpp +++ b/ksquirrel/ksquirrelpart/sq_glwidget_helpers.cpp @@ -25,6 +25,7 @@ #include <tqpointarray.h> #include <algorithm> +#include <cstdlib> #include <tdetoolbar.h> diff --git a/ksquirrel/ksquirrelpart/sq_glwidget_stuff.cpp b/ksquirrel/ksquirrelpart/sq_glwidget_stuff.cpp index d1e2f92..40ce9ee 100644 --- a/ksquirrel/ksquirrelpart/sq_glwidget_stuff.cpp +++ b/ksquirrel/ksquirrelpart/sq_glwidget_stuff.cpp @@ -544,7 +544,7 @@ void SQ_GLWidget::saveAs() default: scgetter = SQ_GLHelpers::scanLine0; } - RGBA scan[w]; + RGBA *scan = new RGBA[w]; RGBA *data = tab->parts[tab->current].buffer->data(); fmt_image im2 = im; @@ -563,6 +563,7 @@ void SQ_GLWidget::saveAs() if(err != SQE_OK) { KMessageBox::error(this, i18n("Error writing image")); + delete [] scan; return; } @@ -571,6 +572,7 @@ void SQ_GLWidget::saveAs() if(err != SQE_OK) { KMessageBox::error(this, i18n("Error writing image")); + delete [] scan; return; } @@ -593,11 +595,13 @@ void SQ_GLWidget::saveAs() { wlib->codec->write_close(); KMessageBox::error(this, i18n("Error writing image")); + delete [] scan; return; } } wlib->codec->write_close(); + delete [] scan; // copy to non-local directory if(!url.isLocalFile()) diff --git a/ksquirrel/sq_glwidget_helpers.cpp b/ksquirrel/sq_glwidget_helpers.cpp index b407a86..0dd96c0 100644 --- a/ksquirrel/sq_glwidget_helpers.cpp +++ b/ksquirrel/sq_glwidget_helpers.cpp @@ -25,6 +25,7 @@ #include <tqpointarray.h> #include <algorithm> +#include <cstdlib> #include <tdetoolbar.h> diff --git a/ksquirrel/sq_glwidget_stuff.cpp b/ksquirrel/sq_glwidget_stuff.cpp index d1e2f92..40ce9ee 100644 --- a/ksquirrel/sq_glwidget_stuff.cpp +++ b/ksquirrel/sq_glwidget_stuff.cpp @@ -544,7 +544,7 @@ void SQ_GLWidget::saveAs() default: scgetter = SQ_GLHelpers::scanLine0; } - RGBA scan[w]; + RGBA *scan = new RGBA[w]; RGBA *data = tab->parts[tab->current].buffer->data(); fmt_image im2 = im; @@ -563,6 +563,7 @@ void SQ_GLWidget::saveAs() if(err != SQE_OK) { KMessageBox::error(this, i18n("Error writing image")); + delete [] scan; return; } @@ -571,6 +572,7 @@ void SQ_GLWidget::saveAs() if(err != SQE_OK) { KMessageBox::error(this, i18n("Error writing image")); + delete [] scan; return; } @@ -593,11 +595,13 @@ void SQ_GLWidget::saveAs() { wlib->codec->write_close(); KMessageBox::error(this, i18n("Error writing image")); + delete [] scan; return; } } wlib->codec->write_close(); + delete [] scan; // copy to non-local directory if(!url.isLocalFile()) |