Skip to content

Commit

Permalink
Fix memmove warnings in utlvector with clang (alliedmodders#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
zer0k-z authored Oct 30, 2023
1 parent fec44c3 commit 2a20036
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions public/tier1/utlvector.h
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,7 @@ void CUtlVector<T, A>::ShiftElementsRight( int elem, int num )
Assert( IsValidIndex(elem) || ( m_Size == 0 ) || ( num == 0 ));
int numToMove = m_Size - elem - num;
if ((numToMove > 0) && (num > 0))
memmove( &Element(elem+num), &Element(elem), numToMove * sizeof(T) );
memmove( (void*)&Element(elem+num), (void*)&Element(elem), numToMove * sizeof(T) );
}

template< typename T, class A >
Expand All @@ -739,10 +739,10 @@ void CUtlVector<T, A>::ShiftElementsLeft( int elem, int num )
int numToMove = m_Size - elem - num;
if ((numToMove > 0) && (num > 0))
{
memmove( &Element(elem), &Element(elem+num), numToMove * sizeof(T) );
memmove( (void*)&Element(elem), (void*)&Element(elem+num), numToMove * sizeof(T) );

#ifdef _DEBUG
Q_memset( &Element(m_Size-num), 0xDD, num * sizeof(T) );
Q_memset( (void*)&Element(m_Size-num), 0xDD, num * sizeof(T) );
#endif
}
}
Expand Down

0 comments on commit 2a20036

Please sign in to comment.