[gcompris-devel] Divide by zero in clockgame.c...

Bruno Coudoin bcoudoin at anfora.fr
Wed Oct 24 01:39:06 UTC 2001


Excellent, you finally found that long standing bug.

For your compilation issue, since boards are plugins these needs to be
installed each time you change them or at least copy them in the
directory gcompris search them.
In my case, i keep the default install path at configure time so
gcompris is installed in /usr/local/bin/gcompris
The plugins are in /usr/local/lib/gcompris/libxxx.so and .la
So after a board change, you can cd in src/boards/.libs
and cp lib* in /usr/local/lib/gcompris/
This is way faster than reinstalling everything.

Herman, your patch will be part of 0.9.3 release.

Bruno.

le mer 24-10-2001 at 00:38 Herman Bruyninckx a écrit :
> I've been looking some more into the problems I have with
> clockgame.c... and found the solution.
> 
> The problem is that the original line 628:
> 
>   angle = M_PI/2 - atan(new_y/new_x) + ((new_x<0) ? M_PI : 0.0);
> 
> gives an error when new_x == 0. This, I could prove very easy by
> testing: every time that I grab the hour or minute angle and pass
> through the vertical center line, I got the error. (So, I am very
> surprised that you guys don't have this error... It took me a long
> time to become aware of the fact that just recompiling didn't change
> anything, because the installed shared libraries were always kept
> unchanged, unless I did a full `make install').
> 
> I solved it as follows:
> 
>   angle =  atan2(new_x,new_y);
>   if (angle<0) {angle= angle + 2.0*M_PI;}
> 
> The atan2 finds the angle (between -pi and +pi); in order to have an
> angle between 0 and 2 pi, I have to wrap negative angles.
> 
> This solution works fine for me.
> 
> Best regards,
> 
> Herman
> 
> 
> 
> _______________________________________________
> gcompris-devel mailing list
> gcompris-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gcompris-devel






More information about the Gcompris-devel mailing list