X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=blobdiff_plain;f=include%2Fipatch.h;h=bf26e8b45e5507b3d82177f54def97ecf8734d64;hp=81cba69a4ccbcf189a0947282b28532952390350;hb=0f2e4b773715b05595f1c149d99fcc4795e01948;hpb=83113718a4fb6a8e2318841f16f8a0b0eb85675c diff --git a/include/ipatch.h b/include/ipatch.h index 81cba69a..bf26e8b4 100644 --- a/include/ipatch.h +++ b/include/ipatch.h @@ -22,6 +22,7 @@ #if !defined( INCLUDED_IPATCH_H ) #define INCLUDED_IPATCH_H +#include "globaldefs.h" #include "debugging/debugging.h" #include "generic/constant.h" #include "generic/vector.h" @@ -62,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]; @@ -167,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];