[MPlayer-cvslog] r21385 - trunk/libvo/osd_template.c

Michael Niedermayer michaelni at gmx.at
Fri Dec 1 20:34:46 CET 2006


Hi

On Fri, Dec 01, 2006 at 06:57:31PM +0100, Reimar Döffinger wrote:
> Hello,
> On Fri, Dec 01, 2006 at 11:23:02AM +0100, Diego Biurrun wrote:
> > On Wed, Nov 29, 2006 at 03:46:51PM +0100, Reimar Döffinger wrote:
> > > On Wed, Nov 29, 2006 at 03:30:25PM +0100, Diego Biurrun wrote:
> > > > On Wed, Nov 29, 2006 at 02:49:48PM +0100, reimar wrote:
> > > > > 
> > > > > Modified:
> > > > >    trunk/libvo/osd_template.c
> > > > > 
> > > > > --- trunk/libvo/osd_template.c	(original)
> > > > > +++ trunk/libvo/osd_template.c	Wed Nov 29 14:49:48 2006
> > > > > @@ -204,7 +204,7 @@
> > > > >      for(y=0;y<h;y++){
> > > > >          register unsigned char *dst = dstbase;
> > > > >          register int x;
> > > > > -#ifdef ARCH_X86
> > > > > +#if defined(ARCH_X86) && (!defined(ARCH_X86_64) || defined(HAVE_MMX))
> > > > >  #ifdef HAVE_MMX
> > > > >      asm volatile(
> > > > >  	PREFETCHW" %0\n\t"
> > > > > @@ -277,7 +277,7 @@
> > > > >  	    dst += 3;
> > > > >          }
> > > > >  #endif /* !HAVE_MMX */
> > > > > -#else /*non x86 arch*/
> > > > > +#else /*non x86 arch or x86_64 with MMX disabled */
> > > > 
> > > > This is backwards, same below.
> > > 
> > > Well, I always thought the way it is normally written is backwards :-).
> > > Anyway, I just made my comment fit what was there before.
> > 
> > So can we make up a policy about this?  IMO the comments after #else and
> > #endif should always contain exactly what the #if line contained.
> > Everything else is either confusing or a pain to search backwards to...
> 
> Yes, of course, that's the only way that overall makes sense, which one

i disagree, one sane way is to make the condition match what the argument
of a #if would be if there where a #if there

#if HAVE_MMX
a few pages of mmx code
#else //!HAVE_MMX
a few pages of c code
#endif //!HAVE_MMX

and

#if HAVE_MMX
a few pages of mmx code
#endif //HAVE_MMX

otherwise when you see just the endif the comment becomes useless as its
meaning would flip depending on the existence of a #else a few pages up

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is



More information about the MPlayer-cvslog mailing list