Loading src/TNL/Algorithms/MemoryOperationsSequential.hpp +14 −2 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ MemoryOperations< Devices::Sequential >:: setElement( Element* data, const Element& value ) { TNL_ASSERT_TRUE( data, "Attempted to set data through a nullptr." ); *data = value; } Loading @@ -31,6 +32,7 @@ Element MemoryOperations< Devices::Sequential >:: getElement( const Element* data ) { TNL_ASSERT_TRUE( data, "Attempted to get data through a nullptr." ); return *data; } Loading @@ -42,6 +44,8 @@ set( Element* data, const Element& value, const Index size ) { if( size == 0 ) return; TNL_ASSERT_TRUE( data, "Attempted to set data through a nullptr." ); for( Index i = 0; i < size; i++ ) data[ i ] = value; } Loading @@ -56,6 +60,10 @@ copy( DestinationElement* destination, const SourceElement* source, const Index size ) { if( size == 0 ) return; TNL_ASSERT_TRUE( destination, "Attempted to copy data to a nullptr." ); TNL_ASSERT_TRUE( source, "Attempted to copy data from a nullptr." ); for( Index i = 0; i < size; i++ ) destination[ i ] = source[ i ]; } Loading Loading @@ -87,6 +95,10 @@ compare( const Element1* destination, const Element2* source, const Index size ) { if( size == 0 ) return true; TNL_ASSERT_TRUE( destination, "Attempted to compare data through a nullptr." ); TNL_ASSERT_TRUE( source, "Attempted to compare data through a nullptr." ); for( Index i = 0; i < size; i++ ) if( ! ( destination[ i ] == source[ i ] ) ) return false; Loading Loading
src/TNL/Algorithms/MemoryOperationsSequential.hpp +14 −2 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ MemoryOperations< Devices::Sequential >:: setElement( Element* data, const Element& value ) { TNL_ASSERT_TRUE( data, "Attempted to set data through a nullptr." ); *data = value; } Loading @@ -31,6 +32,7 @@ Element MemoryOperations< Devices::Sequential >:: getElement( const Element* data ) { TNL_ASSERT_TRUE( data, "Attempted to get data through a nullptr." ); return *data; } Loading @@ -42,6 +44,8 @@ set( Element* data, const Element& value, const Index size ) { if( size == 0 ) return; TNL_ASSERT_TRUE( data, "Attempted to set data through a nullptr." ); for( Index i = 0; i < size; i++ ) data[ i ] = value; } Loading @@ -56,6 +60,10 @@ copy( DestinationElement* destination, const SourceElement* source, const Index size ) { if( size == 0 ) return; TNL_ASSERT_TRUE( destination, "Attempted to copy data to a nullptr." ); TNL_ASSERT_TRUE( source, "Attempted to copy data from a nullptr." ); for( Index i = 0; i < size; i++ ) destination[ i ] = source[ i ]; } Loading Loading @@ -87,6 +95,10 @@ compare( const Element1* destination, const Element2* source, const Index size ) { if( size == 0 ) return true; TNL_ASSERT_TRUE( destination, "Attempted to compare data through a nullptr." ); TNL_ASSERT_TRUE( source, "Attempted to compare data through a nullptr." ); for( Index i = 0; i < size; i++ ) if( ! ( destination[ i ] == source[ i ] ) ) return false; Loading