[Pkg-wmaker-commits] [wmsun] 31/73: wmsun: Reduce scope of variables.
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Fri Aug 28 12:04:45 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch master
in repository wmsun.
commit 769e52826b9d8ad35f6bbacea50c21e73da5c020
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date: Sun Jun 14 17:04:46 2015 -0500
wmsun: Reduce scope of variables.
---
SunRise.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/SunRise.c b/SunRise.c
index 21ff9c9..5af0842 100644
--- a/SunRise.c
+++ b/SunRise.c
@@ -12,7 +12,7 @@ double P2 = 6.283185307;
int Interp(double ym, double y0, double yp, double *xe, double *ye, double *z1, double *z2, int *nz){
- double a, b, c, d, dx;
+ double a, b, c, d;
*nz = 0;
a = 0.5*(ym+yp)-y0;
@@ -23,6 +23,8 @@ int Interp(double ym, double y0, double yp, double *xe, double *ye, double *z1,
d = b*b - 4.0*a*c;
if (d >= 0){
+ double dx;
+
dx = 0.5*sqrt(d)/fabs(a);
*z1 = *xe - dx;
*z2 = *xe+dx;
@@ -38,7 +40,7 @@ int Interp(double ym, double y0, double yp, double *xe, double *ye, double *z1,
void SunRise(int year, int month, int day, double LocalHour, double *UTRise, double *UTSet){
- double UT, ym, y0, yp, SinH0;
+ double UT, ym, SinH0;
double xe, ye, z1, z2, SinH(), hour24();
int Rise, Set, nz;
@@ -53,6 +55,7 @@ void SunRise(int year, int month, int day, double LocalHour, double *UTRise, dou
ym = SinH(year, month, day, UT-1.0) - SinH0;
while ( (UT <= 24.0+TimeZone) ) {
+ double y0, yp;
y0 = SinH(year, month, day, UT) - SinH0;
yp = SinH(year, month, day, UT+1.0) - SinH0;
@@ -148,7 +151,7 @@ double jd(ny, nm, nd, UT)
int ny, nm, nd;
double UT;
{
- double A, B, C, D, JD, day;
+ double B, C, D, JD, day;
day = nd + UT/24.0;
@@ -159,6 +162,8 @@ double UT;
}
if (((double)ny+nm/12.0+day/365.25)>=(1582.0+10.0/12.0+15.0/365.25)){
+ double A;
+
A = ((int)(ny / 100.0));
B = 2.0 - A + (int)(A/4.0);
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmsun.git
More information about the Pkg-wmaker-commits
mailing list