RFA: Other Changes (3 of 3)
Jeffrey Oldham
oldham at codesourcery.com
Wed Mar 28 23:41:49 UTC 2001
The large patch I sent out yesterday was too complicated. Thus, I
have split it into five pieces:
1) Add typenames.
2) Reorder constructor initializers.
3) Other changes. <-- this patch
4) Preprocessor changes. (withdrawn)
5) Changes to deprecated directories. (withdrawn)
I withdraw the large patch. (I cut the large patch apart by hand so
small typos may be present.)
Allan Stokes suggested a different way to handle comparisons between
different types. Allan, can you provide code?
Allan Stokes declined to review the virtual destructors.
2001-03-27 Jeffrey D. Oldham <oldham at codesourcery.com>
* Domain/DomainTraits.Grid.h (DomainTraits::setDomain): Rewrite to
ensure that comparisons occur between the same types.
* Domain/DomainTraits.Interval.h (DomainTraits::setDomain): Likewise.
* Domain/DomainTraits.Range.h (DomainTraits::setDomain): Likewise.
* Partition/UniformMapper.h (UniformMapper::~UniformMapper): New
empty function.
* Utilities/Observer.h (SingleObserver::~SingleObserver): Make
virtual.
Tested on sequential Linux using gcc 3.1
Approved by ???you???
Thanks,
Jeffrey D. Oldham
oldham at codesourcery.com
-------------- next part --------------
Index: Domain/DomainTraits.Grid.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Domain/DomainTraits.Grid.h,v
retrieving revision 1.8
diff -c -p -r1.8 DomainTraits.Grid.h
*** Domain/DomainTraits.Grid.h 2000/04/28 16:29:38 1.8
--- Domain/DomainTraits.Grid.h 2001/03/28 01:59:31
*************** struct DomainTraits< Grid<1> >
*** 257,264 ****
CTAssert(DomainTraits<T2>::dimensions == 1);
CTAssert(DomainTraits<T1>::singleValued == 1);
CTAssert(DomainTraits<T2>::singleValued == 1);
! Element_t strideval = (endval < begval ? -1 : 1);
! dom = Storage_t(begval, strideval, (endval - begval)/strideval + 1);
}
// a specialized version of setDomain which accepts begin & end values and
--- 257,265 ----
CTAssert(DomainTraits<T2>::dimensions == 1);
CTAssert(DomainTraits<T1>::singleValued == 1);
CTAssert(DomainTraits<T2>::singleValued == 1);
! const T2 bgval = static_cast<T2>(begval);
! Element_t strideval = (endval < bgval ? -1 : 1);
! dom = Storage_t(begval, strideval, (endval - bgval)/strideval + 1);
}
// a specialized version of setDomain which accepts begin & end values and
Index: Domain/DomainTraits.Interval.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Domain/DomainTraits.Interval.h,v
retrieving revision 1.24
diff -c -p -r1.24 DomainTraits.Interval.h
*** Domain/DomainTraits.Interval.h 2001/03/20 23:42:47 1.24
--- Domain/DomainTraits.Interval.h 2001/03/28 01:59:31
*************** struct DomainTraits< Interval<1> >
*** 263,269 ****
CTAssert(DomainTraits<T2>::singleValued == 1);
dom[0] = begval;
dom[1] = static_cast<Element_t>(endval - begval + 1);
! PAssert(begval <= endval || dom[1] == 0);
}
// change the loop variable for this object. For Interval, this is a no-op.
--- 263,269 ----
CTAssert(DomainTraits<T2>::singleValued == 1);
dom[0] = begval;
dom[1] = static_cast<Element_t>(endval - begval + 1);
! PAssert(static_cast<T2>(begval) <= endval || dom[1] == 0);
}
// change the loop variable for this object. For Interval, this is a no-op.
Index: Domain/DomainTraits.Range.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Domain/DomainTraits.Range.h,v
retrieving revision 1.21
diff -c -p -r1.21 DomainTraits.Range.h
*** Domain/DomainTraits.Range.h 2000/03/07 13:16:35 1.21
--- Domain/DomainTraits.Range.h 2001/03/28 01:59:31
*************** struct DomainTraits< Range<1> >
*** 238,244 ****
CTAssert(DomainTraits<T2>::dimensions == 1);
CTAssert(DomainTraits<T1>::singleValued == 1);
CTAssert(DomainTraits<T2>::singleValued == 1);
! Element_t strideval = (endval < begval ? -1 : 1);
dom[0] = begval;
dom[1] = (endval - begval)/strideval + 1;
dom[2] = strideval;
--- 238,244 ----
CTAssert(DomainTraits<T2>::dimensions == 1);
CTAssert(DomainTraits<T1>::singleValued == 1);
CTAssert(DomainTraits<T2>::singleValued == 1);
! Element_t strideval = (endval < static_cast<T2>(begval) ? -1 : 1);
dom[0] = begval;
dom[1] = (endval - begval)/strideval + 1;
dom[2] = strideval;
Index: Partition/UniformMapper.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Partition/UniformMapper.h,v
retrieving revision 1.3
diff -c -p -r1.3 UniformMapper.h
*** Partition/UniformMapper.h 2000/06/07 23:36:46 1.3
--- Partition/UniformMapper.h 2001/03/28 01:59:36
*************** public:
*** 86,91 ****
--- 86,93 ----
void map(const List_t&) const;
+ virtual ~UniformMapper () {}
+
// member data
private:
Index: Utilities/Observer.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Utilities/Observer.h,v
retrieving revision 1.10
diff -c -p -r1.10 Observer.h
*** Utilities/Observer.h 2000/03/07 13:18:25 1.10
--- Utilities/Observer.h 2001/03/28 01:59:37
*************** public:
*** 182,188 ****
// The destructor is not made virtual, since we should not ever need
// to delete an object via its SingleObserver base class.
! ~SingleObserver() { }
//============================================================
--- 182,188 ----
// The destructor is not made virtual, since we should not ever need
// to delete an object via its SingleObserver base class.
! virtual ~SingleObserver() { }
//============================================================
More information about the pooma-dev
mailing list