X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=include%2Fipatch.h;h=bf26e8b45e5507b3d82177f54def97ecf8734d64;hb=798424f096a68e4cebb7ccb350cfd4b1ae91e359;hp=e9bee3d79bbc0bcf7d42bfefa84c07647f364bf2;hpb=3c73487420fde8d4a3b5360d8b99e48132517900;p=xonotic%2Fnetradiant.git diff --git a/include/ipatch.h b/include/ipatch.h index e9bee3d7..bf26e8b4 100644 --- a/include/ipatch.h +++ b/include/ipatch.h @@ -22,6 +22,8 @@ #if !defined( INCLUDED_IPATCH_H ) #define INCLUDED_IPATCH_H +#include "globaldefs.h" +#include "debugging/debugging.h" #include "generic/constant.h" #include "generic/vector.h" @@ -61,13 +63,13 @@ const_iterator end() const { } value_type& operator[]( std::size_t index ){ -#if defined( _DEBUG ) +#if GDEF_DEBUG ASSERT_MESSAGE( index < size(), "array index out of bounds" ); #endif return m_data[index]; } const value_type& operator[]( std::size_t index ) const { -#if defined( _DEBUG ) +#if GDEF_DEBUG ASSERT_MESSAGE( index < size(), "array index out of bounds" ); #endif return m_data[index]; @@ -166,25 +168,25 @@ const_iterator end() const { } value_type& operator[]( std::size_t index ){ -#if defined( _DEBUG ) +#if GDEF_DEBUG ASSERT_MESSAGE( index < size(), "array index out of bounds" ); #endif return m_data[index]; } const value_type& operator[]( std::size_t index ) const { -#if defined( _DEBUG ) +#if GDEF_DEBUG ASSERT_MESSAGE( index < size(), "array index out of bounds" ); #endif return m_data[index]; } value_type& operator()( std::size_t x, std::size_t y ){ -#if defined( _DEBUG ) +#if GDEF_DEBUG ASSERT_MESSAGE( x < m_x && y < m_y, "array index out of bounds" ); #endif return m_data[x * m_y + y]; } const value_type& operator()( std::size_t x, std::size_t y ) const { -#if defined( _DEBUG ) +#if GDEF_DEBUG ASSERT_MESSAGE( x < m_x && y < m_y, "array index out of bounds" ); #endif return m_data[x * m_y + y];