Changeset 1953:50f564826d28 in roaraudio
- Timestamp:
- 06/11/09 02:50:05 (15 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroar/buffer.c
r1215 r1953 126 126 127 127 int roar_buffer_add (struct roar_buffer * buf, struct roar_buffer * next) { 128 unsigned int deep = 0; 129 128 130 if ( buf == NULL ) 129 131 return -1; 130 132 131 133 ROAR_DBG("buffer_add(buf=%p, next=%p) = ?", buf, next); 134 135 if ( buf == next ) { 136 ROAR_ERR("buffer_add(*): both pointer are of the same destination, This is a error in the application"); 137 return -1; 138 } 132 139 133 140 while ( buf->next != NULL ) { … … 135 142 // ROAR_DBG("buffer_add(): buf=%p, buf->next=%p", buf, buf->next); 136 143 buf = buf->next; 144 deep++; 145 146 if ( buf == next ) { 147 ROAR_ERR("buffer_add(*): Can not add buffer: loop detected at deep %u. This is a error in the application", deep); 148 } 137 149 } 138 150 139 151 buf->next = next; 152 153 ROAR_DBG("buffer_add(*): adding buffer at deep %u", deep); 140 154 141 155 return 0;
Note: See TracChangeset
for help on using the changeset viewer.