diff dwt/graphics/RGB.d @ 7:e831403a80a9

Add 'cast' to casts
author Frank Benoit <benoit@tionex.de>
date Wed, 27 Aug 2008 14:30:35 +0200
parents 1a8b3cb347e0
children a9ab4c738ed8
line wrap: on
line diff
--- a/dwt/graphics/RGB.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/graphics/RGB.d	Wed Aug 27 14:30:35 2008 +0200
@@ -105,7 +105,7 @@
     } else {
         if (hue is 360) hue = 0;
         hue /= 60;  
-        int i = (int)hue;
+        int i = cast(int)hue;
         float f = hue - i;
         float p = brightness * (1 - saturation);
         float q = brightness * (1 - saturation * f);
@@ -144,9 +144,9 @@
                 break;
         }
     }
-    red = (int)(r * 255 + 0.5);
-    green = (int)(g * 255 + 0.5);
-    blue = (int)(b * 255 + 0.5);    
+    red = cast(int)(r * 255 + 0.5);
+    green = cast(int)(g * 255 + 0.5);
+    blue = cast(int)(b * 255 + 0.5);    
 }
 
 /**
@@ -195,7 +195,7 @@
 public bool equals(Object object) {
     if (object is this) return true;
     if (!(object instanceof RGB)) return false;
-    RGB rgb = (RGB)object;
+    RGB rgb = cast(RGB)object;
     return (rgb.red is this.red) && (rgb.green is this.green) && (rgb.blue is this.blue);
 }