Don't use variable length arrays of non-POD types.

This commit is contained in:
joerg 2012-11-23 12:29:15 +00:00
parent a95b523806
commit 08b3bcb2e3
5 changed files with 83 additions and 1 deletions

View file

@ -1,6 +1,10 @@
$NetBSD: distinfo,v 1.4 2012/06/24 01:49:14 dholland Exp $
$NetBSD: distinfo,v 1.5 2012/11/23 12:29:15 joerg Exp $
SHA1 (extrema-4.4.4.tar.gz) = eff38eb3c36aa9acc3ad471ea57f2037c66e1842
RMD160 (extrema-4.4.4.tar.gz) = 4ce6dcacca51ac18deb770cd9c0f7f77d0458ccd
Size (extrema-4.4.4.tar.gz) = 6404330 bytes
SHA1 (patch-src_Graphics_GRA__thiessenTriangulation_h) = ede808bc2f19f3aafb31310eb04aa5317ad9b471
SHA1 (patch-src_wxForms_AxisPopup.cpp) = 8b96ab1d88f5abfaa6d45562bc02c990b8143a48
SHA1 (patch-src_wxForms_FontChooser.cpp) = bc6a979c8d693347efdf581653008a62abce149a
SHA1 (patch-src_wxForms_LegendPopup.cpp) = 51491d6fe345c380dda6044d4c463d9f8da5fe49
SHA1 (patch-src_wxForms_TextPopup.cpp) = 314885dc14f69b113af801c5d421c16d107c0887

View file

@ -0,0 +1,28 @@
$NetBSD: patch-src_wxForms_AxisPopup.cpp,v 1.1 2012/11/23 12:29:15 joerg Exp $
--- src/wxForms/AxisPopup.cpp.orig 2012-11-21 22:06:14.000000000 +0000
+++ src/wxForms/AxisPopup.cpp
@@ -214,9 +214,10 @@ void AxisPopup::MakeNumbersPanel()
sizer->Add( new wxStaticText(panel,wxID_ANY,wxT("Font ")), wxSizerFlags(0).Left().Border(wxTOP,5) );
int nf = GRA_fontControl::GetCount();
- wxString choices[nf];
+ wxString *choices = new wxString[nf];
for( int i=0; i<nf; ++i )choices[i] = GRA_fontControl::GetFont(i)->GetFontName();
nFontCB_ = new wxComboBox( panel, ID_numbersFont, wxT(""), wxDefaultPosition, wxSize(200,25), nf, choices, wxCB_READONLY );
+ delete[] choices;
nFontCB_->SetToolTip( wxT("choose the axis numbers font") );
sizer->Add( nFontCB_, wxSizerFlags(0).Left().Border(wxALL,2) );
@@ -268,9 +269,10 @@ void AxisPopup::MakeLabelPanel()
topSizer->Add( new wxStaticText(topPanel,wxID_ANY,wxT("Font ")), wxSizerFlags(0).Left().Border(wxTOP,5) );
int nf = GRA_fontControl::GetCount();
- wxString choices[nf];
+ wxString *choices = new wxString[nf];
for( int i=0; i<nf; ++i )choices[i] = GRA_fontControl::GetFont(i)->GetFontName();
lFontCB_ = new wxComboBox( topPanel, ID_labelFont, wxT(""), wxDefaultPosition, wxSize(200,25), nf, choices, wxCB_READONLY );
+ delete[] choices;
lFontCB_->SetToolTip( wxT("choose the axis label font") );
topSizer->Add( lFontCB_, wxSizerFlags(0).Left().Border(wxALL,2) );

View file

@ -0,0 +1,16 @@
$NetBSD: patch-src_wxForms_FontChooser.cpp,v 1.1 2012/11/23 12:29:15 joerg Exp $
--- src/wxForms/FontChooser.cpp.orig 2012-11-21 22:08:15.000000000 +0000
+++ src/wxForms/FontChooser.cpp
@@ -101,9 +101,10 @@ void FontChooser::CreateForm()
topSizer->Add( new wxStaticText(topPanel,wxID_ANY,wxT("Font ")), wxSizerFlags(0).Right().Border(wxTOP,5) );
//
int nf = GRA_fontControl::GetCount();
- wxString choices[nf];
+ wxString *choices = new wxString[nf];
for( int i=0; i<nf; ++i )choices[i] = GRA_fontControl::GetFont(i)->GetFontName();
fontCB_ = new wxComboBox( topPanel, ID_font, wxT(""), wxDefaultPosition, wxSize(200,25), nf, choices, wxCB_READONLY );
+ delete[] choices;
topSizer->Add( fontCB_, wxSizerFlags(1).Left().Border(wxALL,2) );
topPanel->SetSizer( topSizer );
mainSizer->Add( topPanel, wxSizerFlags(0).Expand().Border(wxALL,2) );

View file

@ -0,0 +1,17 @@
$NetBSD: patch-src_wxForms_LegendPopup.cpp,v 1.1 2012/11/23 12:29:15 joerg Exp $
--- src/wxForms/LegendPopup.cpp.orig 2012-11-21 22:11:15.000000000 +0000
+++ src/wxForms/LegendPopup.cpp
@@ -166,10 +166,11 @@ void LegendPopup::CreateForm()
titleBotSizer->Add( new wxStaticText(titleBotPanel,wxID_ANY,wxT("Font")),
wxSizerFlags(0).Left().Border(wxALL,2) );
int nf = GRA_fontControl::GetCount();
- wxString choices[nf];
+ wxString *choices = new wxString[nf];
for( int i=0; i<nf; ++i )choices[i] = GRA_fontControl::GetFont(i)->GetFontName();
titleFontCB_ = new wxComboBox( titleBotPanel, ID_font, wxT(""), wxDefaultPosition, wxSize(200,25), nf,
choices, wxCB_READONLY );
+ delete[] choices;
titleFontCB_->SetToolTip( wxT("choose the title font") );
titleBotSizer->Add( titleFontCB_, wxSizerFlags(0).Left().Border(wxALL,2) );

View file

@ -0,0 +1,17 @@
$NetBSD: patch-src_wxForms_TextPopup.cpp,v 1.1 2012/11/23 12:29:15 joerg Exp $
--- src/wxForms/TextPopup.cpp.orig 2012-11-21 22:13:23.000000000 +0000
+++ src/wxForms/TextPopup.cpp
@@ -107,10 +107,11 @@ void TextPopup::CreateForm()
//
fSizer->Add( new wxStaticText(fPanel,wxID_ANY,wxT("Font")), wxSizerFlags(0).Left().Border(wxTOP,2) );
int nf = GRA_fontControl::GetCount();
- wxString choices[nf];
+ wxString *choices = new wxString[nf];
for( int i=0; i<nf; ++i )choices[i] = GRA_fontControl::GetFont(i)->GetFontName();
fontCB_ = new wxComboBox( fPanel, ID_font, wxT(""), wxDefaultPosition, wxSize(200,25), nf,
choices, wxCB_READONLY );
+ delete[] choices;
fontCB_->SetToolTip( wxT("choose the text font") );
fSizer->Add( fontCB_, wxSizerFlags(0).Left().Border(wxALL,2) );