std.datetime: Construct struct timespec using named arguments#10838
std.datetime: Construct struct timespec using named arguments#10838ibuclaw wants to merge 1 commit intodlang:masterfrom
Conversation
It is not guaranteed that the fields of the struct are in the assumed order, for example, Musl. See dlang/dmd#21249.
|
Thanks for your pull request, @ibuclaw! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + phobos#10838" |
|
This is one of those funny cases where bitfields would actually be useful. 😬 Since that'd allow the pad fields of |
| assert(SysTime(DateTime(1970, 1, 1, 0, 0, 1), hnsecs(9), UTC()).toTimeSpec() == timespec(tv_sec: 1, tv_nsec: 900)); | ||
| assert(SysTime(DateTime(1970, 1, 1, 0, 0, 1), hnsecs(10), UTC()).toTimeSpec() == timespec(tv_sec: 1, tv_nsec: 1000)); | ||
| assert(SysTime(DateTime(1970, 1, 1, 0, 0, 1), usecs(7), UTC()).toTimeSpec() == timespec(tv_sec: 1, tv_nsec: 7000)); |
There was a problem hiding this comment.
std/datetime/systime.d(2629:120)[warn]: Line is longer than 120 characters
std/datetime/systime.d(2630:120)[warn]: Line is longer than 120 characters
std/datetime/systime.d(2631:120)[warn]: Line is longer than 120 characters
There was a problem hiding this comment.
Man I wish we could suppress this. Because there isn't a way to split these that doesn't look ugly.
There was a problem hiding this comment.
Luckily, unnamed bitfields are padding the fields out now.
|
This change isn't required anymore for dlang/dmd#21249 anymore due to using unnamed bitfields instead. |
It is not guaranteed that the fields of the struct are in the assumed order, for example, Musl. See dlang/dmd#21249.