diff options
Diffstat (limited to 'source')
| -rw-r--r-- | source/tanya/container/string.d | 3 | ||||
| -rw-r--r-- | source/tanya/math/mp.d | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/source/tanya/container/string.d b/source/tanya/container/string.d index 73aab41..1b95cfd 100644 --- a/source/tanya/container/string.d +++ b/source/tanya/container/string.d @@ -264,7 +264,8 @@ if (is(Unqual!E == char)) body { dchar chr; - ubyte units, mask; + ubyte units; + int mask; const(char)* it = this.begin; if (*it & 0x80) diff --git a/source/tanya/math/mp.d b/source/tanya/math/mp.d index a045b25..f062c47 100644 --- a/source/tanya/math/mp.d +++ b/source/tanya/math/mp.d @@ -393,7 +393,9 @@ struct Integer T opCast(T)() const if (isIntegral!T && isSigned!T) { - return this.sign ? -(cast(Unsigned!T) this) : cast(Unsigned!T) this; + return this.sign + ? cast(T) -(cast(Promoted!(Unsigned!T)) (cast(Unsigned!T) this)) + : cast(Unsigned!T) this; } /// @@ -1072,7 +1074,7 @@ struct Integer assert(h1 == 79); h2 = ~h1; - assert(h2 == ~cast(ubyte) 79); + assert(h2 == cast(ubyte) ~79); } /// ditto |
