~ubuntu-branches/ubuntu/lucid/wmmoonclock/lucid

« back to all changes in this revision

Viewing changes to debian/patches/01_all_previous_diff.diff

  • Committer: Bazaar Package Importer
  • Author(s): Denis Briand
  • Date: 2009-07-26 10:30:00 UTC
  • Revision ID: james.westby@ubuntu.com-20090726103000-2y5ws6okikxakvfp
Tags: 1.27-28
* Add southern hemisphere support (Closes: #537480).
  Thanks to Alvaro Steiger.
* Bump standards version to 3.8.2.0
* Add quilt patch system.
* Add patches:
  + 01_all_previous_diff.diff
  + 02_update_time.diff
  + 03_add_southern_hemisphere_support.diff
  + 04_fix_hyphen_used_as_minus_sign.diff
* Add debhelper 7 build depends.
* Add debian/compat file.
* Remove trailing whitespaces in changelog.upstream.
* Add an empty watch file (no upstream repository).
* Improve rules file by using more debhelper commands.
* Remove Martin A. Godisch from uploaders field
  Thanks to him to have sponsored wmmoonclock.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
6
@@ -1,13 +1,12 @@
 
7
+#include <string.h>
 
8
 #include "CalcEphem.h"
 
9
 
 
10
 
 
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 */
 
16
 {
 
17
-double vv;
 
18
-int dd, mm, ss;
 
19
 
 
20
     int    year, month, day;
 
21
     double TU, TU2, TU3, T0, gmst;
 
22
@@ -16,12 +15,7 @@
 
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;
 
31
-    int i, j;
 
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;
 
36
@@ -237,7 +231,7 @@
 
37
 char dowstr[];
 
38
 {
 
39
         double JD, A, Afrac, jd();
 
40
-        int n, iday, iA;
 
41
+        int n, iA;
 
42
 
 
43
         JD = jd(year, month, day, 0.0);
 
44
         A = (JD + 1.5)/7.0;
 
45
@@ -282,7 +276,7 @@
 
46
 int ny, nm, nd;
 
47
 double UT;
 
48
 {
 
49
-        double A, B, C, D, JD, MJD, day;
 
50
+        double A, B, C, D, JD, day;
 
51
 
 
52
         day = nd + UT/24.0;
 
53
 
 
54
@@ -372,7 +366,7 @@
 
55
 }
 
56
 
 
57
 
 
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 */
 
62
 {
 
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
 
66
@@ -54,4 +54,7 @@
 
67
     int           Visible;             /* Wether or not moon is above horizon */
 
68
 } CTrans;
 
69
 
 
70
+void CalcEphem(long int, double, CTrans*);
 
71
+int  DayofWeek(int, int, int, char*);
 
72
+int  DayofYear(int, int, int);
 
73
 
 
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
 
77
@@ -1,5 +1,5 @@
 
78
 CC     = gcc
 
79
-CFLAGS = -O2
 
80
+# CFLAGS = -O2
 
81
 INCDIR = -I/usr/X11R6/include/X11
 
82
 DESTDIR= /usr/X11R6
 
83
 LIBDIR = -L/usr/X11R6/lib
 
84
@@ -22,7 +22,7 @@
 
85
 
 
86
 wmMoonClock.o: wmMoonClock_master.xpm wmMoonClock_mask.xbm CalcEphem.h
 
87
 wmMoonClock:   $(OBJS) 
 
88
-       $(CC) $(COPTS) $(SYSTEM) -lm -o wmMoonClock $^ $(INCDIR) $(LIBDIR) $(LIBS)
 
89
+       $(CC) $(CFLAGS) $(SYSTEM) -lm -o wmMoonClock $^ $(INCDIR) $(LIBDIR) $(LIBS)
 
90
 
 
91
 clean:
 
92
        for i in $(OBJS) ; do \
 
93
@@ -31,6 +31,7 @@
 
94
        rm -f wmMoonClock
 
95
 
 
96
 install:: wmMoonClock
 
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 
 
102
 
 
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
 
106
@@ -8,6 +8,10 @@
 
107
 
 
108
 double angle360();
 
109
 
 
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*);
 
114
 
 
115
 double TwoPi = 6.283185308;
 
116
 double ARC = 206264.81;
 
117
@@ -25,8 +29,8 @@
 
118
 double S1, S2, S3, S4, S5, S6, S7;
 
119
 double DL0, DL, DD, DGAM, DLS, DF;
 
120
 double L0, L, LS, F, D;
 
121
-double ARG, FAC;
 
122
-int    MAX, i, j;
 
123
+double ARG = 0.0, FAC = 0.0;
 
124
+int    MAX = 0, i, j;
 
125
 double S; 
 
126
 
 
127
 
 
128
@@ -274,7 +278,7 @@
 
129
 
 
130
 
 
131
 
 
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){
 
134
 
 
135
     double     X, Y;
 
136
 
 
137
@@ -289,7 +293,7 @@
 
138
 
 
139
 
 
140
 
 
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){
 
143
 
 
144
     double     XX, YY;
 
145
     int                k, I[5];
 
146
@@ -307,7 +311,7 @@
 
147
 
 
148
 
 
149
 
 
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){
 
152
 
 
153
     *C = C1*C2 - S1*S2;
 
154
     *S = S1*C2 + C1*S2;
 
155
@@ -316,7 +320,7 @@
 
156
 }
 
157
 
 
158
 
 
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){
 
161
 
 
162
     double     X, Y;
 
163
 
 
164
@@ -381,7 +385,7 @@
 
165
  *            DEC: declination (in deg; equinox of date)    
 
166
  *
 
167
  */
 
168
-MiniMoon(double T, double *RA, double *DEC){
 
169
+void MiniMoon(double T, double *RA, double *DEC){
 
170
 
 
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;
 
173
@@ -424,7 +428,6 @@
 
174
     *RA   =  ( 48.0/P2)*atan2(Y, X+RHO); 
 
175
     if (*RA<0.0) *RA += 24.0;
 
176
 
 
177
-    return(0);
 
178
 
 
179
 
 
180
 }
 
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
 
184
@@ -0,0 +1,6 @@
 
185
+#ifndef MOON_H
 
186
+#define MOON_H
 
187
+
 
188
+void MiniMoon(double, double*, double*);
 
189
+
 
190
+#endif
 
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
 
194
@@ -1,5 +1,7 @@
 
195
 #include <stdio.h>
 
196
 #include <math.h>
 
197
+#include "MoonRise.h"
 
198
+#include "Moon.h"
 
199
 
 
200
 #define DegPerRad       57.29577951308232087680
 
201
 #define RadPerDeg        0.01745329251994329576
 
202
@@ -7,7 +9,7 @@
 
203
 extern double  Glon, SinGlat, CosGlat, TimeZone;
 
204
 
 
205
 
 
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){
 
208
 
 
209
     double     UT, ym, y0, yp, SinH0;
 
210
     double     xe, ye, z1, z2, SinH(), hour24();
 
211
@@ -76,7 +78,7 @@
 
212
 }
 
213
 
 
214
 
 
215
-UTTohhmm(double UT, int *h, int *m){
 
216
+void UTTohhmm(double UT, int *h, int *m){
 
217
 
 
218
 
 
219
     if (UT < 0.0) {
 
220
@@ -85,6 +87,14 @@
 
221
     } else {
 
222
         *h = (int)UT;
 
223
         *m = (int)((UT-(double)(*h))*60.0+0.5);
 
224
+       if (*m == 60) {
 
225
+           /* 
 
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.
 
228
+            */
 
229
+           *h += 1;
 
230
+           *m = 0;
 
231
+       }
 
232
     }
 
233
 
 
234
 }
 
235
@@ -94,7 +104,7 @@
 
236
 
 
237
 
 
238
 
 
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){
 
241
 
 
242
     double     a, b, c, d, dx;
 
243
 
 
244
@@ -115,7 +125,6 @@
 
245
        if (*z1 < -1.0) *z1 = *z2;
 
246
     }
 
247
 
 
248
-    return(0);
 
249
 
 
250
 
 
251
 }
 
252
@@ -125,8 +134,8 @@
 
253
 
 
254
 double SinH(int year, int month, int day, double UT){
 
255
 
 
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();
 
260
     double     angle2pi();
 
261
 
 
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
 
266
@@ -0,0 +1,8 @@
 
267
+#ifndef MOONRISE_H
 
268
+#define MOONRISE_H
 
269
+
 
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*);
 
273
+
 
274
+#endif
 
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
 
278
@@ -112,6 +112,7 @@
 
279
 #include <X11/X.h>
 
280
 #include <X11/xpm.h>
 
281
 #include "CalcEphem.h"
 
282
+#include "MoonRise.h"
 
283
 #include "xutils.h"
 
284
 #include "wmMoonClock_master.xpm"
 
285
 #include "wmMoonClock_masterLow.xpm"
 
286
@@ -122,7 +123,7 @@
 
287
 /* 
 
288
  *  Delay between refreshes (in microseconds) 
 
289
  */
 
290
-#define DELAY 10000L
 
291
+#define DELAY 1000000L
 
292
 #define WMMOONCLOCK_VERSION "1.27"
 
293
 
 
294
 
 
295
@@ -159,14 +160,13 @@
 
296
 
 
297
     struct tm          *GMTTime, *LocalTime;
 
298
     XEvent             event;
 
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;
 
306
-    char               str[10];
 
307
     CTrans             c;
 
308
+    struct timeval     timeout;
 
309
+    fd_set             xfdset;
 
310
 
 
311
 
 
312
 
 
313
@@ -705,6 +705,11 @@
 
314
 
 
315
 
 
316
 
 
317
+       /*
 
318
+        *  Add X display to file descriptor set for polling.
 
319
+        */
 
320
+       FD_ZERO(&xfdset);
 
321
+       FD_SET(ConnectionNumber(display), &xfdset);
 
322
 
 
323
 
 
324
 
 
325
@@ -734,7 +739,9 @@
 
326
         *  Redraw and wait for next update 
 
327
         */
 
328
        RedrawWindow();
 
329
-       usleep(DELAY);
 
330
+       timeout.tv_sec = DELAY / 1000000L;
 
331
+       timeout.tv_usec = DELAY % 1000000L;
 
332
+       select(ConnectionNumber(display) + 1, &xfdset, NULL, NULL, &timeout);
 
333
 
 
334
 
 
335
      }