Commit graph

19551 commits

Author SHA1 Message Date
dkorpel
66698dc5f5 Fix issue 18632 - enable use of fromStringz with char[n] 2021-07-12 01:33:15 +02:00
dkorpel
9ec24190b1 add explicit scope/return for pure functions 2021-07-11 13:34:25 +00:00
Walter Bright
ef28dede87
specialize max/min for common case (#7499)
specialize max/min for common case

Signed-off-by: Razvan Nitu <RazvanN7@users.noreply.github.com>
Merged-on-behalf-of: Razvan Nitu <RazvanN7@users.noreply.github.com>
2021-07-09 13:20:43 +00:00
Luís Ferreira
5ed958c773
Fix #22110: std.traits: isCallable fails for templated opCall (#8161)
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2021-07-08 06:45:54 +08:00
Luís Ferreira
47546dd850
std: array: refactor std.array unittest blocks and attribute annotation (#8155)
std: array: refactor std.array unittest blocks and attribute annotation

Signed-off-by: Mathias LANG <pro.mathias.lang@gmail.com>
Signed-off-by: Razvan Nitu <RazvanN7@users.noreply.github.com>
Merged-on-behalf-of: Razvan Nitu <RazvanN7@users.noreply.github.com>
2021-07-07 14:14:44 +00:00
Iain Buclaw
3fda9a161c azure-pipelines.yml: Reduce timeout time to 60 minutes 2021-07-07 11:13:38 +00:00
Vladimir Panteleev
73e51d395e Fix Issue 22100 - Support chained assignment of Nullable 2021-07-05 16:23:44 +00:00
berni44
b3e9f42da1 std.utf: Add isValidCodepoint. 2021-07-05 10:00:30 +00:00
Razvan Nitu
23f53c3870
Merge pull request #8159 from CyberShadow/pull-20210705-073502
Fix Issue 22101 - Nullable.get(fallback) cannot be used with non-@saf…
2021-07-05 16:45:13 +08:00
Vladimir Panteleev
7d666a26c0
Fix Issue 22101 - Nullable.get(fallback) cannot be used with non-@safe/pure/nothrow types 2021-07-05 07:35:03 +00:00
Vladimir Panteleev
9baab6030a std.container.array: Hide unintentionally-public unittest
This is a unittest for a bug, not a public example.
2021-07-05 05:40:36 +00:00
Iain Buclaw
09c6e53f40
Issue 21488 - Always compile phobos library with -fPIC on POSIX targets (#8154) 2021-07-02 10:07:30 +08:00
Nathan Sashihara
c441b2ad59 Fix 22093 - [Reg 2.097] std.typecons.RefCounted!T for struct T without an explicit toString or alias this previously could be converted to string even when uninitialized but now cannot 2021-06-30 05:51:01 +00:00
Razvan Nitu
b3097d47f7
Merge pull request #8147 from n8sh/fix-2074-trait-regressions
[Reg 2.074] std.traits.isFloatingPoint, isNumeric, isUnsigned, and isSigned should never be true for SIMD vectors, imaginary/complex numbers, or enums with character base types
2021-06-25 14:16:59 +08:00
DoctorNoobingstoneIPresume
7f9cc3fbbb std.container.Array: insertBack: Extra checks (including addition overflow). 2021-06-22 19:33:33 +03:00
Nathan Sashihara
61c00065a8 Streamline std.traits.BuiltinTypeOf & IntegralTypeOf
This incidentally fixes a 'TODO' in BuiltinTypeOf: ifloat/idouble/ireal
and cfloat/cdouble/creal were being collapsed to ireal and creal and
their qualifiers were being discarded.
2021-06-22 12:32:40 +00:00
Nathan Sashihara
136b750df1 Improve memory usage & speed of std.traits.isIntegral & isSomeChar 2021-06-21 10:12:39 +00:00
Nathan Sashihara
6c329ba358 Fix 22056, 22057, 22058 - [Reg 2.074] std.traits.isFloatingPoint, isNumeric, isUnsigned, and isSigned should never be true for SIMD vectors, imaginary/complex numbers, or enums with character base types 2021-06-21 05:26:43 -04:00
Luís Ferreira
808dca99af file: document dirEntries as no garantee of sorted output
Some unittests should compare with a sorted array to be
correct.

Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2021-06-20 10:52:39 +00:00
Ramanuj
afb382485b
Fix Issue 20393 - formattedRead accepts input, that should be rejected (#8144) 2021-06-16 16:08:53 +08:00
DoctorNoobingstoneIPresume
0b7bf8dc1f std.container.Array: Simplify implementation of length (by calling reserve). 2021-06-14 05:05:39 +00:00
Atila Neves
815a718c81 Fix static assert message in std.json 2021-06-08 15:12:25 +00:00
Walter Bright
13d84801e7 declaring templates inside static foreach is not reliable 2021-06-08 10:57:08 +00:00
dkorpel
010f6b7078 use static foreach for correct scope inference 2021-06-08 10:21:59 +00:00
dkorpel
5242beb167 add return scope to realloc 2021-06-08 09:32:30 +00:00
Razvan Nitu
4d6254fbb3
Merge pull request #8130 from iK4tsu/fix-algorithm-findsplit-methods
Fix std.algorithm findSplit methods module documentation
2021-06-08 13:43:02 +08:00
Martin Kinkelin
36fd878467 Fix Issue 22001 - Avoid undefined bytes in std.conv.toChars() results for radix 10
The buffer is initialized from right-to-left in initialize(), and unused
bytes are left alone. Previously, the whole result wasn't preinitialized
with T.init, so the unused buffer bytes weren't well-defined. Initialize
it now (with zeros), as the whole buffer is still used for equality/
identity comparisons etc.
2021-06-08 07:25:08 +08:00
The Dlang Bot
19003dd639
Merge pull request #8127 from kinke/bitpattern
[stable] std.math.operations: Slightly revise extractBitpattern()

Signed-off-by: Razvan Nitu <RazvanN7@users.noreply.github.com>
Merged-on-behalf-of: Razvan Nitu <RazvanN7@users.noreply.github.com>
2021-06-07 18:22:22 +00:00
João Lourenço
882cf3df43
std.algorithm: improve findSplit methods module documentation
Signed-off-by: João Lourenço <jlourenco5691@gmail.com>
2021-06-07 12:07:47 +01:00
The Dlang Bot
f6cfa2af2a
Merge pull request #8132 from MartinNowak/merge_stable
merge stable

Signed-off-by: Nathan Sashihara <n8sh@users.noreply.github.com>
Merged-on-behalf-of: Nathan Sashihara <n8sh@users.noreply.github.com>
2021-06-04 12:36:52 +00:00
Martin Nowak
7a461990da Merge remote-tracking branch 'upstream/stable' into merge_stable 2021-06-04 13:02:58 +02:00
Martin Nowak
c680a53086 purge changelog 2021-06-04 13:02:12 +02:00
Martin Kinkelin
e150b1e052 std.stdio: Restore compilability of unittests for iOS 2021-06-03 18:23:40 +00:00
Martin Kinkelin
679521d44e std.format.internal.floats: Restore compilability of unittests for targets with quadruple real precision
Such as non-Apple AArch64; `printFloat()` doesn't support that format.
2021-06-03 07:56:06 +00:00
Martin Kinkelin
06037a25b4 std.math.exponential: Minimally relax a pow() unittest for targets with 64-bit real
Required since #7783.
2021-06-03 07:56:03 +00:00
Martin Kinkelin
8946209a9b Revert #7823 - Faster pow implementation for integral exponents
There are multiple issues with that commit, incl. out-of-bounds read
on x86 systems and a significant performance decrease for qualified
floating-point types; see #8124 for a full list of flaws.

I'm questioning the tackled goal in the first place, because I expect
users to use that `pow` mainly with small integral exponents, *not*
expecting underflows to 0 or overflows to ±infinity, so optimizing
for these cases and sacrificing performance for the regular case doesn't
make a lot of sense to me.
2021-06-03 09:57:57 +09:00
Martin Kinkelin
3d90677e51 std.math.operations: Fix extractBitpattern() unittest 2021-06-02 21:22:27 +02:00
Martin Kinkelin
4d8be9050b std.math.operations: Slightly simplify extractBitpattern() 2021-06-02 20:45:13 +02:00
Martin Kinkelin
5a46c9ecf6 std.math.operations: Make extractBitpattern() @trusted
To enable unsafe reinterpret-casts directly, without extra lambdas.
2021-06-02 20:42:09 +02:00
Martin Kinkelin
ddd044d6c7 std.math.operations: Fix out-of-bounds read in extractBitpattern()
For 32-bit x86 targets with `real.sizeof == 12`.
2021-06-02 20:38:25 +02:00
dkorpel
d875674af7 fix local variable lifetimes in systime parsing 2021-06-02 02:12:41 +00:00
dkorpel
6c51d19c89 Add return scope to MultiArray ctor 2021-06-01 14:14:06 +02:00
dkorpel
d0a0cdb0a2 use icmp instead of toUpper in getopt 2021-06-01 13:36:56 +02:00
Walter Bright
74a40f4783 add @trusted for scope pointer to scope pointer 2021-05-31 00:45:26 +02:00
dkorpel
5f7816a77e use splitter instead of split in getopt 2021-05-30 03:00:56 +02:00
dkorpel
b1281eb67a add more return/scope to pure bigint functions 2021-05-30 01:10:13 +02:00
dkorpel
f62e725c91 add return scope to xml.toType 2021-05-30 01:07:37 +02:00
The Dlang Bot
3dad916640
Merge pull request #8112 from MartinNowak/merge_stable
merge stable

Signed-off-by: Nathan Sashihara <n8sh@users.noreply.github.com>
Merged-on-behalf-of: Nathan Sashihara <n8sh@users.noreply.github.com>
2021-05-29 17:54:43 +02:00
The Dlang Bot
86d586a2e8
Merge pull request #8118 from kinke/math_new
[stable] Fix missing imports for non-x87 real after std.math split-up

Signed-off-by: Iain Buclaw <ibuclaw@users.noreply.github.com>
Merged-on-behalf-of: Iain Buclaw <ibuclaw@users.noreply.github.com>
2021-05-29 16:08:25 +02:00
Martin Kinkelin
a5b66d6614 std.math.hardware: Remove unused InlineAsm_X87* version declarations 2021-05-29 14:50:32 +02:00