From e73fd0621e85e8fa881186a4b3777c04b1d1adea Mon Sep 17 00:00:00 2001 From: sean Date: Mon, 6 Oct 2008 19:39:07 +0000 Subject: [PATCH] Fixed a few mistakes regarding invariance, etc, between D1 and D2. git-svn-id: http://svn.dsource.org/projects/druntime/trunk@14 4a9d5153-6564-4b3f-b5e1-7e8e9dac548f --- import/object.di | 2 +- src/compiler/dmd/typeinfo/ti_cdouble.d | 2 +- src/compiler/dmd/typeinfo/ti_cfloat.d | 2 +- src/compiler/dmd/typeinfo/ti_creal.d | 2 +- src/compiler/dmd/typeinfo/ti_double.d | 2 +- src/compiler/dmd/typeinfo/ti_float.d | 2 +- src/compiler/dmd/typeinfo/ti_real.d | 2 +- src/compiler/dmd/util/utf.d | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/import/object.di b/import/object.di index 1ad5c94..2ad7413 100644 --- a/import/object.di +++ b/import/object.di @@ -4,7 +4,7 @@ alias typeof(int.sizeof) size_t; alias typeof(cast(void*)0 - cast(void*)0) ptrdiff_t; alias size_t hash_t; -alias int equals_t; +alias bool equals_t; alias invariant(char)[] string; alias invariant(wchar)[] wstring; diff --git a/src/compiler/dmd/typeinfo/ti_cdouble.d b/src/compiler/dmd/typeinfo/ti_cdouble.d index 89fa9f1..c63d16b 100644 --- a/src/compiler/dmd/typeinfo/ti_cdouble.d +++ b/src/compiler/dmd/typeinfo/ti_cdouble.d @@ -13,7 +13,7 @@ class TypeInfo_r : TypeInfo (cast(uint *)p)[2] + (cast(uint *)p)[3]; } - static int _equals(cdouble f1, cdouble f2) + static equals_t _equals(cdouble f1, cdouble f2) { return f1 == f2; } diff --git a/src/compiler/dmd/typeinfo/ti_cfloat.d b/src/compiler/dmd/typeinfo/ti_cfloat.d index f07b96a..cdc2b51 100644 --- a/src/compiler/dmd/typeinfo/ti_cfloat.d +++ b/src/compiler/dmd/typeinfo/ti_cfloat.d @@ -12,7 +12,7 @@ class TypeInfo_q : TypeInfo return (cast(uint *)p)[0] + (cast(uint *)p)[1]; } - static int _equals(cfloat f1, cfloat f2) + static equals_t _equals(cfloat f1, cfloat f2) { return f1 == f2; } diff --git a/src/compiler/dmd/typeinfo/ti_creal.d b/src/compiler/dmd/typeinfo/ti_creal.d index 1b39684..12cab26 100644 --- a/src/compiler/dmd/typeinfo/ti_creal.d +++ b/src/compiler/dmd/typeinfo/ti_creal.d @@ -14,7 +14,7 @@ class TypeInfo_c : TypeInfo (cast(uint *)p)[4]; } - static int _equals(creal f1, creal f2) + static equals_t _equals(creal f1, creal f2) { return f1 == f2; } diff --git a/src/compiler/dmd/typeinfo/ti_double.d b/src/compiler/dmd/typeinfo/ti_double.d index d62f4f7..d8407e3 100644 --- a/src/compiler/dmd/typeinfo/ti_double.d +++ b/src/compiler/dmd/typeinfo/ti_double.d @@ -12,7 +12,7 @@ class TypeInfo_d : TypeInfo return (cast(uint *)p)[0] + (cast(uint *)p)[1]; } - static int _equals(double f1, double f2) + static equals_t _equals(double f1, double f2) { return f1 == f2 || (f1 !<>= f1 && f2 !<>= f2); diff --git a/src/compiler/dmd/typeinfo/ti_float.d b/src/compiler/dmd/typeinfo/ti_float.d index 7d6d719..3236b2d 100644 --- a/src/compiler/dmd/typeinfo/ti_float.d +++ b/src/compiler/dmd/typeinfo/ti_float.d @@ -12,7 +12,7 @@ class TypeInfo_f : TypeInfo return *cast(uint *)p; } - static int _equals(float f1, float f2) + static equals_t _equals(float f1, float f2) { return f1 == f2 || (f1 !<>= f1 && f2 !<>= f2); diff --git a/src/compiler/dmd/typeinfo/ti_real.d b/src/compiler/dmd/typeinfo/ti_real.d index a117a50..f9c9d74 100644 --- a/src/compiler/dmd/typeinfo/ti_real.d +++ b/src/compiler/dmd/typeinfo/ti_real.d @@ -12,7 +12,7 @@ class TypeInfo_e : TypeInfo return (cast(uint *)p)[0] + (cast(uint *)p)[1] + (cast(ushort *)p)[4]; } - static int _equals(real f1, real f2) + static equals_t _equals(real f1, real f2) { return f1 == f2 || (f1 !<>= f1 && f2 !<>= f2); diff --git a/src/compiler/dmd/util/utf.d b/src/compiler/dmd/util/utf.d index 50d4a51..012d7c3 100644 --- a/src/compiler/dmd/util/utf.d +++ b/src/compiler/dmd/util/utf.d @@ -586,7 +586,7 @@ Checks to see if string is well formed or not. $(D S) can be an array */ void validate(S)(in S s) { - invariant len = s.length; + auto len = s.length; for (size_t i = 0; i < len; ) { decode(s, i); -- 2.43.0