diff dwt/dnd/TextTransfer.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 e76aa0b07480
line wrap: on
line diff
--- a/dwt/dnd/TextTransfer.d	Wed Aug 27 14:10:03 2008 +0200
+++ b/dwt/dnd/TextTransfer.d	Wed Aug 27 14:30:35 2008 +0200
@@ -60,7 +60,7 @@
     if (!checkText(object) || !isSupportedType(transferData)) {
         DND.error(DND.ERROR_INVALID_DATA);
     }
-    String String = (String)object;
+    String String = cast(String)object;
     char[] chars = new char[String.length()];
     String.getChars (0, chars.length, chars, 0);
     transferData.result = -1;
@@ -74,10 +74,10 @@
                 range.length = chars.length;
                 int encoding = OS.CFStringGetSystemEncoding();
                 int[] size = new int[1];
-                int numChars = OS.CFStringGetBytes(cfString, range, encoding, (byte)'?', true, null, 0, size);
+                int numChars = OS.CFStringGetBytes(cfString, range, encoding, cast(byte)'?', true, null, 0, size);
                 if (numChars is 0) return;
                 buffer = new byte[size[0]];
-                numChars = OS.CFStringGetBytes(cfString, range, encoding, (byte)'?', true, buffer, size [0], size);
+                numChars = OS.CFStringGetBytes(cfString, range, encoding, cast(byte)'?', true, buffer, size [0], size);
                 if (numChars is 0) return;
             } finally {
                 OS.CFRelease(cfString);
@@ -146,7 +146,7 @@
 }
 
 bool checkText(Object object) {
-    return (object !is null && object instanceof String && ((String)object).length() > 0);
+    return (object !is null && object instanceof String && (cast(String)object).length() > 0);
 }
 protected bool validate(Object object) {
     return checkText(object);