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
commit8e3ba407fc074d94973837a6d7b4049be4c70a5b (patch)
treeb98700956e08ab4a851fa3f47c9ef205eefed119 /navit/sunriset.c
parent298960c2f159ef933f2ff1c0acb2ba4f945c2636 (diff)
downloadnavit-svn-8e3ba407fc074d94973837a6d7b4049be4c70a5b.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 ee6a37b3..9c92898e 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;