Mercurial > projects > dwt-mac
diff dwt/dwthelper/utils.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 | 30a762abda2a |
line wrap: on
line diff
--- a/dwt/dwthelper/utils.d Wed Aug 27 14:10:03 2008 +0200 +++ b/dwt/dwthelper/utils.d Wed Aug 27 14:30:35 2008 +0200 @@ -25,7 +25,7 @@ alias bool boolean; alias char[] String; alias char[] string; -alias tango.text.Text.Text!(char) StringBuffer; +alias tango.text.Text.Text!cast(wchar) StringBuffer; alias opEquals equals; alias PlatformException Error; @@ -59,7 +59,7 @@ return value == other; } public int opEquals( Object other ){ - if( auto o = cast(ValueWrapperT!(T))other ){ + if( auto o = cast(ValueWrapperT!cast(T))other ){ return value == o.value; } return false; @@ -105,7 +105,7 @@ alias Boolean ValueWrapperBool; -class Byte : ValueWrapperT!(byte) { +class Byte : ValueWrapperT!cast(byte) { public static byte parseByte( String s ){ try{ int res = tango.text.convert.Integer.parse( s ); @@ -125,7 +125,7 @@ alias Byte ValueWrapperByte; -class Integer : ValueWrapperT!(int) { +class Integer : ValueWrapperT!cast(int) { public static const int MIN_VALUE = 0x80000000; public static const int MAX_VALUE = 0x7fffffff; @@ -236,7 +236,7 @@ } alias Integer ValueWrapperInt; -class Double : ValueWrapperT!(double) { +class Double : ValueWrapperT!cast(double) { this( double value ){ super(value); } @@ -253,7 +253,7 @@ } } -class Float : ValueWrapperT!(float) { +class Float : ValueWrapperT!cast(float) { public static float POSITIVE_INFINITY = (1.0f / 0.0f); public static float NEGATIVE_INFINITY = ((-1.0f) / 0.0f); @@ -286,7 +286,7 @@ } } -class Long : ValueWrapperT!(long) { +class Long : ValueWrapperT!cast(long) { this( long value ){ super(value); } @@ -309,13 +309,13 @@ alias Long ValueWrapperLong; -// alias ValueWrapperT!(int) ValueWrapperInt; +// alias ValueWrapperT!cast(int) ValueWrapperInt; -alias ArrayWrapperT!(byte) ArrayWrapperByte; -alias ArrayWrapperT!(int) ArrayWrapperInt; -alias ArrayWrapperT!(Object) ArrayWrapperObject; -alias ArrayWrapperT!(char) ArrayWrapperString; -alias ArrayWrapperT!(String) ArrayWrapperString2; +alias ArrayWrapperT!cast(byte) ArrayWrapperByte; +alias ArrayWrapperT!cast(int) ArrayWrapperInt; +alias ArrayWrapperT!cast(Object) ArrayWrapperObject; +alias ArrayWrapperT!cast(wchar) ArrayWrapperString; +alias ArrayWrapperT!cast(String) ArrayWrapperString2; Object[] StringArrayToObjectArray( String[] strs ){ Object[] res = new Object[strs.length]; @@ -788,7 +788,7 @@ void ExceptionPrintStackTrace( Exception e ){ this( e, Stderr ); } -void ExceptionPrintStackTrace( Exception e, Print!(char) print ){ +void ExceptionPrintStackTrace( Exception e, Print!cast(wchar) print ){ Exception exception = e; while( exception !is null ){ print.formatln( "Exception in {}({}): {}", exception.file, exception.line, exception.msg ); @@ -914,7 +914,7 @@ } } -int SeqIndexOf(T)( tango.util.collection.model.Seq.Seq!(T) s, T src ){ +int SeqIndexOf(T)( tango.util.collection.model.Seq.Seq!cast(T) s, T src ){ int idx; foreach( e; s ){ if( e == src ){ @@ -937,7 +937,7 @@ return res; } -int seqIndexOf( tango.util.collection.model.Seq.Seq!(Object) seq, Object v ){ +int seqIndexOf( tango.util.collection.model.Seq.Seq!cast(Object) seq, Object v ){ int res = -1; int idx = 0; foreach( p; seq ){