[vlc-devel] [vlc-commits] itml: fix the printf modifier for the pointer value

Steve Lhomme robux4 at ycbcr.xyz
Wed Jul 11 11:11:42 CEST 2018


On 2018-07-11 11:03, Filip Roséen wrote:
>
> Hi Steve,
>
> On 2018-07-11 08:52, Steve Lhomme wrote:
>
>     |vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jul
>     11 10:37:26 2018 +0200| [0e1886330f19fce5cdc47e6369ede560bdacaf72]
>     | committer: Steve Lhomme itml: fix the printf modifier for the
>     pointer value|
>
>
>               http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0e1886330f19fce5cdc47e6369ede560bdacaf72
>
>     |modules/demux/playlist/itml.c | 4 ++-- 1 file changed, 2
>     insertions(+), 2 deletions(-) diff --git
>     a/modules/demux/playlist/itml.c b/modules/demux/playlist/itml.c
>     index 449876f2d0..bb66765c19 100644 ---
>     a/modules/demux/playlist/itml.c +++
>     b/modules/demux/playlist/itml.c @@ -282,8 +282,8 @@ static bool
>     parse_tracks_dict( stream_t *p_demux, input_item_node_t
>     *p_input_nod parse_dict( p_demux, p_input_node, NULL,
>     p_xml_reader, "dict", tracks_elements ); - msg_Info( p_demux,
>     "added %zi tracks successfully", - (size_t)p_demux->p_sys ); +
>     msg_Info( p_demux, "added %" PRIiPTR " tracks successfully", +
>     p_demux->p_sys );|
>
> Even though the previous implementation was not correct (as the 
> bit-representation in |p_demux->p_sys| is a |uintptr_t| and not 
> |size_t|), this change is still in the wrong - and I must assume that 
> you got a warning from compiling the above.
>
> A cast to |uintptr_t| is necessary, and the format-specifier should be 
> using |PRIuPTR|. Though, it is certainly debatable whether |uintptr_t| 
> should be used in the code at all.
>

I think intptr_t would be more logical to respect the original %zi. But 
on the other hand the p_sys value is always used as a uintptr_t in the 
rest of the code so I guess it would be better.

>     |return true; } _______________________________________________
>     vlc-commits mailing list vlc-commits at videolan.org
>     https://mailman.videolan.org/listinfo/vlc-commits|
>
>
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel



More information about the vlc-devel mailing list