freepooma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Guard Vector constructors


From: Jeffrey D. Oldham
Subject: Re: [PATCH] Guard Vector constructors
Date: Wed, 03 Dec 2003 18:43:15 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624

Richard Guenther wrote:
Hi!

I just had a swep over my local changes and found this (and others, see
following mails). It guards the Vector constructors by dimensionality
checks. I suppose this bit me at a time.

Checked by being in my tree for a long time (don't know if that counts,
though ;)).

Ok?

OK.  We'll watch for regressions in the nightly POOMA tests.

Would you be willing to also send a ChangeLog entry with your patches? It will facilitate reviewing the patches.

Richard.

Index: Vector.h
===================================================================
RCS file: /home/pooma/Repository/r2/src/Tiny/Vector.h,v
retrieving revision 1.31
diff -u -u -r1.31 Vector.h
--- Vector.h    21 Oct 2003 19:50:04 -0000      1.31
+++ Vector.h    3 Dec 2003 20:39:37 -0000
@@ -291,12 +291,14 @@
   template<class X1, class X2>
     inline VectorEngine(const X1& x, const X2& y)
       {
+       CTAssert(D == 2);
         x_m[0] = x;
         x_m[1] = y;
        }
   template<class X1, class X2, class X3>
     inline VectorEngine(const X1& x, const X2& y, const X3& z)
       {
+       CTAssert(D == 3);
         x_m[0] = x;
         x_m[1] = y;
         x_m[2] = z;
@@ -305,6 +307,7 @@
     inline VectorEngine(const X1& x, const X2& y, const X3& z,
       const X4& a)
       {
+       CTAssert(D == 4);
         x_m[0] = x;
         x_m[1] = y;
         x_m[2] = z;


--
Jeffrey D. Oldham
address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]