glob2-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [glob2-devel] A lot of small changes.


From: Kai Antweiler
Subject: Re: [glob2-devel] A lot of small changes.
Date: Tue, 03 Apr 2007 21:49:29 +0200
User-agent: Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.20 (linux)

> After a little more testing, I found that this all compiles fine on my
> gentoo box, using gcc 3.2,3.3,3.4.6.
> The way you are using templates does compile on OS X gcc 4.0, but not 3.3.
> Could this be an OS X version of gcc issue?

Ok, then I'd say we release now without changing the code, but put
your experience into our wiki.
And we'll clean things up for the next release but one.


> Either way, even if it compiles...
>
> updateGlobalGradientSlow(Uint8 *gradient)
> {
>  if (size <= 65536)
>    updateGlobalGradientSlow<Uint16>(gradient);
>  else
>    updateGlobalGradientSlow<Uint32>(gradient);
> }
>
> seems like a very strange and counter-intuitive way of using templates.

I have never cared about that nontemplate function.  But when I look
at it now ... it does makes sense.  Well it lacks documentation and should
be inline.  Also it the template functions it calls, want another name
like: "updateGlobalGradientSlowAlgorithm".  This part of the code is
not about good looking style, but about fast execution.


>  Was there a specific reason that it was changed to use templates vs
> using two methods?

I don't know, but I think one version is easier to maintain and the
code becomes clearer.  Having a lot of similar code is a bad thing.
It hides the important things.
-- 
Kai Antweiler




reply via email to

[Prev in Thread] Current Thread [Next in Thread]