summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2009-02-02 15:26:13 +0000
committerMarc Espie <espie@cvs.openbsd.org>2009-02-02 15:26:13 +0000
commit682fde97c5d9681eb7d9e4b7f296dff843cd8b62 (patch)
tree9d6ad9ea492cd76332751ce8172d673f67d5d14b
parent1bd1a7b74b42175e1c93d58a1851fcb1947e811e (diff)
pedantic fixes: remove wrong token pasting.
Reduces drastically the number of warnings one gets when compiling old library with newer preprocessor. tests and okay miod@
-rw-r--r--gnu/egcs/libstdc++/std/gslice_array.h4
-rw-r--r--gnu/egcs/libstdc++/std/indirect_array.h4
-rw-r--r--gnu/egcs/libstdc++/std/mask_array.h4
-rw-r--r--gnu/egcs/libstdc++/std/slice_array.h4
-rw-r--r--gnu/egcs/libstdc++/std/std_valarray.h20
-rw-r--r--gnu/egcs/libstdc++/std/valarray_meta.h29
6 files changed, 33 insertions, 32 deletions
diff --git a/gnu/egcs/libstdc++/std/gslice_array.h b/gnu/egcs/libstdc++/std/gslice_array.h
index 8a67cac9050..9ea61ffc03c 100644
--- a/gnu/egcs/libstdc++/std/gslice_array.h
+++ b/gnu/egcs/libstdc++/std/gslice_array.h
@@ -133,7 +133,7 @@ gslice_array<_Tp>::operator= (const _Expr<E, _Tp>& __e) const
#define _DEFINE_VALARRAY_OPERATOR(op, name) \
template<typename _Tp> \
inline void \
-gslice_array<_Tp>::operator##op##= (const valarray<_Tp>& __v) const \
+gslice_array<_Tp>::operator op##= (const valarray<_Tp>& __v) const \
{ \
_Array_augmented_##name (_M_array, _Array<size_t>(_M_index), \
_Array<_Tp> (__v), __v.size ()); \
@@ -141,7 +141,7 @@ gslice_array<_Tp>::operator##op##= (const valarray<_Tp>& __v) const \
\
template<typename _Tp> template<class E> \
inline void \
-gslice_array<_Tp>::operator##op##= (const _Expr<E, _Tp>& __e) const \
+gslice_array<_Tp>::operator op##= (const _Expr<E, _Tp>& __e) const \
{ \
_Array_augmented_##name (_M_array, _Array<size_t>(_M_index), __e, \
_M_index.size()); \
diff --git a/gnu/egcs/libstdc++/std/indirect_array.h b/gnu/egcs/libstdc++/std/indirect_array.h
index bb5b79fb834..8bee79e27b5 100644
--- a/gnu/egcs/libstdc++/std/indirect_array.h
+++ b/gnu/egcs/libstdc++/std/indirect_array.h
@@ -123,14 +123,14 @@ indirect_array<_Tp>::operator= (const _Expr<_Dom,_Tp>& __e) const
#define _DEFINE_VALARRAY_OPERATOR(op, name) \
template<typename _Tp> \
inline void \
-indirect_array<_Tp>::operator##op##= (const valarray<_Tp>& __v) const \
+indirect_array<_Tp>::operator op##= (const valarray<_Tp>& __v) const \
{ \
_Array_augmented_##name (_M_array, _M_index, _Array<_Tp> (__v), _M_sz); \
} \
\
template<typename _Tp> template<class _Dom> \
inline void \
-indirect_array<_Tp>::operator##op##= (const _Expr<_Dom,_Tp>& __e) const \
+indirect_array<_Tp>::operator op##= (const _Expr<_Dom,_Tp>& __e) const \
{ \
_Array_augmented_##name (_M_array, _M_index, __e, _M_sz); \
}
diff --git a/gnu/egcs/libstdc++/std/mask_array.h b/gnu/egcs/libstdc++/std/mask_array.h
index d431be4e97f..95f65185059 100644
--- a/gnu/egcs/libstdc++/std/mask_array.h
+++ b/gnu/egcs/libstdc++/std/mask_array.h
@@ -119,7 +119,7 @@ mask_array<_T>::operator= (const _Expr<E, _T>& __e) const
#define _DEFINE_VALARRAY_OPERATOR(op, name) \
template<typename _T> \
inline void \
-mask_array<_T>::operator##op##= (const valarray<_T>& __v) const \
+mask_array<_T>::operator op##= (const valarray<_T>& __v) const \
{ \
_Array_augmented_##name (_M_array, _M_mask, \
_Array<_T> (__v), __v.size ()); \
@@ -127,7 +127,7 @@ mask_array<_T>::operator##op##= (const valarray<_T>& __v) const \
\
template<typename _T> template<class E> \
inline void \
-mask_array<_T>::operator##op##= (const _Expr<E, _T>& __e) const \
+mask_array<_T>::operator op##= (const _Expr<E, _T>& __e) const \
{ \
_Array_augmented_##name (_M_array, _M_mask, __e, __e.size ()); \
}
diff --git a/gnu/egcs/libstdc++/std/slice_array.h b/gnu/egcs/libstdc++/std/slice_array.h
index dc1aa34d355..8176d69e1a1 100644
--- a/gnu/egcs/libstdc++/std/slice_array.h
+++ b/gnu/egcs/libstdc++/std/slice_array.h
@@ -121,14 +121,14 @@ slice_array<_T>::operator= (const _Expr<_Dom,_T>& __e) const
#define _DEFINE_VALARRAY_OPERATOR(op, name) \
template<typename _T> \
inline void \
-slice_array<_T>::operator##op##= (const valarray<_T>& __v) const \
+slice_array<_T>::operator op##= (const valarray<_T>& __v) const \
{ \
_Array_augmented_##name (_M_array, _M_sz, _M_stride, _Array<_T> (__v));\
} \
\
template<typename _T> template<class _Dom> \
inline void \
-slice_array<_T>::operator##op##= (const _Expr<_Dom,_T>& __e) const \
+slice_array<_T>::operator op##= (const _Expr<_Dom,_T>& __e) const \
{ \
_Array_augmented_##name (_M_array, _M_stride, __e, _M_sz); \
}
diff --git a/gnu/egcs/libstdc++/std/std_valarray.h b/gnu/egcs/libstdc++/std/std_valarray.h
index b3006555547..dc15b5909bd 100644
--- a/gnu/egcs/libstdc++/std/std_valarray.h
+++ b/gnu/egcs/libstdc++/std/std_valarray.h
@@ -568,7 +568,7 @@ valarray<_Tp>::apply (_Tp func (const _Tp &)) const
#define _DEFINE_VALARRAY_UNARY_OPERATOR(_Op, _Name) \
template<typename _Tp> \
inline _Expr<_UnClos<_Name,_ValArray,_Tp>, _Tp> \
- valarray<_Tp>::operator##_Op() const \
+ valarray<_Tp>::operator _Op() const \
{ \
typedef _UnClos<_Name,_ValArray,_Tp> _Closure; \
return _Expr<_Closure, _Tp> (_Closure (*this)); \
@@ -591,7 +591,7 @@ valarray<_Tp>::apply (_Tp func (const _Tp &)) const
#define _DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(_Op, _Name) \
template<class _Tp> \
inline valarray<_Tp> & \
- valarray<_Tp>::operator##_Op##= (const _Tp &__t) \
+ valarray<_Tp>::operator _Op##= (const _Tp &__t) \
{ \
_Array_augmented_##_Name (_Array<_Tp>(_M_data), _M_size, __t); \
return *this; \
@@ -599,7 +599,7 @@ valarray<_Tp>::apply (_Tp func (const _Tp &)) const
\
template<class _Tp> \
inline valarray<_Tp> & \
- valarray<_Tp>::operator##_Op##= (const valarray<_Tp> &__v) \
+ valarray<_Tp>::operator _Op##= (const valarray<_Tp> &__v) \
{ \
_Array_augmented_##_Name (_Array<_Tp>(_M_data), _M_size, \
_Array<_Tp>(__v._M_data)); \
@@ -623,7 +623,7 @@ _DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT(>>, shift_right)
#define _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(_Op, _Name) \
template<class _Tp> template<class _Dom> \
inline valarray<_Tp> & \
- valarray<_Tp>::operator##_Op##= (const _Expr<_Dom,_Tp> &__e) \
+ valarray<_Tp>::operator _Op##= (const _Expr<_Dom,_Tp> &__e) \
{ \
_Array_augmented_##_Name (_Array<_Tp>(_M_data), __e, _M_size); \
return *this; \
@@ -646,7 +646,7 @@ _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(>>, shift_right)
#define _DEFINE_BINARY_OPERATOR(_Op, _Name) \
template<typename _Tp> \
inline _Expr<_BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp>, _Tp> \
- operator##_Op (const valarray<_Tp> &__v, const valarray<_Tp> &__w) \
+ operator _Op (const valarray<_Tp> &__v, const valarray<_Tp> &__w) \
{ \
typedef _BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp> _Closure; \
return _Expr<_Closure, _Tp> (_Closure (__v, __w)); \
@@ -654,7 +654,7 @@ _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(>>, shift_right)
\
template<typename _Tp> \
inline _Expr<_BinClos<_Name,_ValArray,_Constant,_Tp,_Tp>,_Tp> \
- operator##_Op (const valarray<_Tp> &__v, const _Tp &__t) \
+ operator _Op (const valarray<_Tp> &__v, const _Tp &__t) \
{ \
typedef _BinClos<_Name,_ValArray,_Constant,_Tp,_Tp> _Closure; \
return _Expr<_Closure, _Tp> (_Closure (__v, __t)); \
@@ -662,7 +662,7 @@ _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(>>, shift_right)
\
template<typename _Tp> \
inline _Expr<_BinClos<_Name,_Constant,_ValArray,_Tp,_Tp>,_Tp> \
- operator##_Op (const _Tp &__t, const valarray<_Tp> &__v) \
+ operator _Op (const _Tp &__t, const valarray<_Tp> &__v) \
{ \
typedef _BinClos<_Name,_Constant,_ValArray,_Tp,_Tp> _Closure; \
return _Expr<_Closure, _Tp> (_Closure (__t, __v)); \
@@ -684,7 +684,7 @@ _DEFINE_BINARY_OPERATOR(>>, _Shift_right)
#define _DEFINE_LOGICAL_OPERATOR(_Op, _Name) \
template<typename _Tp> \
inline _Expr<_BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp>,bool> \
- operator##_Op (const valarray<_Tp> &__v, const valarray<_Tp> &__w) \
+ operator _Op (const valarray<_Tp> &__v, const valarray<_Tp> &__w) \
{ \
typedef _BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp> _Closure; \
return _Expr<_Closure, bool> (_Closure (__v, __w)); \
@@ -692,7 +692,7 @@ _DEFINE_BINARY_OPERATOR(>>, _Shift_right)
\
template<class _Tp> \
inline _Expr<_BinClos<_Name,_ValArray,_Constant,_Tp,_Tp>,bool> \
- operator##_Op (const valarray<_Tp> &__v, const _Tp &__t) \
+ operator _Op (const valarray<_Tp> &__v, const _Tp &__t) \
{ \
typedef _BinClos<_Name,_ValArray,_Constant,_Tp,_Tp> _Closure; \
return _Expr<_Closure, bool> (_Closure (__v, __t)); \
@@ -700,7 +700,7 @@ _DEFINE_BINARY_OPERATOR(>>, _Shift_right)
\
template<class _Tp> \
inline _Expr<_BinClos<_Name,_Constant,_ValArray,_Tp,_Tp>,bool> \
- operator##_Op (const _Tp &__t, const valarray<_Tp> &__v) \
+ operator _Op (const _Tp &__t, const valarray<_Tp> &__v) \
{ \
typedef _BinClos<_Name,_Constant,_ValArray,_Tp,_Tp> _Closure; \
return _Expr<_Closure, bool> (_Closure (__t, __v)); \
diff --git a/gnu/egcs/libstdc++/std/valarray_meta.h b/gnu/egcs/libstdc++/std/valarray_meta.h
index f799111c7bc..a9dc00b3f7b 100644
--- a/gnu/egcs/libstdc++/std/valarray_meta.h
+++ b/gnu/egcs/libstdc++/std/valarray_meta.h
@@ -449,7 +449,7 @@ struct _BinClos<_Oper,_ValArray,_Expr,typename _Dom::value_type,_Dom>
typedef _BinBase<_Oper,valarray<_Tp>,_Dom> _Base;
typedef typename _Base::value_type value_type;
- _BinClos (const valarray<_Tp> __e1, const _Dom& __e2)
+ _BinClos (const valarray<_Tp>& __e1, const _Dom& __e2)
: _Base (__e1, __e2) {}
};
@@ -755,7 +755,7 @@ _Expr<_Dom,_Tp>::operator! () const
#define _DEFINE_EXPR_UNARY_OPERATOR(_Op, _Name) \
template<class _Dom, typename _Tp> \
inline _Expr<_UnClos<_Name,_Expr,_Dom>,_Tp> \
-_Expr<_Dom,_Tp>::operator##_Op () const \
+_Expr<_Dom,_Tp>::operator _Op () const \
{ \
typedef _UnClos<_Name,_Expr,_Dom> _Closure; \
return _Expr<_Closure,_Tp> (_Closure (this->_M_closure)); \
@@ -772,7 +772,7 @@ _Expr<_Dom,_Tp>::operator##_Op () const \
template<class _Dom1, class _Dom2> \
inline _Expr<_BinClos<_Name,_Expr,_Expr,_Dom1,_Dom2>, \
typename _Name<typename _Dom1::value_type>::result_type> \
-operator##_Op (const _Expr<_Dom1,typename _Dom1::value_type>& __v, \
+operator _Op (const _Expr<_Dom1,typename _Dom1::value_type>& __v, \
const _Expr<_Dom2,typename _Dom2::value_type>& __w) \
{ \
typedef typename _Dom1::value_type _Arg; \
@@ -784,7 +784,7 @@ operator##_Op (const _Expr<_Dom1,typename _Dom1::value_type>& __v, \
template<class _Dom> \
inline _Expr<_BinClos<_Name,_Expr,_Constant,_Dom,typename _Dom::value_type>, \
typename _Name<typename _Dom::value_type>::result_type> \
-operator##_Op (const _Expr<_Dom,typename _Dom::value_type>& __v, \
+operator _Op (const _Expr<_Dom,typename _Dom::value_type>& __v, \
const typename _Dom::value_type& __t) \
{ \
typedef typename _Dom::value_type _Arg; \
@@ -796,7 +796,7 @@ operator##_Op (const _Expr<_Dom,typename _Dom::value_type>& __v, \
template<class _Dom> \
inline _Expr<_BinClos<_Name,_Constant,_Expr,typename _Dom::value_type,_Dom>, \
typename _Name<typename _Dom::value_type>::result_type> \
-operator##_Op (const typename _Dom::value_type& __t, \
+operator _Op (const typename _Dom::value_type& __t, \
const _Expr<_Dom,typename _Dom::value_type>& __v) \
{ \
typedef typename _Dom::value_type _Arg; \
@@ -808,7 +808,7 @@ operator##_Op (const typename _Dom::value_type& __t, \
template<class _Dom> \
inline _Expr<_BinClos<_Name,_Expr,_ValArray,_Dom,typename _Dom::value_type>, \
typename _Name<typename _Dom::value_type>::result_type> \
-operator##_Op (const _Expr<_Dom,typename _Dom::value_type>& __e, \
+operator _Op (const _Expr<_Dom,typename _Dom::value_type>& __e, \
const valarray<typename _Dom::value_type>& __v) \
{ \
typedef typename _Dom::value_type _Arg; \
@@ -820,7 +820,7 @@ operator##_Op (const _Expr<_Dom,typename _Dom::value_type>& __e, \
template<class _Dom> \
inline _Expr<_BinClos<_Name,_ValArray,_Expr,typename _Dom::value_type,_Dom>, \
typename _Name<typename _Dom::value_type>::result_type> \
-operator##_Op (const valarray<typename _Dom::value_type>& __v, \
+operator _Op (const valarray<typename _Dom::value_type>& __v, \
const _Expr<_Dom,typename _Dom::value_type>& __e) \
{ \
typedef typename _Dom::value_type _Tp; \
@@ -845,7 +845,7 @@ operator##_Op (const valarray<typename _Dom::value_type>& __v, \
#define _DEFINE_EXPR_RELATIONAL_OPERATOR(_Op, _Name) \
template<class _Dom1, class _Dom2> \
inline _Expr<_BinClos<_Name,_Expr,_Expr,_Dom1,_Dom2>, bool> \
-operator##_Op (const _Expr<_Dom1,typename _Dom1::value_type>& __v, \
+operator _Op (const _Expr<_Dom1,typename _Dom1::value_type>& __v, \
const _Expr<_Dom2,typename _Dom2::value_type>& __w) \
{ \
typedef typename _Dom1::value_type _Arg; \
@@ -856,7 +856,7 @@ operator##_Op (const _Expr<_Dom1,typename _Dom1::value_type>& __v, \
template<class _Dom> \
inline _Expr<_BinClos<_Name,_Expr,_Constant,_Dom,typename _Dom::value_type>, \
bool> \
-operator##_Op (const _Expr<_Dom,typename _Dom::value_type>& __v, \
+operator _Op (const _Expr<_Dom,typename _Dom::value_type>& __v, \
const typename _Dom::value_type& __t) \
{ \
typedef typename _Dom::value_type _Arg; \
@@ -867,7 +867,7 @@ operator##_Op (const _Expr<_Dom,typename _Dom::value_type>& __v, \
template<class _Dom> \
inline _Expr<_BinClos<_Name,_Constant,_Expr,typename _Dom::value_type,_Dom>, \
bool> \
-operator##_Op (const typename _Dom::value_type& __t, \
+operator _Op (const typename _Dom::value_type& __t, \
const _Expr<_Dom,typename _Dom::value_type>& __v) \
{ \
typedef typename _Dom::value_type _Arg; \
@@ -878,7 +878,7 @@ operator##_Op (const typename _Dom::value_type& __t, \
template<class _Dom> \
inline _Expr<_BinClos<_Name,_Expr,_ValArray,_Dom,typename _Dom::value_type>, \
bool> \
-operator##_Op (const _Expr<_Dom,typename _Dom::value_type>& __e, \
+operator _Op (const _Expr<_Dom,typename _Dom::value_type>& __e, \
const valarray<typename _Dom::value_type>& __v) \
{ \
typedef typename _Dom::value_type _Tp; \
@@ -889,7 +889,7 @@ operator##_Op (const _Expr<_Dom,typename _Dom::value_type>& __e, \
template<class _Dom> \
inline _Expr<_BinClos<_Name,_ValArray,_Expr,typename _Dom::value_type,_Dom>, \
bool> \
-operator##_Op (const valarray<typename _Dom::value_type>& __v, \
+operator _Op (const valarray<typename _Dom::value_type>& __v, \
const _Expr<_Dom,typename _Dom::value_type>& __e) \
{ \
typedef typename _Dom::value_type _Tp; \
@@ -917,7 +917,7 @@ _Name(const _Expr<_Dom,typename _Dom::value_type>& __e) \
{ \
typedef typename _Dom::value_type _Tp; \
typedef _UnFunClos<_Expr,_Dom> _Closure; \
- return _Expr<_Closure,_Tp> (_Closure (__e, (_Tp(*)(_Tp))(&_Name))); \
+ return _Expr<_Closure,_Tp>(_Closure(__e(), (_Tp(*)(_Tp))(&_Name))); \
} \
\
template<typename _Tp> \
@@ -936,7 +936,8 @@ _Name(const valarray<_Tp>& __v) \
_DEFINE_EXPR_UNARY_FUNCTION(sin)
_DEFINE_EXPR_UNARY_FUNCTION(asin)
_DEFINE_EXPR_UNARY_FUNCTION(sinh)
- _DEFINE_EXPR_UNARY_FUNCTION(tan)
+ _DEFINE_EXPR_UNARY_FUNCTION(tan)
+ _DEFINE_EXPR_UNARY_FUNCTION(tanh)
_DEFINE_EXPR_UNARY_FUNCTION(atan)
_DEFINE_EXPR_UNARY_FUNCTION(exp)
_DEFINE_EXPR_UNARY_FUNCTION(log)