This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: high priority bugs T minus 2 days
- To: Benjamin Kosnik <bkoz at redhat dot com>
- Subject: Re: high priority bugs T minus 2 days
- From: Gabriel Dos Reis <Gabriel dot Dos-Reis at cmla dot ens-cachan dot fr>
- Date: 13 Jun 2001 22:01:56 +0200
- Cc: gcc at gcc dot gnu dot org, mark at codesourcery dot com, libstdc++ at gcc dot gnu dot org
- Organization: CMLA, ENS Cachan -- CNRS UMR 8536 (France)
- References: <200106131650.f5DGot401447@fillmore.constant.com>
Benjamin Kosnik <bkoz@redhat.com> writes:
| > 2071 (pme) seeking on stdin
|
| fixed yesterday
|
| > 3158 libstdc++ thing
Here is a patch for this (will add a testcase).
Analogue problems occur in other places. I don't anticipate to fix
them before tomorrow however.
Mark, is it OK for branch?
-- Gaby
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/ChangeLog,v
retrieving revision 1.665
diff -p -r1.665 ChangeLog
*** ChangeLog 2001/06/13 17:51:33 1.665
--- ChangeLog 2001/06/13 19:58:44
***************
*** 1,3 ****
--- 1,11 ----
+ 2001-06-13 Gabriel Dos Reis <gdr@merlin.codesourcery.com>
+
+ * include/bits/slice_array.h (slice_array<>::operator=): Make
+ public and implement.
+
+ * include/bits/valarray_array.h (__valarray_copy): Add another
+ overload to copy between strided arrays.
+
2001-06-13 Benjamin Kosnik <bkoz@redhat.com>
* acinclude.m4 (GLIBCPP_CONFIGURE): Bump version to 3.0.0.
Index: include/bits/slice_array.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/slice_array.h,v
retrieving revision 1.3
diff -p -r1.3 slice_array.h
*** slice_array.h 2001/03/04 21:34:00 1.3
--- slice_array.h 2001/06/13 19:58:44
*************** namespace std
*** 42,48 ****
{
public:
typedef _Tp value_type;
!
void operator= (const valarray<_Tp>&) const;
void operator*= (const valarray<_Tp>&) const;
void operator/= (const valarray<_Tp>&) const;
--- 42,51 ----
{
public:
typedef _Tp value_type;
!
! // This operator must be public. See DR-253.
! slice_array& operator= (const slice_array&);
!
void operator= (const valarray<_Tp>&) const;
void operator*= (const valarray<_Tp>&) const;
void operator/= (const valarray<_Tp>&) const;
*************** namespace std
*** 93,99 ****
// not implemented
slice_array ();
- slice_array& operator= (const slice_array&);
};
template<typename _Tp>
--- 96,101 ----
*************** namespace std
*** 108,113 ****
--- 110,124 ----
// template<typename _Tp>
// inline slice_array<_Tp>::~slice_array () {}
+
+ template<typename _Tp>
+ inline slice_array<_Tp>&
+ slice_array<_Tp>::operator=(const slice_array<_Tp>& __a)
+ {
+ __valarray_copy(_M_array, _M_sz, _M_stride, __a._M_array, __a._M_stride);
+ return *this;
+ }
+
template<typename _Tp>
inline void
Index: include/bits/valarray_array.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/valarray_array.h,v
retrieving revision 1.3
diff -p -r1.3 valarray_array.h
*** valarray_array.h 2001/02/19 18:52:25 1.3
--- valarray_array.h 2001/06/13 19:58:44
*************** namespace std
*** 252,257 ****
--- 252,269 ----
__valarray_copy (const _Tp* __restrict__ __a, _Tp* __restrict__ __b,
size_t __n, size_t __s)
{ for (size_t __i=0; __i<__n; ++__i, ++__a, __b+=__s) *__b = *__a; }
+
+ // copy strided array __src[<__n : __s1>] into another
+ // strided array __dst[< : __s2>]. Their sizes must macth.
+ template<typename _Tp>
+ inline void
+ __valarray_copy(const _Tp* __restrict__ __src, size_t __n, size_t __s1,
+ _Tp* __restrict__ __dst, size_t __s2)
+ {
+ for (size_t __i = 0; __i < __n; ++__i)
+ __dst[__i * __s2] = __src [ __i * __s1];
+ }
+
// copy indexed __a[__i[<__n>]] in plain __b[<__n>]
template<typename _Tp>
*************** namespace std
*** 378,383 ****
--- 390,402 ----
inline void
__valarray_copy (_Array<_Tp> __a, _Array<_Tp> __b, size_t __n, size_t __s)
{ __valarray_copy (__a._M_data, __b._M_data, __n, __s); }
+
+ template<typename _Tp>
+ inline void
+ __valarray_copy(_Array<_Tp> __a, size_t __n, size_t __s1,
+ _Array<_Tp> __b, size_t __s2)
+ { __valarray_copy(__a._M_data, __n, __s1, __b._M_data, __s2); }
+
template<typename _Tp>
inline void