[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sparc64 breakage



Just a follow up on the status of icewm on sparc64 - I was told that using
'long double' is dangerous. ypaint.cc is the only file in icewm that uses
'long double', but it's not needed. I've been running icewm with this
patch on sparc64 for couple of days, also briefly tested on i386 - works
fine.


$OpenBSD$
--- src/ypaint.cc.orig	2004-03-18 23:34:54.000000000 -0600
+++ src/ypaint.cc	2004-03-18 23:48:08.000000000 -0600
@@ -143,11 +143,10 @@ void YColor::alloc() {
     if (Success == XAllocColor(app->display(), app->colormap(), &color))
     {
         int j, ncells;
-        double long d = 65536. * 65536. * 65536. * 24;
         XColor clr;
         unsigned long pix;
         long d_red, d_green, d_blue;
-        double long u_red, u_green, u_blue;
+        double u_red, u_green, u_blue, d1, d = 65536 * 65536 * 65536 * 24;
 
         pix = 0xFFFFFFFF;
         ncells = DisplayCells(app->display(), DefaultScreen(app->display()));
@@ -163,7 +162,7 @@ void YColor::alloc() {
             u_green = 4UL * (d_green * d_green);
             u_blue  = 2UL * (d_blue  * d_blue);
 
-            double d1 = u_red + u_blue + u_green;
+            d1 = u_red + u_blue + u_green;
 
             if (pix == 0xFFFFFFFF || d1 < d) {
                 pix = j;



Visit your host, monkey.org