freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] FT_Vector_NormLen: faster vector normalization


From: Alexei Podtelezhnikov
Subject: Re: [ft-devel] FT_Vector_NormLen: faster vector normalization
Date: Tue, 30 Jun 2015 10:09:11 -0400

On Tue, Jun 30, 2015 at 3:47 AM, Werner LEMBERG <address@hidden> wrote:
> Uh, oh, this code is very fragile and not easy to understand...  I
> tried to remove some compiler warnings (from `clang
> -Wsign-conversion', see below for the original compiler messages and
> my bad attempt to fix them), and even such innocently looking changes
> immediately cause bad rendering results.  For maintainance reasons I
> thus ask you to improve that, both by adding casts and documentation.

I knew that would generate some attention. For that reason I would not
want to fix the warnings right away just so that more people look at
the code in the next week or two, if you do not mind. Perhaps this
will generate some ideas for improvement.

I told you before that I see -Wsign-conversion kind of paranoid. I
wish there was a concise way to say that this entire expression should
be evaluated unsigned or signed in its entirety, rather than going
through each term and doing explicit conversions. Well, C has very
specific implicit conversion rules and I relied on those a lot, of
course. The key math is in the do-while loop.

`difference with 2^32' is a definition of two's complement. I'll add that.



reply via email to

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