[vlc-commits] input/item: simplify call to vlc_event_send

Filip Roséen git at videolan.org
Tue Jan 10 15:31:24 CET 2017


vlc | branch: master | Filip Roséen <filip at atch.se> | Tue Jan 10 13:52:35 2017 +0100| [d31d9140d646893a073003338bc12cfe5d9c1e53] | committer: Thomas Guillem

input/item: simplify call to vlc_event_send

There's no need for a temporary local variable and the do-while
wrapping to limit its scope, instead these changes uses a
compound-literal.

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d31d9140d646893a073003338bc12cfe5d9c1e53
---

 src/input/item.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/input/item.c b/src/input/item.c
index b6a8667..4096893 100644
--- a/src/input/item.c
+++ b/src/input/item.c
@@ -1009,10 +1009,8 @@ void input_item_SetEpg( input_item_t *p_item, const vlc_epg_t *p_update, bool b_
     free( psz_epg );
 signal:
 #endif
-    do {
-        vlc_event_t event = { .type = vlc_InputItemInfoChanged, };
-        vlc_event_send( &p_item->event_manager, &event );
-    } while(0);
+    vlc_event_send( &p_item->event_manager,
+                    &(vlc_event_t){ .type = vlc_InputItemInfoChanged, } );
 }
 
 void input_item_ChangeEPGSource( input_item_t *p_item, int i_source_id )



More information about the vlc-commits mailing list