1
All previous diff before I maintain it.
2
==================================================================================
3
diff -urN wmmoonclock-1.27.orig/Src/CalcEphem.c wmmoonclock-1.27.new/Src/CalcEphem.c
4
--- wmmoonclock-1.27.orig/Src/CalcEphem.c 1999-06-07 16:16:04.000000000 +0200
5
+++ wmmoonclock-1.27.new/Src/CalcEphem.c 2009-07-25 22:56:29.000000000 +0200
11
-CalcEphem(date, UT, c)
12
+void CalcEphem(date, UT, c)
13
long int date; /* integer containing the date (e.g. 960829) */
14
double UT; /* Universal Time */
15
CTrans *c; /* structure containing all the relevent coord trans info */
21
double TU, TU2, TU3, T0, gmst;
23
double days, M, E, nu, lambnew;
24
double r0, earth_sun_distance;
25
double RA, DEC, RA_Moon, DEC_Moon;
26
- double dt, g0_1, g1_1, h1_1, gclat, glon, psi;
27
- double TDT, Lmoon_0, P0, N0, Imoon, Lmoon, Mmoon_m, Nmoon, Cmoon;
28
- double Emoon_nu, Amoon_e, Amoon_3, Mmoon_mp, Emoon_c, amoon, emoon, AGE;
29
- double Amoon_4, Lmoon_p, Vmoon, Lmoon_pp, Nmoon_p, LambdaMoon, BetaMoon, R;
30
- Vector S, K, Y, Z, D, Dgei, Dgsm;
32
+ double TDT, AGE, LambdaMoon, BetaMoon, R;
33
double jd(), hour24(), angle2pi(), angle360(), kepler(), Moon(), NewMoon();
34
double Ta, Tb, Tc, frac();
35
double SinGlat, CosGlat, SinGlon, CosGlon, Tau, lmst, x, y, z;
39
double JD, A, Afrac, jd();
43
JD = jd(year, month, day, 0.0);
49
- double A, B, C, D, JD, MJD, day;
50
+ double A, B, C, D, JD, day;
58
-Radec_to_Cart(ra, dec, r)
59
+void Radec_to_Cart(ra, dec, r)
60
double ra, dec; /* RA and DEC */
61
Vector *r; /* returns corresponding cartesian unit vector */
63
diff -urN wmmoonclock-1.27.orig/Src/CalcEphem.h wmmoonclock-1.27.new/Src/CalcEphem.h
64
--- wmmoonclock-1.27.orig/Src/CalcEphem.h 1998-12-31 19:25:16.000000000 +0100
65
+++ wmmoonclock-1.27.new/Src/CalcEphem.h 2009-07-25 22:56:29.000000000 +0200
67
int Visible; /* Wether or not moon is above horizon */
70
+void CalcEphem(long int, double, CTrans*);
71
+int DayofWeek(int, int, int, char*);
72
+int DayofYear(int, int, int);
74
diff -urN wmmoonclock-1.27.orig/Src/Makefile wmmoonclock-1.27.new/Src/Makefile
75
--- wmmoonclock-1.27.orig/Src/Makefile 1999-03-23 03:20:32.000000000 +0100
76
+++ wmmoonclock-1.27.new/Src/Makefile 2009-07-25 22:56:29.000000000 +0200
81
INCDIR = -I/usr/X11R6/include/X11
83
LIBDIR = -L/usr/X11R6/lib
86
wmMoonClock.o: wmMoonClock_master.xpm wmMoonClock_mask.xbm CalcEphem.h
88
- $(CC) $(COPTS) $(SYSTEM) -lm -o wmMoonClock $^ $(INCDIR) $(LIBDIR) $(LIBS)
89
+ $(CC) $(CFLAGS) $(SYSTEM) -lm -o wmMoonClock $^ $(INCDIR) $(LIBDIR) $(LIBS)
92
for i in $(OBJS) ; do \
97
- install -s -m 0755 wmMoonClock $(DESTDIR)/bin
98
- install -m 0644 wmMoonClock.1 $(DESTDIR)/man/man1
99
+ install -d -m 0755 $(DESTDIR)/usr/bin $(DESTDIR)/usr/share/man/man1
100
+ install -m 0755 wmMoonClock $(DESTDIR)/usr/bin
101
+ install -m 0644 wmMoonClock.1 $(DESTDIR)/usr/share/man/man1
103
diff -urN wmmoonclock-1.27.orig/Src/Moon.c wmmoonclock-1.27.new/Src/Moon.c
104
--- wmmoonclock-1.27.orig/Src/Moon.c 1999-01-09 04:08:26.000000000 +0100
105
+++ wmmoonclock-1.27.new/Src/Moon.c 2009-07-25 22:56:29.000000000 +0200
110
+void addthe(double, double, double, double, double*, double*);
111
+void addsol(double, double, double, double, int, int, int, int);
112
+void addn(double, int, int, int, int);
113
+void term(int, int, int, int, double*, double*);
115
double TwoPi = 6.283185308;
116
double ARC = 206264.81;
118
double S1, S2, S3, S4, S5, S6, S7;
119
double DL0, DL, DD, DGAM, DLS, DF;
120
double L0, L, LS, F, D;
123
+double ARG = 0.0, FAC = 0.0;
132
-addsol(double COEFFL, double COEFFS, double COEFFG, double COEFFP, int P, int Q, int R, int S){
133
+void addsol(double COEFFL, double COEFFS, double COEFFG, double COEFFP, int P, int Q, int R, int S){
141
-term(int P, int Q, int R, int S, double *X, double *Y){
142
+void term(int P, int Q, int R, int S, double *X, double *Y){
150
-addthe(double C1, double S1, double C2, double S2, double *C, double *S){
151
+void addthe(double C1, double S1, double C2, double S2, double *C, double *S){
159
-addn(double COEFFN, int P, int Q, int R, int S){
160
+void addn(double COEFFN, int P, int Q, int R, int S){
165
* DEC: declination (in deg; equinox of date)
168
-MiniMoon(double T, double *RA, double *DEC){
169
+void MiniMoon(double T, double *RA, double *DEC){
171
double L0,L,LS,F,D,H,S,N,DL,CB,L_MOON,B_MOON,V,W,X,Y,Z,RHO;
172
double frac(), cosEPS, sinEPS, P2, ARC;
174
*RA = ( 48.0/P2)*atan2(Y, X+RHO);
175
if (*RA<0.0) *RA += 24.0;
181
diff -urN wmmoonclock-1.27.orig/Src/Moon.h wmmoonclock-1.27.new/Src/Moon.h
182
--- wmmoonclock-1.27.orig/Src/Moon.h 1970-01-01 01:00:00.000000000 +0100
183
+++ wmmoonclock-1.27.new/Src/Moon.h 2009-07-25 22:56:29.000000000 +0200
188
+void MiniMoon(double, double*, double*);
191
diff -urN wmmoonclock-1.27.orig/Src/MoonRise.c wmmoonclock-1.27.new/Src/MoonRise.c
192
--- wmmoonclock-1.27.orig/Src/MoonRise.c 1998-12-31 19:54:48.000000000 +0100
193
+++ wmmoonclock-1.27.new/Src/MoonRise.c 2009-07-25 22:56:29.000000000 +0200
197
+#include "MoonRise.h"
200
#define DegPerRad 57.29577951308232087680
201
#define RadPerDeg 0.01745329251994329576
203
extern double Glon, SinGlat, CosGlat, TimeZone;
206
-MoonRise(int year, int month, int day, double LocalHour, double *UTRise, double *UTSet){
207
+void MoonRise(int year, int month, int day, double LocalHour, double *UTRise, double *UTSet){
209
double UT, ym, y0, yp, SinH0;
210
double xe, ye, z1, z2, SinH(), hour24();
215
-UTTohhmm(double UT, int *h, int *m){
216
+void UTTohhmm(double UT, int *h, int *m){
223
*m = (int)((UT-(double)(*h))*60.0+0.5);
226
+ * If it was 23:60 this should become 24:00
227
+ * I prefer this designation to 00:00. So dont reset h to 0 when it goes above 24.
239
-Interp(double ym, double y0, double yp, double *xe, double *ye, double *z1, double *z2, int *nz){
240
+void Interp(double ym, double y0, double yp, double *xe, double *ye, double *z1, double *z2, int *nz){
242
double a, b, c, d, dx;
245
if (*z1 < -1.0) *z1 = *z2;
254
double SinH(int year, int month, int day, double UT){
256
- double TU, TU2, TU3, LambdaMoon, BetaMoon, R, AGE, frac(), jd();
257
- double RA_Moon, DEC_Moon, T0, gmst, lmst, Tau, epsilon, Moon();
258
+ double TU, frac(), jd();
259
+ double RA_Moon, DEC_Moon, gmst, lmst, Tau, Moon();
262
TU = (jd(year, month, day, UT) - 2451545.0)/36525.0;
263
diff -urN wmmoonclock-1.27.orig/Src/MoonRise.h wmmoonclock-1.27.new/Src/MoonRise.h
264
--- wmmoonclock-1.27.orig/Src/MoonRise.h 1970-01-01 01:00:00.000000000 +0100
265
+++ wmmoonclock-1.27.new/Src/MoonRise.h 2009-07-25 22:56:29.000000000 +0200
270
+void MoonRise(int, int, int, double, double*, double*);
271
+void UTTohhmm(double, int*, int*);
272
+void Interp(double, double, double, double*, double*, double*, double*, int*);
275
diff -urN wmmoonclock-1.27.orig/Src/wmMoonClock.c wmmoonclock-1.27.new/Src/wmMoonClock.c
276
--- wmmoonclock-1.27.orig/Src/wmMoonClock.c 1999-06-07 16:27:18.000000000 +0200
277
+++ wmmoonclock-1.27.new/Src/wmMoonClock.c 2009-07-25 23:26:31.000000000 +0200
281
#include "CalcEphem.h"
282
+#include "MoonRise.h"
284
#include "wmMoonClock_master.xpm"
285
#include "wmMoonClock_masterLow.xpm"
288
* Delay between refreshes (in microseconds)
290
-#define DELAY 10000L
291
+#define DELAY 1000000L
292
#define WMMOONCLOCK_VERSION "1.27"
295
@@ -159,14 +160,13 @@
297
struct tm *GMTTime, *LocalTime;
299
- int i, n, k, j, ImageNumber;
300
- int Year, Month, DayOfWeek, DayOfMonth;
301
- int Hours, Mins, Secs, OldSecs, digit, xoff, xsize;
302
+ int i, n, j, ImageNumber, Year, Month, DayOfMonth, digit;
303
long CurrentLocalTime, CurrentGMTTime, date;
304
double UT, val, RA, DEC, UTRise, UTSet, LocalHour, hour24();
305
int D, H, M, S, sgn, A, B, q;
308
+ struct timeval timeout;
318
+ * Add X display to file descriptor set for polling.
321
+ FD_SET(ConnectionNumber(display), &xfdset);
326
* Redraw and wait for next update
330
+ timeout.tv_sec = DELAY / 1000000L;
331
+ timeout.tv_usec = DELAY % 1000000L;
332
+ select(ConnectionNumber(display) + 1, &xfdset, NULL, NULL, &timeout);