Commit graph

15870 commits

Author SHA1 Message Date
Luís Ferreira
a56287dd8b chore(math/exponential): avoid import constants if not InlineAsm_X87
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2022-05-09 18:44:14 +00:00
Luís Ferreira
19c6e8d251 chore(math/hardware): align spaces by 4 instead of by 3
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2022-05-09 18:42:23 +00:00
Vladimir Panteleev
3121a99e19 std.socket: Always compile slow unit tests 2022-05-08 08:25:36 +00:00
Steven Schveighoffer
f712d16b0a
Add scope decorations to std.socket (#8438) 2022-05-07 20:28:19 +08:00
Carsten Schlote
ad93dd0305 Fixed linter issue on style 2022-04-29 17:26:56 +02:00
Carsten Schlote
f434dc3cae Add custom fill value to std.outbuffer.OutBuffer class
Extend the fill, alignSize, align{2,4} methods of `std.outbuffer.OutBuffer` to specify value to write
when filling (up to an alignment).

For flash device images it is desirable to use 0xff as the fill value,
because 0xff is the value of the unprogrammed flash memory cell. Padding
with 0 requires to programm the flash cell from 0xff to 0x00, which
increases wear and tear on the flash memory device. Usually there is some
larger block at the end if the flash memory image, which must be padded
up to the size of the flash device (usuallay a power of two). Instead
of padding with 0x00 the PR allows to fill with 0xff instead.

There might also be other use-cases, where it might be reasonable to fill
the alignment gaps with some other value than 0x00, e.g. when debugging
and viewing output data in a hex editor. It is easier to spot gaps, when
the padded spaces contain a custom value like 0x55 or 0xaa.

A new fill method was added, which allows filling with a user-defined value
instead of the 0 as in the previous implementation.
2022-04-29 12:57:10 +02:00
chloekek
707eb37656 Issue 22986: Mark ErrnoException.errno as scope
This allows retrieval of the error number when compiling with -dip1008.
2022-04-27 18:55:50 +00:00
Hiroki Noda
5429908c4a Fix: add missing FunctionAttribute 2022-04-25 15:22:59 +00:00
RazvanN7
d2c3da6d50 Fix Issue 20182 - [REG 2.086.0] std.traits.ParameterDefaults fails for copy constructor of nested struct 2022-04-18 22:26:49 +00:00
Razvan Nitu
dc6fcbd8ef
Merge pull request #8426 from WalterBright/int128
add std.int128 a 128 bit integer arithmetic type
2022-04-18 09:18:31 +03:00
Dennis
0745f76249
Merge pull request #8431 from dkorpel/fix-std-path-variadic-test
Fix std.path unittest returning dangling pointer
2022-04-17 09:02:56 +02:00
Dennis Korpel
ef3dc5f5bb Fix std.path unittest returning dangling pointer 2022-04-16 15:59:43 +02:00
Walter Bright
60f5bfa45a add std.int128 2022-04-14 11:01:44 -07:00
Dennis Korpel
f56b33961e Fix issue 22213 - Base64: Missing @nogc attribute on encodeLength 2022-04-13 16:06:38 +02:00
Dennis Korpel
c0cc5e917d Fix switch fallthrough 2022-04-11 11:26:11 +00:00
The Dlang Bot
99e9c1b774
Merge pull request #8425 from MartinNowak/merge_stable
merge stable

Signed-off-by: Dennis <dkorpel@users.noreply.github.com>
Merged-on-behalf-of: Iain Buclaw <ibuclaw@users.noreply.github.com>
2022-04-01 11:37:35 +00:00
Martin Nowak
0e3efabacc Merge remote-tracking branch 'upstream/stable' into merge_stable 2022-04-01 10:23:49 +02:00
Razvan Nitu
ee6f7d018b
Merge pull request #8422 from MoonlightSentinel/throw-windows-exception
Fix 22947 - Use wenforce in sysErrorString
2022-03-31 11:24:51 +03:00
Dennis Korpel
ba92563a0d Fix issue 22939 - bad error message: Error: no property msg for type string 2022-03-29 18:51:30 +00:00
Dennis Korpel
6ceeb18c82 Improve std.conv.parse support for scope strings 2022-03-28 08:18:27 +00:00
MoonlightSentinel
362e81830c
Fix 13541 - Replace usages of sysErrorString` with a helper function
`sysErrorString` throws an exception for unknown error codes (e.g. from
libraries using `SetLastError`) and hence could hide the actual error
that caused the call to `sysErrorString`.

The new helper function wraps the error code lookup and returns `Error X`
on failure.
2022-03-28 01:01:25 +02:00
MoonlightSentinel
304160f5af
Issue 13541 - Use wenforce instead of enforce + sysErrorString
This ensures that the actual error message won't be suppressed when the
lookup error code => message fails. The exception will also be more
informative because `WindowsException` is explicitly intended for
Windows API errors.
2022-03-28 01:01:19 +02:00
MoonlightSentinel
5c60f05dc9
Fix 22947 - Use wenforce in sysErrorString
This ensures that the method throws a `WindowsException` initialised
with the proper error code. Also avoids unrelated exceptions that
could suppress the error which caused the call to `sysErrorString`.
2022-03-28 00:25:18 +02:00
MoonlightSentinel
167b1af778 Fix 22946 - Mark WindowsException ctor as nothrow
Catch possible exceptions arising from e.g. UTF decoding and ensure
that the message buffer doesn't contain partial output from a failed
step.

The logic is seperated into a dedicated method because it's required
for another bugfix.
2022-03-27 22:15:07 +00:00
Cameron Ross
90f65d49fb Add range interface to Nullable 2022-03-27 19:18:11 +00:00
Dennis
6e5c873c5a
Merge pull request #8418 from dkorpel/pure-scope-throw1
Make `toLower` and `toUpper` `return scope`
2022-03-27 19:40:49 +02:00
Paul Backus
c6b4bd9638 [Refactor] Move toCtString to std.conv
Previously, it was duplicated in std.functional and std.sumtype.
2022-03-26 14:04:37 +00:00
dkorpel
2ac53fa164 Make toLower and toUpper return scope 2022-03-25 20:08:06 +01:00
Dennis Korpel
5636c8cdcc Fix incorrect return scope annotations 2022-03-22 18:08:31 +00:00
Iain Buclaw
2b5ab004b2 Add preliminary support for GNU/Hurd 2022-03-22 14:11:33 +00:00
Paul Backus
fc8f333ca3
Fix issue 22873 - Wrong std.format output for inout (#8409)
Fix issue 22873 - Wrong std.format output for `inout`

Signed-off-by: Steven Schveighoffer <schveiguy@users.noreply.github.com>
Signed-off-by: Razvan Nitu <RazvanN7@users.noreply.github.com>
Merged-on-behalf-of: Razvan Nitu <RazvanN7@users.noreply.github.com>
2022-03-22 13:32:02 +00:00
Arne Ludwig
3a2cf7f3cb Fixed negation of BitFlags
- negation did not work with unsigned integers with dmd v2.099.0
- also made double negation of flags possible
2022-03-22 12:47:36 +00:00
Paul Backus
d9d104c9bc Fix issue 22901 - Can't construct inout SumType
The template constraint is needed to ensure that the inout constructor
overload is only considered when it is an exact match, without qualifier
conversions.

Without the constraint, a constructor call such as

    const(SumType!(int[]))([1, 2, 3])

...would be ambiguous, since it would match both the const constructor
overload and the inout constructor overload at the "match with qualifier
conversion" level.
2022-03-20 14:57:40 -04:00
Paul Backus
8a368bde34 Add std.traits.DeducedParameterType 2022-03-20 14:57:25 -04:00
Dennis Korpel
7ee15aa567 Fix typo 'preforming' 2022-03-17 14:28:21 +01:00
Atila Neves
22959ab86c
Increase @safety of std.conv (#8410)
Increase @safety of std.conv

Signed-off-by: Dennis <dkorpel@users.noreply.github.com>
Merged-on-behalf-of: Dennis <dkorpel@users.noreply.github.com>
2022-03-14 16:33:45 +00:00
Razvan Nitu
16cb085b58
Merge pull request #8376 from pbackus/fix-22736
Add std.functional.bind
2022-03-10 16:39:15 +02:00
aG0aep6G
3a97e4a9e9 fix issue 22867 - std.utf.decode changes offset despite error. 2022-03-10 13:08:21 +01:00
Steven Schveighoffer
526beb3d84 Change default log level to info instead of warning. 2022-03-09 11:51:56 -05:00
Dennis Korpel
3d8b95791f Fix return scope in cartesianProduct Result.save 2022-03-09 15:37:09 +00:00
Martin Nowak
9d005f0e3b Merge remote-tracking branch 'upstream/stable' into merge_stable 2022-03-08 16:05:58 +01:00
Paul Backus
9d1aeeca2b Add std.functional.bind
Fixes Issue 22736 - Add destructuring bind for std.typecons.Tuple tuples
2022-03-07 15:40:27 -05:00
canopyofstars
668d43c5df Fix 22851 - Add source reference to std.sumtype
Add `Source: $(PHOBOSSRC std/sumtype.d)` to `std.sumtype's` module documentation.
2022-03-06 03:34:35 +00:00
Razvan Nitu
f4138b6740
Merge pull request #8399 from dkorpel/systime-opbinary-retscope
Annotate `SysTime.opBinary` as `returnScope`
2022-03-04 11:21:56 +02:00
Johan Engelen
ba473aebe8 Disable large allocation test that is not supported by AddressSanitizer
AddressSanitizer will report an error (rather than returning `null`) for such large allocations.
2022-03-03 02:02:31 +00:00
Johan Engelen
292c38c432
Fix 22838 - BitArray.count reads beyond data
This fixes issue 22838
https://issues.dlang.org/show_bug.cgi?id=22838

All hail AddressSanitizer! ;-)
2022-03-03 01:00:41 +01:00
Dennis Korpel
fc3cdd9723 Annotate SysTime.opBinary as returnScope 2022-03-02 19:00:44 +01:00
Dennis Korpel
e828cfc62b Annotate SysTime.endOfMonth as return scope 2022-03-02 17:32:58 +00:00
Paul Backus
a1f8c4c070 Revert "sumtype: work around issue 21975 in isSumType"
This reverts commit 2de68340ae.
2022-03-01 15:09:30 +00:00
The Dlang Bot
d7b0cf72b4
Merge pull request #8396 from MartinNowak/merge_stable
merge stable

Signed-off-by: Nicholas Wilson <thewilsonator@users.noreply.github.com>
Merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2022-03-01 10:57:45 +00:00