mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
- Const inline enums would not always implicitly get converted to the underlying type.
- Update to dstring.append_string to take any type converting to String.
This commit is contained in:
@@ -331,14 +331,14 @@ fn Char32[] DString.copy_utf32(&self, Allocator allocator)
|
||||
}
|
||||
|
||||
<*
|
||||
@require $typeof(str) == String || $typeof(str) == DString : "Expected string or DString"
|
||||
@require $defined(String s = str) ||| $typeof(str) == DString : "Expected string or DString"
|
||||
*>
|
||||
macro void DString.append_string(&self, str)
|
||||
{
|
||||
$if $typeof(str) == String:
|
||||
self.append_bytes(str);
|
||||
$else
|
||||
$if $typeof(str) == DString:
|
||||
self.append_string_deprecated(str);
|
||||
$else
|
||||
self.append_bytes((String)str);
|
||||
$endif
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ fn void Streebog._final_private(&self) @local
|
||||
usz index = self.index >> 3;
|
||||
usz shift = (self.index & 0b111) * 8;
|
||||
|
||||
unprocessed_bits_count[0] = self.index * 8;
|
||||
unprocessed_bits_count[0] = self.index * 8ul;
|
||||
self.message[index] &= ~(ulong.max << shift);
|
||||
self.message[index++] ^= 1ul << shift;
|
||||
if (index < 8) self.message[index..] = {};
|
||||
|
||||
Reference in New Issue
Block a user