diff dwt/graphics/Color.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/Color.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/graphics/Color.d	Wed Aug 27 14:30:35 2008 +0200
@@ -123,13 +123,13 @@
 public bool equals(Object object) {
     if (object is this) return true;
     if (!(object instanceof Color)) return false;
-    Color color = (Color)object;
+    Color color = cast(Color)object;
     float[] rgbColor = color.handle;
     if (handle is rgbColor) return true;
     return device is color.device &&
-        (int)(handle[0] * 255) is (int)(rgbColor[0] * 255) &&
-        (int)(handle[1] * 255) is (int)(rgbColor[1] * 255) &&
-        (int)(handle[2] * 255) is (int)(rgbColor[2] * 255);
+        cast(int)(handle[0] * 255) is cast(int)(rgbColor[0] * 255) &&
+        cast(int)(handle[1] * 255) is cast(int)(rgbColor[1] * 255) &&
+        cast(int)(handle[2] * 255) is cast(int)(rgbColor[2] * 255);
 }
 
 /**
@@ -143,7 +143,7 @@
  */
 public int getBlue() {
     if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED);
-    return (int)(handle[2] * 255);
+    return cast(int)(handle[2] * 255);
 }
 
 /**
@@ -157,7 +157,7 @@
  */
 public int getGreen() {
     if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED);
-    return (int)(handle[1] * 255);
+    return cast(int)(handle[1] * 255);
 }
 
 /**
@@ -171,7 +171,7 @@
  */
 public int getRed() {
     if (isDisposed()) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED);
-    return (int)(handle[0] * 255);
+    return cast(int)(handle[0] * 255);
 }
 
 /**
@@ -186,7 +186,7 @@
  */
 public int hashCode() {
     if (isDisposed()) return 0;
-    return (int)(handle[0] * 255) ^ (int)(handle[1] * 255) ^ (int)(handle[2] * 255);
+    return cast(int)(handle[0] * 255) ^ cast(int)(handle[1] * 255) ^ cast(int)(handle[2] * 255);
 }
 
 /**