Commit 3ad62e75 by Gabriel Dos Reis

valarray_array.h (_Array_default_ctor<>::_S_do_it): Don't forget the sizeof(_Tp)…

valarray_array.h (_Array_default_ctor<>::_S_do_it): Don't forget the sizeof(_Tp) factor in call to memset().

2000-06-28  Gabriel Dos Reis  <dosreis@cmla.ens-cachan.fr>

	* bits/valarray_array.h (_Array_default_ctor<>::_S_do_it): Don't
	forget the sizeof(_Tp) factor in call to memset().
	(_Array_copy_ctor<>::_S_do_it): Likewise for memcpy().

From-SVN: r34757
parent d731a1da
......@@ -73,7 +73,7 @@ namespace std
// For fundamental types, it suffices to say 'memset()'
inline static void
_S_do_it(_Tp* __restrict__ __b, _Tp* __restrict__ __e)
{ memset(__b, 0, __e - __b); }
{ memset(__b, 0, (__e - __b)*sizeof(_Tp)); }
};
template<typename _Tp>
......@@ -135,7 +135,7 @@ namespace std
inline static void
_S_do_it(const _Tp* __restrict__ __b, const _Tp* __restrict__ __e,
_Tp* __restrict__ __o)
{ memcpy(__o, __b, __e - __b); }
{ memcpy(__o, __b, (__e - __b)*sizeof(_Tp)); }
};
template<typename _Tp>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment