<html><head></head><body><div class="gmail_quote">Le 26 juillet 2017 12:05:08 GMT+03:00, Steve Lhomme <robux4@videolabs.io> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">Since we assume obj = priv + 1 that means we assume the offset between the 2<br />structures is always sizeof(vlc_object_internals_t).<br />---<br /> src/misc/variables.h | 6 +++---<br /> 1 file changed, 3 insertions(+), 3 deletions(-)<br /><br />diff --git a/src/misc/variables.h b/src/misc/variables.h<br />index bab14c8567..4b925848a1 100644<br />--- a/src/misc/variables.h<br />+++ b/src/misc/variables.h<br />@@ -58,9 +58,9 @@ struct vlc_object_internals<br /> max_align_t aligned_end[];<br /> };<br /> <br />-# define vlc_internals(obj) \<br />- container_of(VLC_OBJECT(obj), struct vlc_object_internals, aligned_end)<br />-# define vlc_externals(priv ) ((vlc_object_t *)((priv)->aligned_end))<br />+# define vlc_internals(obj) (((vlc_object_internals_t*) obj) - 1)<br />+# define vlc_externals(priv) \<br />+ ((vlc_object_t *)(((vlc_object_internals_t*) priv) + 1))<br /> <br /> void DumpVariables(vlc_object_t *obj);<br /> </pre></blockquote></div><br clear="all">Looks ok<br>
-- <br>
Rémi Denis-Courmont<br>
Typed on an inconvenient virtual keyboard</body></html>