Commit 81a45bed authored by Filippo Carone's avatar Filippo Carone

logger_iterator_next simplied

parent 7573989d
...@@ -158,14 +158,17 @@ int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_ex ...@@ -158,14 +158,17 @@ int libvlc_log_iterator_has_next( const libvlc_log_iterator_t *p_iter, libvlc_ex
} }
libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter, libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
struct libvlc_log_message_t *buffer, libvlc_log_message_t *buffer,
libvlc_exception_t *p_e ) libvlc_exception_t *p_e )
{ {
if( p_iter ) int i_pos;
{
if( buffer && (sizeof(struct libvlc_log_message_t) == buffer->sizeof_msg) ) if( !p_iter )
{ RAISENULL("Invalid log iterator!");
int i_pos = p_iter->i_pos; if( !buffer )
RAISENULL("Invalid message buffer!");
i_pos = p_iter->i_pos;
if( i_pos != p_iter->i_end ) if( i_pos != p_iter->i_end )
{ {
msg_item_t *msg; msg_item_t *msg;
...@@ -182,9 +185,5 @@ libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter, ...@@ -182,9 +185,5 @@ libvlc_log_message_t *libvlc_log_iterator_next( libvlc_log_iterator_t *p_iter,
return buffer; return buffer;
} }
RAISENULL("No more messages"); RAISENULL("No more messages");
}
RAISENULL("Invalid message buffer!");
}
RAISENULL("Invalid log iterator!");
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment