@@ -761,7 +761,8 @@ class UAVCAN_EXPORT Array : public ArrayImpl<T, ArrayMode, MaxSize_>
761761 * Members must be comparable via operator ==.
762762 */
763763 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
765766 operator==(const R& rhs) const
766767 {
767768 if (size () != rhs.size ())
@@ -786,7 +787,8 @@ class UAVCAN_EXPORT Array : public ArrayImpl<T, ArrayMode, MaxSize_>
786787 * Any container with size() and [] is acceptable.
787788 */
788789 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
790792 isClose(const R& rhs) const
791793 {
792794 if (size () != rhs.size ())
@@ -809,7 +811,7 @@ class UAVCAN_EXPORT Array : public ArrayImpl<T, ArrayMode, MaxSize_>
809811 */
810812 bool operator ==(const char * ch) const
811813 {
812- if (ch == NULL )
814+ if (ch == UAVCAN_NULLPTR )
813815 {
814816 return false ;
815817 }
@@ -830,7 +832,7 @@ class UAVCAN_EXPORT Array : public ArrayImpl<T, ArrayMode, MaxSize_>
830832 StaticAssert<Base::IsStringLike>::check ();
831833 StaticAssert<IsDynamic>::check ();
832834 Base::clear ();
833- if (ch == NULL )
835+ if (ch == UAVCAN_NULLPTR )
834836 {
835837 handleFatalError (" Array::operator=(const char*)" );
836838 }
@@ -849,7 +851,7 @@ class UAVCAN_EXPORT Array : public ArrayImpl<T, ArrayMode, MaxSize_>
849851 {
850852 StaticAssert<Base::IsStringLike>::check ();
851853 StaticAssert<IsDynamic>::check ();
852- if (ch == NULL )
854+ if (ch == UAVCAN_NULLPTR )
853855 {
854856 handleFatalError (" Array::operator+=(const char*)" );
855857 }
@@ -1001,7 +1003,8 @@ class UAVCAN_EXPORT Array : public ArrayImpl<T, ArrayMode, MaxSize_>
10011003 * Note that matrix packing code uses @ref areClose() for comparison.
10021004 */
10031005 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
10051008 packSquareMatrix(const R& src_row_major)
10061009 {
10071010 if (src_row_major.size () == MaxSize)
@@ -1057,7 +1060,8 @@ class UAVCAN_EXPORT Array : public ArrayImpl<T, ArrayMode, MaxSize_>
10571060 * Please refer to the specification to learn more about matrix packing.
10581061 */
10591062 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
10611065 unpackSquareMatrix(R& dst_row_major) const
10621066 {
10631067 if (dst_row_major.size () == MaxSize)
0 commit comments