[FFmpeg-devel] [PATCH/RFC] intreadwrite.h rewrite

Michael Niedermayer michaelni
Mon Apr 6 20:25:50 CEST 2009


On Mon, Apr 06, 2009 at 07:07:25PM +0100, M?ns Rullg?rd wrote:
> Michael Niedermayer <michaelni at gmx.at> writes:
> 
> > On Sun, Apr 05, 2009 at 11:42:24PM +0100, M?ns Rullg?rd wrote:
> >> I would like to propose a rework of intreadwrite.h.  This new version
> >> supports per-arch implementations of the various macros allowing us to
> >> take advantage of special instructions or other properties the
> >> compiler does not know about.
> >
> > [...]
> >
> >> /*
> >>  * GCC fails miserably on the packed struct version which is used by
> >>  * default, so we override it here.
> >>  */
> >> 
> >> #define AV_RB64 AV_RB64
> >> static inline uint64_t AV_RB64(const void *p)
> >> {
> >>     return *(const uint64_t *)p;
> >> }
> >> 
> >> #define AV_WB64 AV_WB64
> >> static inline void AV_WB64(void *p, uint64_t v)
> >> {
> >>     *(uint64_t *)p = v;
> >> }
> >> 
> >
> > why are these inline functions instead of macros?
> 
> No reason.  I can certainly change it.

please do, if its simpler

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090406/b6ed37e9/attachment.pgp>



More information about the ffmpeg-devel mailing list