diff org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/Converter.d @ 51:c01d033c633a

[swt lin]
author Frank Benoit <benoit@tionex.de>
date Fri, 27 Mar 2009 19:58:06 +0100
parents f713da8bc051
children
line wrap: on
line diff
--- a/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/Converter.d	Fri Mar 27 15:30:20 2009 +0100
+++ b/org.eclipse.swt.gtk.linux.x86/src/org/eclipse/swt/internal/Converter.d	Fri Mar 27 19:58:06 2009 +0100
@@ -39,8 +39,8 @@
  */
 public final class Converter {
     public static const char  [] NullByteArray = "\0";
-    public static const char  [] EmptyByteArray = "";
-    public static const wchar [] EmptyCharArray = "";
+    public static const char  [] EmptyByteArray;
+    public static const wchar [] EmptyCharArray;
 
 /**
  * Returns the default code page for the platform where the
@@ -56,7 +56,7 @@
     int items_written;
     wchar* ptr = g_utf8_to_utf16 (toStringz(buffer), buffer.length, null, &items_written, null);
     if (!ptr){
-        return EmptyCharArray;
+        return cast(wchar[])EmptyCharArray;
     }
     wchar[] chars = ptr[ 0 .. items_written].dup;
     g_free (ptr);
@@ -80,7 +80,7 @@
     */
     char* ptr = g_utf16_to_utf8 (toString16z(buffer), buffer.length, & items_read, & items_written, null);
     if (!ptr) {
-        return terminate ? NullByteArray : EmptyByteArray;
+        return terminate ?cast(char[]) NullByteArray : cast(char[])EmptyByteArray;
     }
     char [] bytes = new char [items_written + (terminate ? 1 : 0)];
     bytes[ 0 .. items_written ] = ptr[ 0 .. items_written ];