Commit graph

19551 commits

Author SHA1 Message Date
Grim Maple
1c3903c2e6 Fix Issue 22637 - std.conv to!double and parse!double dont throw on under/overflow
This happened because `parse` enforced on real.
And provided number actually fits real.
Changed to enforce on `Target` type instead
2022-07-09 18:09:25 +03:00
Iain Buclaw
a9a504f406 Merge remote-tracking branch 'upstream/stable' into merge_stable 2022-07-09 17:08:41 +02:00
Grim Maple
553d8cb56c Fix Issue 18631 - std.random.choice does not work with const arrays
`auto ref` is not needed on `Range` param
2022-07-07 15:38:21 +00:00
Razvan Nitu
7e0dbdf1a3
Merge pull request #8500 from RazvanN7/fix_scope_failure
Use try-catch instead of scope(failure) for block that returns
2022-07-07 16:08:38 +03:00
RazvanN7
52935b182a Use try-catch instead of scope(failure) for block that returns 2022-07-07 15:28:43 +03:00
Geod24
87c6e7e354 std.sumtype: Move TagTuple to module level to reduce instantiations
TagTuple wass previously nested within matchImpl, meaning it gets
a different instantiation for each match call with different handlers.
This is not required, as the only template parameters it needs are
the SumTypes being used. In practice, we might even get away with
using the length, but the gain is likely to be marginal compared
to the gains from moving it out of matchImpl.
Another underlying motivation for this change is that it works around
a compiler bug triggered with complex code using const SumType
(the compiler complains that 'this' for 'invariant' is of the wrong type,
const vs non-const).
2022-07-07 00:05:35 +00:00
Iain Buclaw
1516ecad93 std.complex: Use complex(LN10) as divisor in log10 2022-07-05 23:25:40 +00:00
Iain Buclaw
ff16d73e4c std.math.exponential: Fix coefficients for log2 and log10 2022-07-05 23:24:50 +00:00
RazvanN7
674ccc04ec Add documentation for + use selective imports for toNative 2022-07-05 15:02:43 +03:00
Iain Buclaw
0d72aed12a std.complex: Add member function to returnComplex as a native type 2022-07-05 14:59:32 +03:00
Walter Bright
38243e3716
upgrade zlib C files to C11 (#8485)
upgrade zlib C files to C11

Signed-off-by: Luís Ferreira <contact@lsferreira.net>
Signed-off-by: Razvan Nitu <RazvanN7@users.noreply.github.com>
Merged-on-behalf-of: Razvan Nitu <RazvanN7@users.noreply.github.com>
2022-07-05 10:30:45 +00:00
Razvan Nitu
c84fc8149b
Merge pull request #8494 from ibuclaw/logimpl
std.math.exponential: Split generic logN implementations to own impl templates
2022-07-05 12:22:58 +03:00
Iain Buclaw
0497537e22 std.math.exponential: Split generic logN implementations to own impl templates 2022-07-05 10:37:31 +02:00
Iain Buclaw
682e16d3ec std.math.exponential: Implement pure logb() for double and float precision 2022-07-04 23:48:56 +00:00
Walter Bright
511a42d2ea compile Phobos .c files with ImportC for mscoff 2022-07-04 22:53:01 +00:00
Walter Bright
ea80597765
Merge pull request #8488 from WalterBright/ImportCwin32omf
compile Phobos .c files with ImportC for win32omf
2022-07-04 11:58:35 -07:00
Iain Buclaw
829c2580f6 posix.mak: Pass absolute path of dmd when invoking druntime's makefile 2022-07-04 12:14:03 +00:00
Walter Bright
473e2f49a9 compile Phobos .c files with ImportC for win32omf 2022-07-04 01:37:32 -07:00
Dennis
4c58874384
Merge pull request #8483 from WebFreak001/fix-std-file-remove-null
fix Issue 23215: segfault in std.file.remove
2022-06-28 15:16:28 +02:00
WebFreak001
73589e6f81
fix Issue 23215: segfault in std.file.remove 2022-06-28 13:15:30 +02:00
Dennis
18bb5978d8
Merge pull request #8482 from kinke/cleanup_win64.mak
Somewhat clean up win64.mak
2022-06-28 12:21:59 +02:00
Martin Kinkelin
d8f3b19483 Somewhat clean up win64.mak
* Remove some unused variables.
* Default to a matching MSVC cl.exe & lib.exe in PATH instead of an
  ancient Visual Studio 2010 installation.
* Remove explicit 32-bit recipes, requiring a separate make
  invocation.

Analogous to https://github.com/dlang/druntime/pull/3853.
2022-06-24 20:38:11 +02:00
Su
a4a18d21c4
preallocate oom error (#8480)
* preallocate oom error

fixes issue 23196.

unfortunately, while i believe it should be possible to make this function `@nogc nothrow` [since we are throwing an error, which cannot be recovered from], i wasn't able to figure out how to get enforce to realise it. advice would be greatly appreciated on this front.

* undo wording change

* Update stdio.d

use onOutOfMemoryError instead of custom implementation

* nogc nothrow

* style fix

* remove unneeded variable

* remove unused import
2022-06-22 06:33:10 +01:00
Dennis Korpel
e34f88f64d Add missing return scope to std.file 2022-06-22 02:27:36 +00:00
Tomáš Chaloupka
9ac9d359ac Fix 23132 - Avoid ranges copy when compared for equality 2022-06-21 15:09:48 +00:00
Mathias LANG
16cacff3e6
Merge pull request #8478 from Ast-x64/numeric-quadruple
std.numeric: Hack with quadruple-precision real type
2022-06-18 15:31:37 +02:00
Ast-x64
f27f15b075 std/numeric.d: Add tests for real type 2022-06-18 09:43:52 +08:00
Ast-x64
f50d7dfe62
std/numeric.d: Reorder alignment for BigEndian
Co-authored-by: Iain Buclaw <ibuclaw@gdcproject.org>
2022-06-18 01:15:59 +08:00
Ast-x64
c5d80bae52
std/numeric.d: Make isIEEEQuadruple private
Co-authored-by: Iain Buclaw <ibuclaw@gdcproject.org>
2022-06-17 21:38:33 +08:00
Ast-x64
a7f3230e95
std/numeric.d: Use a more sensible padding array
Co-authored-by: Luís Ferreira <contact@lsferreira.net>
2022-06-17 10:02:12 +08:00
Ast-x64
0c56468d19 RISCV: Fix wrong ExceptionMask values
According to RISCV specifications
https://riscv.org/wp-content/uploads/2019/12/riscv-spec-20191213.pdf,
figure 11.2, the mask flags should be NX, UF, OF, DZ, NV in order.
2022-06-16 20:22:10 +00:00
Ast-x64
b2d5da9c43 Extend floating point precision in some tests
These tests may work better with quadruple-presicion real types now.
2022-06-16 19:53:02 +00:00
Ast-x64
488761d86a std.numeric: Hack with quadruple-precision real type
The CustomFloat should be converted to real before most operations, but
there is no support for convertions of real types with
quadruple-precision (e.g. real type on RISCV64 platform). As the
significand is stored using 112 bits, which cannot fit in a ulong type
(CustomFloat do not allow significand more than a ulong), we should only
use the highest 64 bits of significand (this may cause presicion loss
	from real type, but is enough for what CustomFloat can support
	at most). So add 48 padding bits by declaring a uint and a
ushort before the significand, and set align(1) in this case.
2022-06-17 00:57:40 +08:00
Dennis Korpel
f54e0cd163 Issue 23190 - make some std.file unittests @safe 2022-06-16 11:39:29 +00:00
Robert burner Schadek
1f0ec5405f remove compile features from std.experimental.logger
Fix Iain comment

Razvan suggest changelog fix
2022-06-14 16:42:40 +00:00
Paul Backus
a504a5e7d6 Fix Issue 23182 - Can't assign struct with opAssign to SumType in CTFE
SumType.opAssign now avoids calling core.lifetime.move or
core.lifetime.forward during CTFE whenever possible.
2022-06-14 04:38:57 +00:00
Razvan Nitu
1206fc94f9
Merge pull request #8470 from dlang/9il-patch-2
nogc biguintx86.d
2022-06-09 15:00:35 +03:00
Razvan Nitu
9a4bea4176
Merge pull request #8472 from iK4tsu/fix-sumtype-version-invariant-unittest
test(sumtype): utilize D_Invariants conditional compilation
2022-05-30 14:04:52 +03:00
João Lourenço
5e746a0490
test(sumtype): utilize D_Invariants conditional compilation
Signed-off-by: João Lourenço <jlourenco5691@gmail.com>
2022-05-30 10:35:07 +01:00
Walter Bright
28bf65292c add scope to MmFile constructors 2022-05-30 05:43:57 +00:00
Ilia Ki
f522ea4fcc
ditto 2022-05-29 22:07:47 +04:00
Ilia Ki
a9baa6aa3e
Update biguintx86.d 2022-05-29 21:59:57 +04:00
Hiroki Noda
d46814c863 Add std.int128 to std module 2022-05-20 16:26:52 +00:00
Luís Ferreira
96858b5dde
chore(utf): documentation of byUTF is wrong about thrown exceptions (#8464)
chore(utf): documentation of byUTF is wrong about thrown exceptions

Signed-off-by: Dennis <dkorpel@users.noreply.github.com>
Merged-on-behalf-of: Dennis <dkorpel@users.noreply.github.com>
2022-05-19 09:48:24 +00:00
Luís Ferreira
3c3f40847c chore(std): add std.checkedint to std module
Previous change that moved std.checkedint out of experimental stage
didn't added the module to the list of modules on std module
`std/package.d`. This patch does that.

Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2022-05-19 09:24:26 +00:00
yori
b22224db3f Added @nogc to thisProcessID and thisThreadID in std.process 2022-05-16 21:21:20 +00:00
The Dlang Bot
3a1cd9a014
Merge pull request #8461 from MartinNowak/merge_stable
merge stable

Signed-off-by: Iain Buclaw <ibuclaw@users.noreply.github.com>
Merged-on-behalf-of: Iain Buclaw <ibuclaw@users.noreply.github.com>
2022-05-15 12:09:20 +00:00
Martin Nowak
e90b14edc9 Merge remote-tracking branch 'upstream/stable' into merge_stable 2022-05-15 12:17:14 +02:00
Martin Nowak
604534d7cb purge changelog 2022-05-15 11:53:44 +02:00
Martin Kinkelin
b20444aca4 Use new __traits(classInstanceAlignment)
Tackling the Phobos part of issue 16508.
2022-05-13 18:38:09 +00:00