diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2015-07-12 12:10:55 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2015-07-12 12:10:55 +0200 |
commit | 9a4419b617a931aa96ce6aa5b7f13a0af209dd31 (patch) | |
tree | 159f7e0f97119a2d068dd46c9abc513eced5ae36 | |
parent | 26148c51253a42de0f5aa79654d798cde2ccb77b (diff) | |
download | ksquirrel-9a4419b617a931aa96ce6aa5b7f13a0af209dd31.tar.gz ksquirrel-9a4419b617a931aa96ce6aa5b7f13a0af209dd31.zip |
Fix FTBFS with clang
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-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()) |