@@ -169,8 +169,8 @@ RingBuffer::set_value( const long offs, const double v )
169169inline double
170170RingBuffer::get_value ( const long offs )
171171{
172- assert ( 0 <= offs and ( size_t ) offs < buffer_.size () );
173- assert ( ( long ) offs < kernel ().connection_manager .get_min_delay () );
172+ assert ( 0 <= offs and static_cast < size_t >( offs ) < buffer_.size () );
173+ assert ( offs < kernel ().connection_manager .get_min_delay () );
174174
175175 // offs == 0 is beginning of slice, but we have to
176176 // take modulo into account when indexing
@@ -183,8 +183,8 @@ RingBuffer::get_value( const long offs )
183183inline double
184184RingBuffer::get_value_wfr_update ( const long offs )
185185{
186- assert ( 0 <= offs and ( size_t ) offs < buffer_.size () );
187- assert ( ( long ) offs < kernel ().connection_manager .get_min_delay () );
186+ assert ( 0 <= offs and static_cast < size_t >( offs ) < buffer_.size () );
187+ assert ( offs < kernel ().connection_manager .get_min_delay () );
188188
189189 // offs == 0 is beginning of slice, but we have to
190190 // take modulo into account when indexing
@@ -198,7 +198,7 @@ RingBuffer::get_index_( const long d ) const
198198{
199199 const long idx = kernel ().event_delivery_manager .get_modulo ( d );
200200 assert ( 0 <= idx );
201- assert ( ( size_t ) idx < buffer_.size () );
201+ assert ( static_cast < size_t >( idx ) < buffer_.size () );
202202 return idx;
203203}
204204
@@ -258,15 +258,15 @@ class MultRBuffer
258258inline void
259259MultRBuffer::add_value ( const long offs, const double v )
260260{
261- assert ( 0 <= offs and ( size_t ) offs < buffer_.size () );
261+ assert ( 0 <= offs and static_cast < size_t >( offs ) < buffer_.size () );
262262 buffer_[ get_index_ ( offs ) ] *= v;
263263}
264264
265265inline double
266266MultRBuffer::get_value ( const long offs )
267267{
268- assert ( 0 <= offs and ( size_t ) offs < buffer_.size () );
269- assert ( ( long ) offs < kernel ().connection_manager .get_min_delay () );
268+ assert ( 0 <= offs and static_cast < size_t >( offs ) < buffer_.size () );
269+ assert ( offs < kernel ().connection_manager .get_min_delay () );
270270
271271 // offs == 0 is beginning of slice, but we have to
272272 // take modulo into account when indexing
@@ -280,7 +280,7 @@ inline size_t
280280MultRBuffer::get_index_ ( const long d ) const
281281{
282282 const long idx = kernel ().event_delivery_manager .get_modulo ( d );
283- assert ( 0 <= idx and ( size_t ) idx < buffer_.size () );
283+ assert ( 0 <= idx and static_cast < size_t >( idx ) < buffer_.size () );
284284 return idx;
285285}
286286
@@ -346,8 +346,8 @@ ListRingBuffer::append_value( const long offs, const double v )
346346inline std::list< double >&
347347ListRingBuffer::get_list ( const long offs )
348348{
349- assert ( 0 <= offs and ( size_t ) offs < buffer_.size () );
350- assert ( ( long ) offs < kernel ().connection_manager .get_min_delay () );
349+ assert ( 0 <= offs and static_cast < size_t >( offs ) < buffer_.size () );
350+ assert ( offs < kernel ().connection_manager .get_min_delay () );
351351
352352 // offs == 0 is beginning of slice, but we have to
353353 // take modulo into account when indexing
@@ -360,7 +360,7 @@ ListRingBuffer::get_index_( const long d ) const
360360{
361361 const long idx = kernel ().event_delivery_manager .get_modulo ( d );
362362 assert ( 0 <= idx );
363- assert ( ( size_t ) idx < buffer_.size () );
363+ assert ( static_cast < size_t >( idx ) < buffer_.size () );
364364 return idx;
365365}
366366
0 commit comments