[pooma-dev] RFA: src/NewField Changes
Jeffrey Oldham
oldham at codesourcery.com
Thu Mar 29 17:35:02 UTC 2001
I revised the NewField patch per Scott's comments. Is it OK
to commit?
On Wed, Mar 28, 2001 at 05:35:33PM -0700, Scott Haney wrote:
>
> On Wednesday, March 28, 2001, at 05:01 PM, Jeffrey Oldham wrote:
>
> > In the continuing pursuit to compile a "hello, world" Pooma program
> > using g++, here are more changes.
> >
> > OK to commit?
> >
> > 2001-03-28 Jeffrey D. Oldham <oldham at codesourcery.com>
> >
> > * PrintField.h (PrintField::PrintField): Reorder constructor
> > initializers to reflect class member order.
> > * Updater/UpdaterList.h (UpdaterListData::UpdaterListData):
> > Likewise. Also add default initializer for base class.
> > (UpdaterListData::~UpdaterListData): Change loop iterator type to
> > correspond to std::vector.
> >
> I don't mind reordering, but, as I mentioned before, I'd like to
> understand the default base class ctor stuff.
I removed the default base class ctor stuff.
> I don't fully understand why the typedef is required. But, if it is
> required by the standard, could we put it in the function?
The C++ standard \S 23.1 [Container requirements] requires
x::size_type to be an unsigned integral type. I moved the typedef
into the destructor.
Tested on sequential Linux using gcc 3.1 by compiling Pooma library
and a Pooma "hello, world" program
Approved by ???you???
Thanks,
Jeffrey D. Oldham
oldham at codesourcery.com
-------------- next part --------------
Index: PrintField.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/NewField/PrintField.h,v
retrieving revision 1.2
diff -c -p -r1.2 PrintField.h
*** PrintField.h 2000/07/20 21:03:51 1.2
--- PrintField.h 2001/03/29 17:20:42
*************** public:
*** 188,194 ****
bool scientific = false, int spacing = 1)
: domainwidth_m(domainWidth), datawidth_m(dataWidth),
dataprecision_m(dataPrecision), carreturn_m(carReturn),
! scientific_m(scientific), spacing_m(spacing)
{
PAssert(domainwidth_m > 0);
PAssert(datawidth_m > 0);
--- 188,194 ----
bool scientific = false, int spacing = 1)
: domainwidth_m(domainWidth), datawidth_m(dataWidth),
dataprecision_m(dataPrecision), carreturn_m(carReturn),
! spacing_m(spacing), scientific_m(scientific)
{
PAssert(domainwidth_m > 0);
PAssert(datawidth_m > 0);
Index: Updater/UpdaterList.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/NewField/Updater/UpdaterList.h,v
retrieving revision 1.7
diff -c -p -r1.7 UpdaterList.h
*** Updater/UpdaterList.h 2001/02/21 20:11:38 1.7
--- Updater/UpdaterList.h 2001/03/29 17:20:42
*************** public:
*** 66,73 ****
// Copy constructor.
UpdaterListData(const UpdaterListData &model)
! : data_m(model.data_m),
! updating_m(false)
{ }
--- 66,73 ----
// Copy constructor.
UpdaterListData(const UpdaterListData &model)
! : updating_m(false), data_m(model.data_m)
!
{ }
*************** public:
*** 88,94 ****
~UpdaterListData()
{
! for (int i = 0; i < data_m.size(); i++)
delete data_m[i];
}
--- 88,95 ----
~UpdaterListData()
{
! typedef std::vector<UpdaterListItem *>::size_type size_type;
! for (size_type i = 0; i < data_m.size(); i++)
delete data_m[i];
}
More information about the pooma-dev
mailing list