comparison libfdproto/fifo.c @ 1539:d25ce064c667

Correctly fix compiler warnings ASSERT() is only used #ifndef NDEBUG not #ifdef DEBUG Fixes Debug build.
author Luke Mewburn <luke@mewburn.net>
date Thu, 30 Apr 2020 15:24:47 +1000
parents 3cbe458fbfa9
children 566bb46cc73f
comparison
equal deleted inserted replaced
1538:7c9214a5f095 1539:d25ce064c667
168 168
169 /* Delete a queue. It must be empty. */ 169 /* Delete a queue. It must be empty. */
170 int fd_fifo_del ( struct fifo ** queue ) 170 int fd_fifo_del ( struct fifo ** queue )
171 { 171 {
172 struct fifo * q; 172 struct fifo * q;
173 #ifdef DEBUG 173 #ifndef NDEBUG
174 int loops = 0; 174 int loops = 0;
175 #endif 175 #endif
176 176
177 TRACE_ENTRY( "%p", queue ); 177 TRACE_ENTRY( "%p", queue );
178 178
225 } 225 }
226 226
227 /* Move the content of old into new, and update loc_update atomically. We leave the old queue empty but valid */ 227 /* Move the content of old into new, and update loc_update atomically. We leave the old queue empty but valid */
228 int fd_fifo_move ( struct fifo * old, struct fifo * new, struct fifo ** loc_update ) 228 int fd_fifo_move ( struct fifo * old, struct fifo * new, struct fifo ** loc_update )
229 { 229 {
230 #ifdef DEBUG 230 #ifndef NDEBUG
231 int loops = 0; 231 int loops = 0;
232 #endif 232 #endif
233 233
234 TRACE_ENTRY("%p %p %p", old, new, loc_update); 234 TRACE_ENTRY("%p %p %p", old, new, loc_update);
235 CHECK_PARAMS( CHECK_FIFO( old ) && CHECK_FIFO( new )); 235 CHECK_PARAMS( CHECK_FIFO( old ) && CHECK_FIFO( new ));
418 pthread_cleanup_push( fifo_cleanup_push, queue); 418 pthread_cleanup_push( fifo_cleanup_push, queue);
419 ret = pthread_cond_wait( &queue->cond_push, &queue->mtx ); 419 ret = pthread_cond_wait( &queue->cond_push, &queue->mtx );
420 pthread_cleanup_pop(0); 420 pthread_cleanup_pop(0);
421 queue->thrs_push-- ; 421 queue->thrs_push-- ;
422 422
423 #ifndef DEBUG 423 #ifdef NDEBUG
424 (void)ret; 424 (void)ret;
425 #endif 425 #endif
426 ASSERT( ret == 0 ); 426 ASSERT( ret == 0 );
427 } 427 }
428 } 428 }
"Welcome to our mercurial repository"