Mercurial > projects > dwt2
diff java/src/java/mangoicu/UMessageFormat.d @ 21:9b96950f2c3c
the 'java' tree compiles on both D1-Tango and D2-Phobos
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 19 Mar 2009 20:38:55 +0100 |
parents | dccb717aa902 |
children |
line wrap: on
line diff
--- a/java/src/java/mangoicu/UMessageFormat.d Wed Mar 18 12:10:17 2009 +0100 +++ b/java/src/java/mangoicu/UMessageFormat.d Thu Mar 19 20:38:55 2009 +0100 @@ -256,12 +256,13 @@ ***************************************************************/ version( D_Version2 ){ + mixin( "invariant() { invariant_(); }"); } else{ - mixin( "invariant - { - assert (index < args.length); - }"); + mixin( "invariant { invariant_(); }"); + } + private void invariant_(){ + assert (index < args.length); } /*************************************************************** @@ -271,7 +272,11 @@ Args* reset () { index = 0; - return this; + version(D_Version2){ + return &this; + } else { + return this; + } } /*************************************************************** @@ -282,7 +287,11 @@ { args[index] = cast(uint) cast(wchar*) x.get(); ++index; - return this; + version(D_Version2){ + return &this; + } else { + return this; + } } /*************************************************************** @@ -293,7 +302,11 @@ { args[index] = cast(uint) cast(wchar*) x; ++index; - return this; + version(D_Version2){ + return &this; + } else { + return this; + } } /*************************************************************** @@ -304,7 +317,11 @@ { args[index] = x; ++index; - return this; + version(D_Version2){ + return &this; + } else { + return this; + } } /*************************************************************** @@ -315,7 +332,11 @@ { *(cast(double*) &args[index]) = x; index += 2; - return this; + version(D_Version2){ + return &this; + } else { + return this; + } } } @@ -383,16 +404,16 @@ ***********************************************************************/ - static void test() - { - UString output = new UString(100); - wchar[] format = "{0} {1, number, currency} {2, number, integer}"; + //static void test() + //{ + // UString output = new UString(100); + // wchar[] format = "{0} {1, number, currency} {2, number, integer}"; - UMessageFormat msg = new UMessageFormat (format); + // UMessageFormat msg = new UMessageFormat (format); - msg.Args args; - msg.format (output, args.add("abc").add(152.0).add(456)); - } + // msg.Args args; + // msg.format (output, args.add("abc").add(152.0).add(456)); + //} }