summaryrefslogtreecommitdiff
path: root/navit/sunriset.c
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2009-11-13 08:41:06 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2009-11-13 08:41:06 +0000
commitea48014bb9c88c83b0e5a15f645078bfc046d162 (patch)
treeb98700956e08ab4a851fa3f47c9ef205eefed119 /navit/sunriset.c
parentf6659af57376e9f554cdea65cb7f33ffb77e6687 (diff)
downloadnavit-ea48014bb9c88c83b0e5a15f645078bfc046d162.tar.gz
Fix:Core:Avoid gmtime_r which isn't available on all platforms
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@2752 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/sunriset.c')
-rw-r--r--navit/sunriset.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/navit/sunriset.c b/navit/sunriset.c
index ee6a37b31..9c92898ec 100644
--- a/navit/sunriset.c
+++ b/navit/sunriset.c
@@ -16,13 +16,12 @@ Released to the public domain by Paul Schlyter, December 1992
#include <stdio.h>
#include <math.h>
-#include <time.h>
#include "sunriset.h"
/* The "workhorse" function for sun rise/set times */
-int __sunriset__( time_t ts, double lon, double lat,
+int __sunriset__( int year, int month, int day, double lon, double lat,
double altit, int upper_limb, double *trise, double *tset )
/***************************************************************************/
/* Note: year,month,date = calendar date, 1801-2099 only. */
@@ -54,8 +53,6 @@ int __sunriset__( time_t ts, double lon, double lat,
/* */
/**********************************************************************/
{
- int year, month, day;
- struct tm ymd;
double d, /* Days since 2000 Jan 0.0 (negative before) */
sr, /* Solar distance, astronomical units */
sRA, /* Sun's Right Ascension */
@@ -67,12 +64,6 @@ int __sunriset__( time_t ts, double lon, double lat,
int rc = 0; /* Return cde from function - usually 0 */
- //Split ts to y/m/d
- gmtime_r(&ts,&ymd);
- year=ymd.tm_year+1900;
- month=ymd.tm_mon+1;
- day=ymd.tm_mday+1;
-
/* Compute d of 12h local mean solar time */
d = days_since_2000_Jan_0(year,month,day) + 0.5 - lon/360.0;