aboutsummaryrefslogtreecommitdiff
path: root/misc/wmweather+/files
diff options
context:
space:
mode:
authorNorikatsu Shigemura <nork@FreeBSD.org>2003-04-11 20:37:09 +0000
committerNorikatsu Shigemura <nork@FreeBSD.org>2003-04-11 20:37:09 +0000
commit4b8f4908665191505a6840b08ab2c5fc15f1e99c (patch)
tree63e52176d20439621ed536b690317d29194d8888 /misc/wmweather+/files
parente64198eea2109b1d92b15cb549480297ec61e89b (diff)
downloadports-4b8f4908665191505a6840b08ab2c5fc15f1e99c.tar.gz
ports-4b8f4908665191505a6840b08ab2c5fc15f1e99c.zip
Add wmweather+ 2.4, think wmweather with forecasts, weather
map, and a sky cond. display. PR: ports/50834 Submitted by: Harald Wille <harald.wille@students.jku.at>
Notes
Notes: svn path=/head/; revision=78763
Diffstat (limited to 'misc/wmweather+/files')
-rw-r--r--misc/wmweather+/files/patch-convert.c106
-rw-r--r--misc/wmweather+/files/patch-convert.h11
-rw-r--r--misc/wmweather+/files/patch-moon.c11
-rw-r--r--misc/wmweather+/files/patch-subst.c11
-rw-r--r--misc/wmweather+/files/patch-wmweather+.c28
5 files changed, 167 insertions, 0 deletions
diff --git a/misc/wmweather+/files/patch-convert.c b/misc/wmweather+/files/patch-convert.c
new file mode 100644
index 000000000000..0bb59872ff77
--- /dev/null
+++ b/misc/wmweather+/files/patch-convert.c
@@ -0,0 +1,106 @@
+--- convert.c.orig Sun Sep 22 22:00:53 2002
++++ convert.c Fri Apr 11 02:07:44 2003
+@@ -52,7 +52,7 @@
+ if(temp_C==999 || dewpt_C==999) return 999;
+
+ f=1782.75*(dewpt_C-temp_C)/((237.7+dewpt_C)*(237.7+temp_C));
+- return round(pow(10, f+2));
++ return rint(pow(10, f+2));
+ }
+
+ int rh_F(int temp_F, int dewpt_F){
+@@ -61,7 +61,7 @@
+ if(temp_F==999 || dewpt_F==999) return 999;
+
+ f=3208.95*(dewpt_F-temp_F)/((395.86+dewpt_F)*(395.86+temp_F));
+- return round(pow(10, f+2));
++ return rint(pow(10, f+2));
+ }
+
+ int heatindex_C(int temp_C, int rh){
+@@ -75,7 +75,7 @@
+
+ temp2=temp_C*temp_C;
+ rh2=rh*rh;
+- return round(16.18754948 + 2.900509394*temp_C - 0.0221545692*temp2 + 4.20938791*rh - 0.26300889*temp_C*rh + 0.0039811176*temp2*rh - 0.02956469*rh2 + 0.001305828*temp_C*rh2 - 6.4476e-06*temp2*rh2);
++ return rint(16.18754948 + 2.900509394*temp_C - 0.0221545692*temp2 + 4.20938791*rh - 0.26300889*temp_C*rh + 0.0039811176*temp2*rh - 0.02956469*rh2 + 0.001305828*temp_C*rh2 - 6.4476e-06*temp2*rh2);
+ #endif
+ }
+
+@@ -88,9 +88,9 @@
+ temp3=temp2*temp_F;
+ rh2=rh*rh;
+ rh3=rh2*rh;
+- return round(16.923 + .185212*temp_F + 5.37941*rh - .100254*temp_F*rh + (9.41695e-3)*temp2 + (7.28898e-3)*rh2 + (3.45372e-4)*temp2*rh - (8.14971e-4)*temp_F*rh2 + (1.02102e-5)*temp2*rh2 - (3.8646e-5)*temp3 + (2.91583e-5)*rh3 + (1.42721e-6)*temp3*rh + (1.97483e-7)*temp_F*rh3 - (2.18429e-8)*temp3*rh2 + (8.43296e-10)*temp2*rh3 - (4.81975e-11)*temp3*rh3);
++ return rint(16.923 + .185212*temp_F + 5.37941*rh - .100254*temp_F*rh + (9.41695e-3)*temp2 + (7.28898e-3)*rh2 + (3.45372e-4)*temp2*rh - (8.14971e-4)*temp_F*rh2 + (1.02102e-5)*temp2*rh2 - (3.8646e-5)*temp3 + (2.91583e-5)*rh3 + (1.42721e-6)*temp3*rh + (1.97483e-7)*temp_F*rh3 - (2.18429e-8)*temp3*rh2 + (8.43296e-10)*temp2*rh3 - (4.81975e-11)*temp3*rh3);
+ #if 0
+- return round(-42.379 + 2.04901523*temp_F + 10.14333127*rh - 0.22475541*temp_F*rh - .00683783*temp2 - .05481717*rh2 + .00122874*temp2*rh + .00085282*temp_F*rh2 - .00000199*temp2*rh2);
++ return rint(-42.379 + 2.04901523*temp_F + 10.14333127*rh - 0.22475541*temp_F*rh - .00683783*temp2 - .05481717*rh2 + .00122874*temp2*rh + .00085282*temp_F*rh2 - .00000199*temp2*rh2);
+ #endif
+ }
+
+@@ -106,14 +106,14 @@
+
+ ret=35.74 + 0.6215*temp_F + (-35.75 + 0.4275*temp_F)*pow(windspeed*50292/57875.0, 0.16);
+ if(ret>temp_F) return temp_F;
+- return round(ret);
++ return rint(ret);
+ }
+
+ /* Length Conversions */
+
+ int in2cm(int in){
+ if(in<0) return in;
+- return round(in*2.54);
++ return rint(in*2.54);
+ }
+
+ float m2mi(int meters){
+@@ -125,27 +125,27 @@
+
+ int knots2mph(int knots){
+ if(knots<0) return knots;
+- return round(knots*57875/50292.0);
++ return rint(knots*57875/50292.0);
+ }
+
+ int knots2kph(int knots){
+ if(knots<0) return knots;
+- return round(knots*463/250.0);
++ return rint(knots*463/250.0);
+ }
+
+ int kph2knots(int kph){
+ if(kph<0) return kph;
+- return round(kph*250/463.0);
++ return rint(kph*250/463.0);
+ }
+
+ int knots2mps(int knots){
+ if(knots<0) return knots;
+- return round(knots*463/900.0);
++ return rint(knots*463/900.0);
+ }
+
+ int mps2knots(int mps){
+ if(mps<0) return mps;
+- return round(mps*900/463.0);
++ return rint(mps*900/463.0);
+ }
+
+ int knots2beaufort(int knots){
+@@ -170,12 +170,12 @@
+
+ int temp_C2F(int temp_C){
+ if(temp_C==999) return 999;
+- return round(temp_C*9/5.0+32);
++ return rint(temp_C*9/5.0+32);
+ }
+
+ int temp_F2C(int temp_F){
+ if(temp_F==999) return 999;
+- return round((temp_F-32)*5/9.0);
++ return rint((temp_F-32)*5/9.0);
+ }
+
+
diff --git a/misc/wmweather+/files/patch-convert.h b/misc/wmweather+/files/patch-convert.h
new file mode 100644
index 000000000000..31339f20c4a3
--- /dev/null
+++ b/misc/wmweather+/files/patch-convert.h
@@ -0,0 +1,11 @@
+--- convert.h.orig Fri Sep 6 04:04:06 2002
++++ convert.h Fri Apr 11 02:07:44 2003
+@@ -12,6 +12,8 @@
+ * x<0 is used for rh, pressure, and windspeed
+ */
+
++#define NAN 0/0
++
+ /* Calculations */
+ int rh_C(int temp_C, int dewpt_C);
+ int rh_F(int temp_F, int dewpt_F);
diff --git a/misc/wmweather+/files/patch-moon.c b/misc/wmweather+/files/patch-moon.c
new file mode 100644
index 000000000000..5402458672c7
--- /dev/null
+++ b/misc/wmweather+/files/patch-moon.c
@@ -0,0 +1,11 @@
+--- moon.c.orig Sun Sep 22 22:00:53 2002
++++ moon.c Fri Apr 11 02:07:44 2003
+@@ -44,7 +44,7 @@
+ #include "wmgeneral/wmgeneral-x11.h"
+
+ static double fpart(double t){
+- return t-trunc(t);
++ return rint(t);
+ }
+
+ double calc_moon(int month, int day, int year, int hm){
diff --git a/misc/wmweather+/files/patch-subst.c b/misc/wmweather+/files/patch-subst.c
new file mode 100644
index 000000000000..47970b1ce01d
--- /dev/null
+++ b/misc/wmweather+/files/patch-subst.c
@@ -0,0 +1,11 @@
+--- subst.c.orig Sun Sep 22 22:00:53 2002
++++ subst.c Fri Apr 11 02:07:44 2003
+@@ -48,7 +48,7 @@
+ char *format=NULL;
+ size_t formatlen=0;
+ int flags;
+- ssize_t str_start;
++ size_t str_start;
+
+ for(i=j=0; s[i]!='\0'; i++){
+ if(s[i]!='%'){
diff --git a/misc/wmweather+/files/patch-wmweather+.c b/misc/wmweather+/files/patch-wmweather+.c
new file mode 100644
index 000000000000..dfc56f2d8529
--- /dev/null
+++ b/misc/wmweather+/files/patch-wmweather+.c
@@ -0,0 +1,28 @@
+--- wmweather+.c.orig Sun Mar 23 01:04:41 2003
++++ wmweather+.c Fri Apr 11 02:07:45 2003
+@@ -103,7 +103,7 @@
+ /**********************************
+ * Prototypes
+ **********************************/
+-void usage(int i) __THROW __attribute__ ((__noreturn__));
++void usage(int i);
+ void printversion(void);
+ int readconf(char *file);
+ int parse_option(char *option, char *value);
+@@ -671,12 +671,12 @@
+ F("Please specify a METAR station.\n See http://www.nws.noaa.gov/tg/siteloc.shtml\n");
+ }
+ if(latitude==999){{
+- time_t t=0;
+ int flag=0;
+-
+- localtime(&t);
++ time_t t=time(NULL);
++ struct tm *tm;
++ tm=gmtime(&t);
+ latitude=0;
+- longitude=timezone/240;
++ longitude=tm->tm_gmtoff/240;
+ if(longitude<0){
+ flag=1;
+ longitude=-longitude;