Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

merge stable #3468

Merged
merged 5 commits into from May 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/core/bitop.d
Expand Up @@ -953,27 +953,39 @@ pure T rol(T)(const T value, const uint count)
if (__traits(isIntegral, T) && __traits(isUnsigned, T))
{
assert(count < 8 * T.sizeof);
if (count == 0)
return cast(T) value;

return cast(T) ((value << count) | (value >> (T.sizeof * 8 - count)));
}
/// ditto
pure T ror(T)(const T value, const uint count)
if (__traits(isIntegral, T) && __traits(isUnsigned, T))
{
assert(count < 8 * T.sizeof);
if (count == 0)
return cast(T) value;

return cast(T) ((value >> count) | (value << (T.sizeof * 8 - count)));
}
/// ditto
pure T rol(uint count, T)(const T value)
if (__traits(isIntegral, T) && __traits(isUnsigned, T))
{
static assert(count < 8 * T.sizeof);
static if (count == 0)
return cast(T) value;

return cast(T) ((value << count) | (value >> (T.sizeof * 8 - count)));
}
/// ditto
pure T ror(uint count, T)(const T value)
if (__traits(isIntegral, T) && __traits(isUnsigned, T))
{
static assert(count < 8 * T.sizeof);
static if (count == 0)
return cast(T) value;

return cast(T) ((value >> count) | (value << (T.sizeof * 8 - count)));
}

Expand All @@ -996,4 +1008,9 @@ unittest

assert(rol!3(a) == 0b10000111);
assert(ror!3(a) == 0b00011110);

enum c = rol(uint(1), 0);
enum d = ror(uint(1), 0);
assert(c == uint(1));
assert(d == uint(1));
}
5 changes: 5 additions & 0 deletions src/core/sys/darwin/dlfcn.d
Expand Up @@ -38,3 +38,8 @@ int dladdr(const scope void* addr, Dl_info* info);
enum RTLD_NOLOAD = 0x10;
enum RTLD_NODELETE = 0x80;
enum RTLD_FIRST = 0x100;

enum RTLD_NEXT = cast(void*) -1;
enum RTLD_DEFAULT = cast(void*) -2;
enum RTLD_SELF = cast(void*) -3;
enum RTLD_MAIN_ONLY = cast(void*) -5;
2 changes: 1 addition & 1 deletion src/object.d
Expand Up @@ -926,7 +926,7 @@ class TypeInfo_Array : TypeInfo
if (result)
return result;
}
return cast(int)a1.length - cast(int)a2.length;
return (a1.length > a2.length) - (a1.length < a2.length);
}

override @property size_t tsize() nothrow pure const
Expand Down