Sign in to follow this  
Harald_Kraft

comiling Timemanager

Recommended Posts

Help AVSIM continue to serve you!
Please donate today!

Harald,The problem is the types of the arguments in these function calls. tzDelta.dMinutes = (int)(fmod (offset, 1.0) * 60);In this case, 'offset' is a float and the constant 1.0 is a double by default. There are versions of fmod() that take float,float and double,double and long double,long double, but the compiler doesn't want to guess which version to convert the double,float arguments to. The problem with the floor() calls is that the arguments are integers and need to be explicitly cast as floats.You just need to make the argument types more explicit. Replace the lines in TimeManager.cpp with the following and it should fix the problems:171: tzDelta.dMinutes = (int)(fmod (offset, 1.0f) * 60);459: float n1 = (float)(floor(float(275 * date.month / 9)));460: float n2 = (float)(floor(float((date.month + 9) / 12)));461: float n3 = (float)((1 + floor(float(date.year - 4 * floor(date.year / 4) + 2) / 3))));566: rise.minute = (int)(fmod(utRise, 1.0f) * 60);569: set.minute = (int)(fmod(utSet, 1.0f) * 60);Chris WallaceOttawa, Canada

Share this post


Link to post
Share on other sites

Hi ChrisIt worked, I had only to change line 461 fromfloat n3 = (float)((1 + floor(float(date.year - 4 * floor(date.year / 4) + 2) / 3))));tofloat n3 = (float)((1 + floor(float(date.year - 4 * (floor(float(date.year / 4)+ 2) / 3)))));thanksHarald

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this