@@ -761,7 +761,8 @@ class UAVCAN_EXPORT Array : public ArrayImpl<T, ArrayMode, MaxSize_>
761
761
* Members must be comparable via operator ==.
762
762
*/
763
763
template <typename R>
764
- typename EnableIf<sizeof (((const R*)(0U ))->size ()) && sizeof((*((const R*)(0U )))[0]), bool>::Type
764
+ typename EnableIf<sizeof ((reinterpret_cast <const R*>(0 ))->size ()) &&
765
+ sizeof((*(reinterpret_cast <const R*>(0 )))[0]), bool>::Type
765
766
operator==(const R& rhs) const
766
767
{
767
768
if (size () != rhs.size ())
@@ -786,7 +787,8 @@ class UAVCAN_EXPORT Array : public ArrayImpl<T, ArrayMode, MaxSize_>
786
787
* Any container with size() and [] is acceptable.
787
788
*/
788
789
template <typename R>
789
- typename EnableIf<sizeof (((const R*)(0U ))->size ()) && sizeof((*((const R*)(0U )))[0]), bool>::Type
790
+ typename EnableIf<sizeof ((reinterpret_cast <const R*>(0 ))->size ()) &&
791
+ sizeof((*(reinterpret_cast <const R*>(0 )))[0]), bool>::Type
790
792
isClose(const R& rhs) const
791
793
{
792
794
if (size () != rhs.size ())
@@ -809,7 +811,7 @@ class UAVCAN_EXPORT Array : public ArrayImpl<T, ArrayMode, MaxSize_>
809
811
*/
810
812
bool operator ==(const char * ch) const
811
813
{
812
- if (ch == NULL )
814
+ if (ch == UAVCAN_NULLPTR )
813
815
{
814
816
return false ;
815
817
}
@@ -830,7 +832,7 @@ class UAVCAN_EXPORT Array : public ArrayImpl<T, ArrayMode, MaxSize_>
830
832
StaticAssert<Base::IsStringLike>::check ();
831
833
StaticAssert<IsDynamic>::check ();
832
834
Base::clear ();
833
- if (ch == NULL )
835
+ if (ch == UAVCAN_NULLPTR )
834
836
{
835
837
handleFatalError (" Array::operator=(const char*)" );
836
838
}
@@ -849,7 +851,7 @@ class UAVCAN_EXPORT Array : public ArrayImpl<T, ArrayMode, MaxSize_>
849
851
{
850
852
StaticAssert<Base::IsStringLike>::check ();
851
853
StaticAssert<IsDynamic>::check ();
852
- if (ch == NULL )
854
+ if (ch == UAVCAN_NULLPTR )
853
855
{
854
856
handleFatalError (" Array::operator+=(const char*)" );
855
857
}
@@ -1001,7 +1003,8 @@ class UAVCAN_EXPORT Array : public ArrayImpl<T, ArrayMode, MaxSize_>
1001
1003
* Note that matrix packing code uses @ref areClose() for comparison.
1002
1004
*/
1003
1005
template <typename R>
1004
- typename EnableIf<sizeof (((const R*)(0U ))->begin()) && sizeof(((const R*)(0U ))->size())>::Type
1006
+ typename EnableIf<sizeof ((reinterpret_cast <const R*>(0 ))->begin()) &&
1007
+ sizeof((reinterpret_cast <const R*>(0 ))->size())>::Type
1005
1008
packSquareMatrix(const R& src_row_major)
1006
1009
{
1007
1010
if (src_row_major.size () == MaxSize)
@@ -1057,7 +1060,8 @@ class UAVCAN_EXPORT Array : public ArrayImpl<T, ArrayMode, MaxSize_>
1057
1060
* Please refer to the specification to learn more about matrix packing.
1058
1061
*/
1059
1062
template <typename R>
1060
- typename EnableIf<sizeof (((const R*)(0U ))->begin ()) && sizeof(((const R*)(0U ))->size())>::Type
1063
+ typename EnableIf<sizeof ((reinterpret_cast <const R*>(0 ))->begin ()) &&
1064
+ sizeof((reinterpret_cast <const R*>(0 ))->size())>::Type
1061
1065
unpackSquareMatrix(R& dst_row_major) const
1062
1066
{
1063
1067
if (dst_row_major.size () == MaxSize)
0 commit comments