Commit graph

16625 commits

Author SHA1 Message Date
vali0901
85b47bc401 Fix Issue 13893 - rawRead must take a non-empty buffer 2022-07-23 16:50:33 +03:00
Geod24
05cf9c260b std.file: Remove 'in' on OSX setattrlist declaration
Because 'in' are forbidden on extern C function with preview=in.
2022-07-21 00:55:52 +02:00
Robert burner Schadek
1ebccd3717 move @trusted unittest to @system 2022-07-20 10:06:58 +02:00
Atila Neves
f098027bd4 Fix synchronization when forwarding to the shared logger 2022-07-20 10:06:58 +02:00
Atila Neves
d4972da3d8 Fix typo 2022-07-20 10:06:58 +02:00
Atila Neves
e0855e0f9f stdSharedDefaultLogger is shared instead __gshared 2022-07-20 10:06:58 +02:00
Atila Neves
b624262394 Delete trustedLoad 2022-07-20 10:06:58 +02:00
Robert burner Schadek
63f49d6687 sharedLog returning shared(Logger)
Fixes #16232

changelog

-preview=nosharedaccess

code review

working on the tests

whitespace

spaces behind casts
2022-07-20 10:06:58 +02:00
Geod24
501a3ab35a std.typecons: Remove workaround for fixed issue 15862 2022-07-18 17:11:59 +02:00
Razvan Nitu
4c1354e84c
Merge pull request #8510 from dukc/unicode-ri-fix
Fix issue 23250 - corrected reginal indicator pairing.
2022-07-18 11:05:57 +03:00
Ate Eskola
26d8a41e83 removed reduntant import furgotten from debugging. 2022-07-16 12:38:20 +03:00
Ate Eskola
95d19d97ac Fix issue 23250 - corrected reginal indicator pairing. 2022-07-15 16:53:51 +03:00
Paul Backus
223b82ac26 Fix 23246 - std.format ignores non-const toString method of associative array value 2022-07-13 15:47:33 -04:00
Paul Backus
e1ba05dab1 Fix 23245 - std.format ignores non-const toString method of static array element 2022-07-13 15:46:29 -04:00
Iain Buclaw
d957f13db3 std.math: Faster floor(double) implementation 2022-07-13 00:16:51 +00:00
Razvan Nitu
494b318c0a
Merge pull request #8502 from GrimMaple/issue_22637
Fix Issue 22637 - std.conv `to!double` and `parse!double` dont throw on under/overflow
2022-07-12 11:44:13 +03:00
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
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
WebFreak001
73589e6f81
fix Issue 23215: segfault in std.file.remove 2022-06-28 13:15:30 +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
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