Commit graph

20500 commits

Author SHA1 Message Date
Elias Batek
075f7ed846 Optimize fromHexString() 2024-11-04 03:43:04 +01:00
tynuk
23ea6b019d Add fromHexString, fromHexStringAsRange and isHexString
Squashed commit of the following:

commit af66b61a4ca4195c6b3a9de2a2eaaaa3786972c5
Author: Elias Batek
Date:   Sun Nov 3 09:37:51 2024 +0100

    Further cleanup

commit cb122cd54b14d253b29f99927b9f02cc4017dd05
Author: Elias Batek
Date:   Sun Nov 3 09:31:42 2024 +0100

    Add bloat because of questionable Circle CI failure

commit 1ad9e889bbe58ee9f0b5476f26b48aa7e51488d7
Author: Elias Batek
Date:   Sun Nov 3 09:24:37 2024 +0100

    Add cycle test

commit 913cfc771d694e785cae07157bccdf933fc8b969
Author: Elias Batek
Date:   Sun Nov 3 09:13:47 2024 +0100

    Split long lines

commit 4c062ccc07de668e75300ce3d20420b7dba51f15
Author: Elias Batek
Date:   Sun Nov 3 09:11:38 2024 +0100

    Do not leak implementation details in unittest

commit 66e64deecb2c3f9e4624204038ae0495a5d6f28a
Author: Elias Batek
Date:   Sun Nov 3 09:09:17 2024 +0100

    Improve unittests

commit 1b95777add501bd9ec21fcecf50be5de6fc182fb
Author: Elias Batek
Date:   Sun Nov 3 09:00:16 2024 +0100

    Fix style

commit b1e4c61440a11e4bc7481920a7ccf75065a5b5e9
Author: Elias Batek
Date:   Sun Nov 3 08:56:02 2024 +0100

    Improve unittests

commit c5aed51db374d6c4199f0ce9be1305d1b787248e
Author: Elias Batek
Date:   Sun Nov 3 08:31:57 2024 +0100

    Fix decoder regression

commit 89f4d9bf81bd4709b11e58f4caae782b5a63ff73
Author: Elias Batek
Date:   Sun Nov 3 08:21:52 2024 +0100

    Rename

commit c3a8c5263272770272e77fec30af3d2d833c41da
Author: Elias Batek
Date:   Sun Nov 3 08:11:03 2024 +0100

    Oops

commit aff5b0d8a38c33c94308618cf5aa7819a9427070
Author: Elias Batek
Date:   Sun Nov 3 08:03:32 2024 +0100

    Fix typo and wstring/dstring bug

commit dbe75e9a35b4d963ae7fc54dc69060ce0a59065a
Author: Elias Batek
Date:   Sun Nov 3 08:03:23 2024 +0100

    Improve docs

commit 9ff3ac3e43346e266e4fef51bd9d8e86f80dd48d
Author: Elias Batek
Date:   Sun Nov 3 07:50:35 2024 +0100

    Fix return type typo

commit 4b68416030f3c7782716964c276c9c99d1b08932
Author: Elias Batek
Date:   Sun Nov 3 07:49:48 2024 +0100

    Add validation

commit 3d2224478f4c20f252a409c37d755be05eb6f049
Author: Elias Batek
Date:   Sun Nov 3 07:34:21 2024 +0100

    Remove no longer necessary cast

commit a8ac073a6437dc3c7f079a9a9aa199dd6bd4e57d
Author: Elias Batek
Date:   Sun Nov 3 07:30:41 2024 +0100

    Improve docs

commit 4efb47b9b92ece256485c2d4d34c2a82133a2da3
Author: Elias Batek
Date:   Sun Nov 3 07:27:54 2024 +0100

    Cleanup API

commit d1a3fd0b466480d4f1ddddbd9f4437088a667a4b
Author: Elias Batek
Date:   Sun Nov 3 07:15:42 2024 +0100

    Add constraints

commit 5fb9097c548e5be25dcc45cfdbb7f29010143955
Author: Elias Batek
Date:   Sun Nov 3 07:05:17 2024 +0100

    Improve docs

commit 100aa5f996b088d7962891f3fd60a6e23d6c887b
Author: Elias Batek
Date:   Sun Nov 3 06:46:32 2024 +0100

    Refactor

commit 13551c1de0e54c19ec72bc0294f6956a7c787790
Author: Elias Batek
Date:   Sun Nov 3 06:37:33 2024 +0100

    Fix out-of-bounds bug

commit cca538ffef43894b607847473e56ab3af476660c
Author: Elias Batek
Date:   Sun Nov 3 06:32:52 2024 +0100

    Fix accidental conversion of faulty hex digits

commit c4a367ddbe334928d6c2ec7953ecab6bdbb6080f
Author: Elias Batek
Date:   Sun Nov 3 06:19:19 2024 +0100

    Refactor

commit 538ea2380c54e0eea08dc422766ebc3bad0bbb29
Author: Elias Batek
Date:   Sun Nov 3 06:15:21 2024 +0100

    Add changelog

commit cb1b131743a3b1f377f8740e5721eef1eda70d2d
Author: Elias Batek
Date:   Sun Nov 3 05:17:55 2024 +0100

    Add fromHexString

    Squashed commit of the following:

    commit bc159e9b44c89e68b66dfb3c54bd781229dffa46
    Author: Tynuk <bowsworddv@gmail.com>
    Date:   Sat Jan 27 12:14:52 2024 +0200

        update style

    commit 1fc719532fb83b764c95701973a5fddc98520a15
    Author: Tynuk <bowsworddv@gmail.com>
    Date:   Sat Jan 27 11:52:19 2024 +0200

        create ByteRange

    commit 27ea722f04d9b0120aff2a405935530dd0174950
    Author: Tynuk <43266276+Tynukua@users.noreply.github.com>
    Date:   Thu Aug 25 16:19:45 2022 +0300

        rm spaces

    commit 1fdf63ab4baafc1c4d6d9e957767fe64716365ef
    Author: Tynuk <43266276+Tynukua@users.noreply.github.com>
    Date:   Thu Aug 25 15:55:40 2022 +0300

        Rename

    commit 4b37b8d40d1c251b35e3c14ec64e3b15a388e158
    Author: Tynuk <43266276+Tynukua@users.noreply.github.com>
    Date:   Thu Aug 25 15:26:10 2022 +0300

        Update std/digest/package.d

    commit 712eb2504371c63bee582fb53b5d2bbae9e6f525
    Author: Tynuk <43266276+Tynukua@users.noreply.github.com>
    Date:   Thu Aug 25 15:25:51 2022 +0300

        Update std/digest/package.d

    commit 4826317a5d9d1da7ef8cd4b6df87237d8d254bff
    Author: Tynuk <43266276+Tynukua@users.noreply.github.com>
    Date:   Thu Aug 25 15:25:43 2022 +0300

        Update std/digest/package.d

    commit aedb66bd1ab8bdd1f5acc54f5f63f2c9d2b33b05
    Author: tynuk <bowsworddv@gmail.com>
    Date:   Mon Aug 8 15:15:42 2022 +0300

        add toDigest / hexToBytes

Co-authored-by: Elias Batek <desisma@heidel.beer>
2024-11-03 17:59:26 +08:00
Steven Schveighoffer
2a730adc07
Fix bugzilla 24524: Very slow process fork if RLIMIT_NOFILE is too high (#9077) 2024-10-31 20:45:15 -07:00
The Dlang Bot
4ef836c4f9
Merge pull request #9076 from kinke/cherry_pick_fixes
[stable] Cherry-pick 2 master fixes

Signed-off-by: Jonathan M Davis <jmdavis@users.noreply.github.com>
Merged-on-behalf-of: Martin Kinkelin <kinke@users.noreply.github.com>
2024-10-28 14:22:10 +01:00
Jonathan M Davis
ef6a991534 Fix bugzilla issue 24809: In some cases, stable sort assigns to unininitialized elements (#9057) 2024-10-28 13:46:41 +01:00
Sönke Ludwig
9e78de4d86 Fix Bugzilla 24773: Don't invoke destructors on uninitialized elements in stable sort
Uses a regular initialized temporary array when sorting elements with an elaborate assignment to avoid undefined behavior when destructors, postblits or copy constructors are invoked during the array assignment.
2024-10-28 13:46:26 +01:00
Vladiwostok
354781f229
Fix UndocumentedDeclarationCheck linting issue in typecons.d (#9075) 2024-10-27 16:37:36 -07:00
Per Nordlöw
5e311c304c
Add AllocatorState (#8596) 2024-10-27 19:52:29 +08:00
Nicholas Wilson
dc4c187b2b
Fix style (#9074) 2024-10-27 19:11:52 +08:00
Nicholas Wilson
81ce86ef67
remove uses of classinfo, rebases part of #7445 (#9063) 2024-10-27 17:27:20 +08:00
Luís Ferreira
08858e03aa
std/path: make globMatch work with @nogc (#9055) 2024-10-27 17:24:46 +08:00
Jonathan M Davis
b6245b474d
Simplify endian conversion functions in std.bitmanip. (#8822)
* Simplify endian conversion functions in std.bitmanip.

They're overly complex (e.g. testing for the native endianness of the
machine when that's actually completely unnecessary), and they use
unions in a manner that is undefined behavior in C/C++ (since they write
to one field and then read from another). I don't see any mention of
whether that behavior is defined in D in D's spec, but it's probably
undefined in D given that it's undefined in C/C++. Either way, it's an
overly complex solution.

This solution gets rid of all of the endian version checks in
std.bitmanip, and it allows the implementations of the endian conversion
functions to be the same between CTFE and runtime.

* Add additional tests for nativeToLittleEndian.
2024-10-27 02:18:49 -07:00
Nicholas Wilson
b7743abfcf
Fix bugzilla issue 24637 (#9073) 2024-10-27 17:18:41 +08:00
Vladiwostok
231ae8b68a
Fix D-Scanner linting issues (#9070)
* Fix UndocumentedDeclarationCheck linting issue

* Fix IfConstraintsIndentCheck linting issue

* Address feedback

* Fix publictests CI

* Fix old (libdparse) D-Scanner linting warn
2024-10-27 01:21:56 -07:00
Jonathan M Davis
f0c3e4a66b
Fix Bugzilla issue 24827: maxElement does not handle opAssign correctly. (#9067)
Rebindable2 did not handle types with opAssign correctly, which affected
both minElement and maxElement. Namely, Rebindable2 assigned to memory
which was not properly initialized when the correct solution in such a
situation is to use copyEmplace. Assignment works when assignment is
just a memcpy, but in the general case, opAssign needs to have a
properly initialized object in order to work correctly. copyEmplace
instead copies the object and then places the copy into the unitialized
memory, so it avoids assigning to uninitialized memory.

This commit also adds additional tests for types with destructors (which
do get opAssign automatically) and types with postblit constructors or
copy constructors to try to ensure that the code is doing the correct
thing in those cases with regards to copying, assignment, and
destruction.

https://issues.dlang.org/show_bug.cgi?id=24829 was found in the process,
and this does not fix that. Namely, types which cannot be assigned to
and which also have a postblit constructor or copy constructor do not
get copied correctly. So, among the tests added here are commented out
tests for that case, since they're an altered version of some of the
enabled tests. However, fixing that issue would be involved enough that
I'm not attempting to fix it at this time.
2024-10-27 01:16:22 -07:00
Luís Ferreira
fec5e7e4b9
chore(allocator): make AlignedMallocator pure (#8576)
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
Co-authored-by: Nicholas Wilson <thewilsonator@users.noreply.github.com>
2024-10-27 01:10:33 -07:00
wolframw
54cfc22c73
overhaul documentation of std.string indexOf-like functions (#8560) 2024-10-27 14:32:06 +08:00
Adam Wilson
2852e84aa9
Remove Phobos 3 dub.sdl and replace it with the build_v3.d build script. (#9069)
* Remove Phobos 3 dub.sdl and replace it with the build_v3.d buid script.

* Add environment bang to the build script.

* Fix the Phobos v3 build script so that unit tests work on POSIX.

---------

Co-authored-by: Jonathan M Davis <jmdavis@jmdavisprog.com>
2024-10-25 17:49:41 -07:00
Adam Wilson
03c4998e85
Add Phobos 3 Documentation (#9068)
* Add documentation from the Phobos 3 Design repo. Add section on Template Reduction by request of Walter. Split up documents for clarity.

* Add README.md. Update documents using documents from the V3 Design Repo.

* Move numeric to the math package.
2024-10-25 01:42:49 -07:00
Dennis
1417cc5f5b
Merge pull request #9066 from Cyrodwd/system-new-oses
Added 'Haiku' and 'Solaris' to 'system'.
2024-10-23 12:32:22 +02:00
Dennis
d447702b5e
Merge pull request #9064 from CyberShadow/json-order
Fix Issue 24823 - std.json: Allow optionally preserving the order of fields in JSON objects
2024-10-23 12:26:10 +02:00
Steven Schveighoffer
10076badd8
Fix Bugzilla Issue 24824 - ensure we exit a child that does not succeed in exec. (#9065) 2024-10-22 15:10:24 +08:00
Cyrodwd
00d56d07a7 Added Haiku and Solaris on OS enum and version 2024-10-21 20:41:19 -07:00
Cyrodwd
76a70abd2c Added Haiku and Solaris on OS enum and version 2024-10-21 20:29:06 -07:00
Vladimir Panteleev
800dd75234
Move ordered object indication into a new bool
Avoid breaking code that do "final switch" oven JSONType.
2024-10-21 22:31:58 +00:00
Vladimir Panteleev
dfb9db4004
Fix Bugzilla 24823 - std.json: Allow optionally preserving the order of fields in JSON objects 2024-10-21 11:41:24 +00:00
Nicholas Wilson
44296a1a9b
remove classinfo uses, rebases part of #7445 (#9061) 2024-10-21 10:05:32 +03:00
Nicholas Wilson
fb602efdc4
remove uses of classinfo, rebases part of #7445 (#9062) 2024-10-21 09:50:11 +03:00
Nicholas Wilson
ab46287e18
fix long line linter error (#9060)
* fix long line linter error

* Update package.d
2024-10-21 09:44:57 +03:00
Feldwor
30a054b31d
Add .byLine Windows Example: Update stdio.d (#8860) 2024-10-21 12:31:11 +08:00
Walter Bright
a51c0eada6
co-locate overloads of std.algorithm.mutation.swap() (#8951) 2024-10-18 13:18:04 +08:00
Quirin F. Schroll
1ea91e6674
Fix lockstep error message (#9029) 2024-10-18 13:15:34 +08:00
Jonathan M Davis
913ef46bca
Fix bugzilla issue 24809: In some cases, stable sort assigns to unininitialized elements (#9057) 2024-10-17 20:00:02 -07:00
Georgy Markov
706d97171c
Fix issue 24801 - RefRange doesn’t work if range primitives are not const (#9056)
* Fix Bugzilla issue 24801 - `RefRange` doesn’t work if range primitives are not `const`

* Remove trailing whitespaces
2024-10-17 19:59:31 -07:00
Dennis
bf96b99fc2
Update to unicode 16.0.0 (#9058) 2024-10-16 06:24:56 +08:00
Ate Eskola
bdedad3bf8
Added a new popGrapheme function to std.uni (#9053)
* Added a new popGrapheme function to std.uni

* A changelog clarification and fix of inaccurate static condition

* Committing to restart the tests, and adding the new function to the
module doc index while there.
2024-10-12 16:24:24 -07:00
Dennis
eab6595ade
Merge pull request #9048 from the-horo/closefrom-spawn-process
std/process: Default to libc closefrom in spawnProcessPosix
2024-10-03 09:50:27 +02:00
Nick Treleaven
61bd59c669
[std.format] Add anchors for section headings (#9054) 2024-10-02 16:54:07 +03:00
Adam Wilson
59b371567b Remove -de switch from Phobos builds to allow deprecations. 2024-09-20 15:06:49 +02:00
Sönke Ludwig
2168becf74 Fix Bugzilla 24773: Don't invoke destructors on uninitialized elements in stable sort
Uses a regular initialized temporary array when sorting elements with an elaborate assignment to avoid undefined behavior when destructors, postblits or copy constructors are invoked during the array assignment.
2024-09-20 13:38:31 +02:00
Ate Eskola
b3a9736480 graphemeStride now @nogc with DChars 2024-09-20 12:23:11 +02:00
Andrei Horodniceanu
48d581a1f5
Fix Bugzilla 24715 - std/process: Default to libc closefrom in spawnProcessPosix
The current implementation of spawnProcessPosix is broken on systems
with a large `ulimit -n` because it always OOMs making it impossible
to spawn processes. Using the libc implementation, when available, for
doing file descriptor operations en-mass partially solves this problem.

Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
2024-08-26 14:59:53 +03:00
RubyTheRoobster
cd026126db
Issue 24095 - std.bitmanip.bitfields no longer works with bool enum t… (#9043)
* Fix Bugzilla Issue 24095 - std.bitmanip.bitfields no longer works with bool enum types

* Fix trailing whitespace

* Remove extra space
2024-08-19 15:05:36 +03:00
Jonathan M Davis
f7e523bc3c Fix Bugzilla issue 24704: Improve error messages for from*String in std.datetime.
The documentation for the from*String functions specifies what they
accept, and the fromISO*String functions accept ISO or ISO extended
strings, but it is technically the case that there are ISO and ISO
extended strings which they do not accept (since the standard specifies
what the fields should look like for each string but doesn't specify
that all fields must be present or that any code parsing them must
accept all variants).

So, technically, the error messages which have said that the given
strings are not valid ISO or ISO extended strings are not necessarily
correct. So, this changes the error messages to remove that ambiguity.
2024-08-17 00:35:51 +02:00
Dennis Korpel
bbb156629e std.uni: Make auto ref adjacent 2024-08-14 17:10:41 +02:00
Nick Treleaven
f11b19d411 Fix Bugzilla 24698 - Appender needs to expose readonly property 'size_t length' without using 'data' property
Add `length` property rather than `app[].length`.

Also remove `@trusted` attribute from `@safe` function.
2024-08-09 00:32:24 +02:00
0-v-0
59200013b3
Remove std.conv import from skipData (#9040) 2024-08-07 17:21:24 +03:00
Paul Backus
61923d9aca
Merge pull request #9031 from ljmf00/fix-24686
Fix issue 24686: SumType stopped working with unmatched DeducedParame…
2024-08-03 07:17:37 -04:00
Luis Ferreira
9c11552ac2
Fix issue 24686: SumType stopped working with unmatched DeducedParameterType template 2024-08-03 11:53:46 +02:00
Paul Backus
ebd24da8ad
Fix Bugzilla 22293: opCast!bool for Nullable (#9039)
The second opCast overload is necessary to allow built-in implicit
conversions (e.g., mutable to const) to be performed explicitly via a
cast expression. Nullable.opEquals depends on this behavior.
2024-08-01 17:09:38 +08:00