Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37633871
en ru br
ALT Linux repos
S:1.27-alt5
5.0: 1.27-alt3
4.1: 1.27-alt3
4.0: 1.27-alt3
3.0: 1.27-alt2

Group :: Graphical desktop/Window Maker
RPM: wmMoonClock

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: 01_all_previous_diff.diff
Download


All previous diff before I maintain it.
==================================================================================
diff -urN wmmoonclock-1.27.orig/Src/CalcEphem.c wmmoonclock-1.27.new/Src/CalcEphem.c
--- wmmoonclock-1.27.orig/Src/CalcEphem.c	1999-06-07 16:16:04.000000000 +0200
+++ wmmoonclock-1.27.new/Src/CalcEphem.c	2009-07-25 22:56:29.000000000 +0200
@@ -1,13 +1,12 @@
+#include <string.h>
 #include "CalcEphem.h"
 
 
-CalcEphem(date, UT, c)
+void CalcEphem(date, UT, c)
 long int     	 date;	/* integer containing the date (e.g. 960829) */
 double  	 UT; 	/* Universal Time */
 CTrans 		*c;	/* structure containing all the relevent coord trans info */
 {
-double vv;
-int dd, mm, ss;
 
     int    year, month, day;
     double TU, TU2, TU3, T0, gmst;
@@ -16,12 +15,7 @@
     double days, M, E, nu, lambnew;
     double r0, earth_sun_distance;
     double RA, DEC, RA_Moon, DEC_Moon;
-    double dt, g0_1, g1_1, h1_1, gclat, glon, psi;
-    double TDT, Lmoon_0, P0, N0, Imoon, Lmoon, Mmoon_m, Nmoon, Cmoon;
-    double Emoon_nu, Amoon_e, Amoon_3, Mmoon_mp, Emoon_c, amoon, emoon, AGE;
-    double Amoon_4, Lmoon_p, Vmoon, Lmoon_pp, Nmoon_p, LambdaMoon, BetaMoon, R;
-    Vector S, K, Y, Z, D, Dgei, Dgsm;
-    int i, j;
+    double TDT, AGE, LambdaMoon, BetaMoon, R;
     double jd(), hour24(), angle2pi(), angle360(), kepler(), Moon(), NewMoon();
     double Ta, Tb, Tc, frac();
     double SinGlat, CosGlat, SinGlon, CosGlon, Tau, lmst, x, y, z;
@@ -237,7 +231,7 @@
 char dowstr[];
 {
         double JD, A, Afrac, jd();
-        int n, iday, iA;
+        int n, iA;
 
         JD = jd(year, month, day, 0.0);
         A = (JD + 1.5)/7.0;
@@ -282,7 +276,7 @@
 int ny, nm, nd;
 double UT;
 {
-        double A, B, C, D, JD, MJD, day;
+        double A, B, C, D, JD, day;
 
         day = nd + UT/24.0;
 
@@ -372,7 +366,7 @@
 }
 
 
-Radec_to_Cart(ra, dec, r)
+void Radec_to_Cart(ra, dec, r)
 double  ra, dec;	/* RA and DEC */
 Vector *r;		/* returns corresponding cartesian unit vector */
 {
diff -urN wmmoonclock-1.27.orig/Src/CalcEphem.h wmmoonclock-1.27.new/Src/CalcEphem.h
--- wmmoonclock-1.27.orig/Src/CalcEphem.h	1998-12-31 19:25:16.000000000 +0100
+++ wmmoonclock-1.27.new/Src/CalcEphem.h	2009-07-25 22:56:29.000000000 +0200
@@ -54,4 +54,7 @@
     int	   Visible;		/* Wether or not moon is above horizon */
 } CTrans;
 
+void CalcEphem(long int, double, CTrans*);
+int  DayofWeek(int, int, int, char*);
+int  DayofYear(int, int, int);
 
diff -urN wmmoonclock-1.27.orig/Src/Makefile wmmoonclock-1.27.new/Src/Makefile
--- wmmoonclock-1.27.orig/Src/Makefile	1999-03-23 03:20:32.000000000 +0100
+++ wmmoonclock-1.27.new/Src/Makefile	2009-07-25 22:56:29.000000000 +0200
@@ -1,5 +1,5 @@
 CC     = gcc
-CFLAGS = -O2
+# CFLAGS = -O2
 INCDIR = -I/usr/X11R6/include/X11
 DESTDIR= /usr/X11R6
 LIBDIR = -L/usr/X11R6/lib
@@ -22,7 +22,7 @@
 
 wmMoonClock.o: wmMoonClock_master.xpm wmMoonClock_mask.xbm CalcEphem.h
 wmMoonClock:	$(OBJS) 
-	$(CC) $(COPTS) $(SYSTEM) -o wmMoonClock $^ $(INCDIR) $(LIBDIR) $(LIBS) -lm
+	$(CC) $(CFLAGS) $(SYSTEM) -o wmMoonClock $^ $(INCDIR) $(LIBDIR) $(LIBS) -lm
 
 clean:
 	for i in $(OBJS) ; do \
@@ -31,6 +31,7 @@
 	rm -f wmMoonClock
 
 install:: wmMoonClock
-	install -s -m 0755 wmMoonClock $(DESTDIR)/bin
-	install    -m 0644 wmMoonClock.1 $(DESTDIR)/man/man1 
+	install -d -m 0755 $(DESTDIR)/usr/bin $(DESTDIR)/usr/share/man/man1
+	install    -m 0755 wmMoonClock $(DESTDIR)/usr/bin
+	install    -m 0644 wmMoonClock.1 $(DESTDIR)/usr/share/man/man1 
 
diff -urN wmmoonclock-1.27.orig/Src/Moon.c wmmoonclock-1.27.new/Src/Moon.c
--- wmmoonclock-1.27.orig/Src/Moon.c	1999-01-09 04:08:26.000000000 +0100
+++ wmmoonclock-1.27.new/Src/Moon.c	2009-07-25 22:56:29.000000000 +0200
@@ -8,6 +8,10 @@
 
 double angle360();
 
+void addthe(double, double, double, double, double*, double*);
+void addsol(double, double, double, double, int, int, int, int);
+void addn(double, int, int, int, int);
+void term(int, int, int, int, double*, double*);
 
 double	TwoPi = 6.283185308;
 double	ARC = 206264.81;
@@ -25,8 +29,8 @@
 double	S1, S2, S3, S4, S5, S6, S7;
 double	DL0, DL, DD, DGAM, DLS, DF;
 double	L0, L, LS, F, D;
-double	ARG, FAC;
-int	MAX, i, j;
+double	ARG = 0.0, FAC = 0.0;
+int	MAX = 0, i, j;
 double	S; 
 
 
@@ -274,7 +278,7 @@
 
 
 
-addsol(double COEFFL, double COEFFS, double COEFFG, double COEFFP, int P, int Q, int R, int S){
+void addsol(double COEFFL, double COEFFS, double COEFFG, double COEFFP, int P, int Q, int R, int S){
 
     double	X, Y;
 
@@ -289,7 +293,7 @@
 
 
 
-term(int P, int Q, int R, int S, double *X, double *Y){
+void term(int P, int Q, int R, int S, double *X, double *Y){
 
     double	XX, YY;
     int		k, I[5];
@@ -307,7 +311,7 @@
 
 
 
-addthe(double C1, double S1, double C2, double S2, double *C, double *S){
+void addthe(double C1, double S1, double C2, double S2, double *C, double *S){
 
     *C = C1*C2 - S1*S2;
     *S = S1*C2 + C1*S2;
@@ -316,7 +320,7 @@
 }
 
 
-addn(double COEFFN, int P, int Q, int R, int S){
+void addn(double COEFFN, int P, int Q, int R, int S){
 
     double	X, Y;
 
@@ -381,7 +385,7 @@
  *            DEC: declination (in deg; equinox of date)    
  *
  */
-MiniMoon(double T, double *RA, double *DEC){
+void MiniMoon(double T, double *RA, double *DEC){
 
     double	L0,L,LS,F,D,H,S,N,DL,CB,L_MOON,B_MOON,V,W,X,Y,Z,RHO;
     double	frac(), cosEPS, sinEPS, P2, ARC;
@@ -424,7 +428,6 @@
     *RA   =  ( 48.0/P2)*atan2(Y, X+RHO); 
     if (*RA<0.0) *RA += 24.0;
 
-    return(0);
 
 
 }
diff -urN wmmoonclock-1.27.orig/Src/Moon.h wmmoonclock-1.27.new/Src/Moon.h
--- wmmoonclock-1.27.orig/Src/Moon.h	1970-01-01 01:00:00.000000000 +0100
+++ wmmoonclock-1.27.new/Src/Moon.h	2009-07-25 22:56:29.000000000 +0200
@@ -0,0 +1,6 @@
+#ifndef MOON_H
+#define MOON_H
+
+void MiniMoon(double, double*, double*);
+
+#endif
diff -urN wmmoonclock-1.27.orig/Src/MoonRise.c wmmoonclock-1.27.new/Src/MoonRise.c
--- wmmoonclock-1.27.orig/Src/MoonRise.c	1998-12-31 19:54:48.000000000 +0100
+++ wmmoonclock-1.27.new/Src/MoonRise.c	2009-07-25 22:56:29.000000000 +0200
@@ -1,5 +1,7 @@
 #include <stdio.h>
 #include <math.h>
+#include "MoonRise.h"
+#include "Moon.h"
 
 #define DegPerRad       57.29577951308232087680
 #define RadPerDeg        0.01745329251994329576
@@ -7,7 +9,7 @@
 extern	double	Glon, SinGlat, CosGlat, TimeZone;
 
 
-MoonRise(int year, int month, int day, double LocalHour, double *UTRise, double *UTSet){
+void MoonRise(int year, int month, int day, double LocalHour, double *UTRise, double *UTSet){
 
     double	UT, ym, y0, yp, SinH0;
     double	xe, ye, z1, z2, SinH(), hour24();
@@ -76,7 +78,7 @@
 }
 
 
-UTTohhmm(double UT, int *h, int *m){
+void UTTohhmm(double UT, int *h, int *m){
 
 
     if (UT < 0.0) {
@@ -94,7 +104,7 @@
 
 
 
-Interp(double ym, double y0, double yp, double *xe, double *ye, double *z1, double *z2, int *nz){
+void Interp(double ym, double y0, double yp, double *xe, double *ye, double *z1, double *z2, int *nz){
 
     double	a, b, c, d, dx;
 
@@ -115,7 +125,6 @@
 	if (*z1 < -1.0) *z1 = *z2;
     }
 
-    return(0);
 
 
 }
@@ -125,8 +134,8 @@
 
 double SinH(int year, int month, int day, double UT){
 
-    double	TU, TU2, TU3, LambdaMoon, BetaMoon, R, AGE, frac(), jd();
-    double	RA_Moon, DEC_Moon, T0, gmst, lmst, Tau, epsilon, Moon();
+    double	TU, frac(), jd();
+    double	RA_Moon, DEC_Moon, gmst, lmst, Tau, Moon();
     double	angle2pi();
 
     TU = (jd(year, month, day, UT) - 2451545.0)/36525.0;
diff -urN wmmoonclock-1.27.orig/Src/MoonRise.h wmmoonclock-1.27.new/Src/MoonRise.h
--- wmmoonclock-1.27.orig/Src/MoonRise.h	1970-01-01 01:00:00.000000000 +0100
+++ wmmoonclock-1.27.new/Src/MoonRise.h	2009-07-25 22:56:29.000000000 +0200
@@ -0,0 +1,8 @@
+#ifndef MOONRISE_H
+#define MOONRISE_H
+
+void MoonRise(int, int, int, double, double*, double*);
+void UTTohhmm(double, int*, int*);
+void Interp(double, double, double, double*, double*, double*, double*, int*);
+
+#endif
diff -urN wmmoonclock-1.27.orig/Src/wmMoonClock.c wmmoonclock-1.27.new/Src/wmMoonClock.c
--- wmmoonclock-1.27.orig/Src/wmMoonClock.c	1999-06-07 16:27:18.000000000 +0200
+++ wmmoonclock-1.27.new/Src/wmMoonClock.c	2009-07-25 23:26:31.000000000 +0200
@@ -112,6 +112,7 @@
 #include <X11/X.h>
 #include <X11/xpm.h>
 #include "CalcEphem.h"
+#include "MoonRise.h"
 #include "xutils.h"
 #include "wmMoonClock_master.xpm"
 #include "wmMoonClock_masterLow.xpm"
@@ -122,7 +123,7 @@
 /* 
  *  Delay between refreshes (in microseconds) 
  */
-#define DELAY 10000L
+#define DELAY 1000000L
 #define WMMOONCLOCK_VERSION "1.27"
 
 
@@ -159,14 +160,13 @@
 
     struct tm		*GMTTime, *LocalTime;
     XEvent		event;
-    int			i, n, k, j, ImageNumber;
-    int 		Year, Month, DayOfWeek, DayOfMonth;
-    int			Hours, Mins, Secs, OldSecs, digit, xoff, xsize;
+    int			i, n, j, ImageNumber, Year, Month, DayOfMonth, digit;
     long		CurrentLocalTime, CurrentGMTTime, date;
     double		UT, val, RA, DEC, UTRise, UTSet, LocalHour, hour24();
     int			D, H, M, S, sgn, A, B, q;
-    char		str[10];
     CTrans           	c;
+    struct timeval	timeout;
+    fd_set		xfdset;
 
 
 
@@ -705,6 +705,11 @@
 
 
 
+	/*
+	 *  Add X display to file descriptor set for polling.
+	 */
+	FD_ZERO(&xfdset);
+	FD_SET(ConnectionNumber(display), &xfdset);
 
 
 
@@ -734,7 +739,9 @@
 	 *  Redraw and wait for next update 
 	 */
 	RedrawWindow();
-	usleep(DELAY);
+	timeout.tv_sec = DELAY / 1000000L;
+	timeout.tv_usec = DELAY % 1000000L;
+	select(ConnectionNumber(display) + 1, &xfdset, NULL, NULL, &timeout);
 
 
      }
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin