Skip to content

Commit b4ae9ed

Browse files
committed
Merge remote-tracking branch 'upstream/master' into stable
2 parents f267a89 + 467f934 commit b4ae9ed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2555
-1058
lines changed

.circleci/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ setup_repos()
8787
git merge -m "Automatic merge" $current_branch
8888
fi
8989
90-
for proj in dmd druntime phobos ; do
90+
for proj in dmd phobos ; do
9191
if [ $base_branch != master ] && [ $base_branch != stable ] &&
9292
! git ls-remote --exit-code --heads https://github.com/dlang/$proj.git $base_branch > /dev/null; then
9393
# use master as fallback for other repos to test feature branches

articles/const-faq.dd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ $(ITEM cpp-const, How does const differ in C++?)
211211

212212
$(ITEM invariant-strings, Why are strings immutable?)
213213

214-
$(P $(LINK2 http://drdobbs.com/blogs/architecture-and-design/228700475, Immutable Strings)
214+
$(P $(LINK2 https://www.digitalmars.com/articles/b01.html, Immutable Strings)
215215
)
216216

217217
$(ITEM const-parameters, Why aren't function parameters const by default?)

articles/d-array-article.dd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ arr[0] = 4; /* sets the first element of the array 'arr' to 4 */
2828
x = arr[1]; /* retrieves the second element of the array 'arr' into x */
2929
------
3030

31-
$(P Everything else (length, appending, allocation, destruction) is left up to library functions and assumption/documentation. So what is so wrong with this concept? One of the largest problems with C arrays is the ability to access any data via the pointer, even data that doesn't belong to the array. You can even use negative indexes! Not to mention that the array uses the exact same type as a pointer to a single item. When you get a pointer as a parameter to a function, that could be an array, or it could be just a pointer to a single item. Cue buffer overflow attacks. You can read more about this in Walter Bright's article, $(LINK2 http://drdobbs.com/blogs/cpp/228701625, "C's biggest mistake")
31+
$(P Everything else (length, appending, allocation, destruction) is left up to library functions and assumption/documentation. So what is so wrong with this concept? One of the largest problems with C arrays is the ability to access any data via the pointer, even data that doesn't belong to the array. You can even use negative indexes! Not to mention that the array uses the exact same type as a pointer to a single item. When you get a pointer as a parameter to a function, that could be an array, or it could be just a pointer to a single item. Cue buffer overflow attacks. You can read more about this in Walter Bright's article, $(LINK2 https://digitalmars.com/articles/C-biggest-mistake.html, "C's biggest mistake")
3232
)
3333

3434
$(H2 $(LNAME2 introducing-slices, Introducing Slices))

articles/d-floating-point.dd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ $(P Why does NaN exist? It serves a valuable role: it $(I eradicates undefined b
6666

6767
$(P Subnormals are necessary to prevent certain anomalies, and preserve important relationships such as: "x - y == 0 if and only if x == y".)
6868

69-
$(P Since $(INFIN) can be produced by overflow, both +$(INFIN) and -$(INFIN) are required. Both +0 and -0 are required in order to preserve identities such as: if $(D x>0), then $(D 1/(1/x) > 0). In almost all other cases, however, there is no difference between +0 and -0.)
69+
$(P Since $(INFIN) can be produced by overflow, both +$(INFIN) and -$(INFIN) are required. Both +0 and -0 are required in order to ensure $(D x) and $(D 1/(1/x)) always have the same sign bit. In almost all other cases, however, there is no difference between +0 and -0.)
7070

7171
$(P It's worth noting that these $(SINGLEQUOTE special values) are usually not very efficient. On x86 machines, for example, a multiplication involving a NaN, an infinity, or a subnormal can be twenty to fifty times slower than an operation on normal numbers. If your numerical code is unexpectedly slow, it's possible that you are inadvertently creating many of these special values. Enabling floating-point exception trapping, described later, is a quick way to confirm this.)
7272

book/build.d

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,18 @@ void compileToPath(string compileThis, string outputPath, string extraFiles, boo
1616
if(outputPath.indexOf("cozum") == -1)
1717
{
1818
//We need to build a little .ddoc file to set the right predefined build macros - these are context dependant.
19-
19+
2020
const cozumHtml = outputPath.baseName.replace(".html", ".cozum.html");
2121
contextMacros["COZUM_HTML"] = cozumHtml;
2222
//exit(0);
2323
}
2424
auto macroOut = File("contextMacros.ddoc", "w");
25-
25+
scope(exit)
26+
{
27+
import std.file : remove; // conflicts with `core.stdc.stdio.remove` otherwise
28+
remove("contextMacros.ddoc");
29+
}
30+
2631
foreach(key, value; contextMacros)
2732
{
2833
macroOut.writefln!"%s = %s"(key, value);
@@ -33,10 +38,10 @@ void compileToPath(string compileThis, string outputPath, string extraFiles, boo
3338
if(loud)
3439
writefln!"%s:%s |> %s"(compileThis, outputPath, compileString);
3540
const res = executeShell(compileString);
36-
41+
3742
if(res.status != 0) {
3843
write(res.output);
39-
44+
4045
exit(0);
4146
}
4247
}

book/contextMacros.ddoc

Lines changed: 0 additions & 1 deletion
This file was deleted.

book/d.en/memory.d

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ Alignment is needed for CPU performance or requirements, because accessing misal
509509
$(H6 $(IX .alignof) The $(C .alignof) property)
510510

511511
$(P
512-
$(IX classInstanceAlignment) The $(C .alignof) property of a type is its default alignment value. For classes, $(C .alignof) is the alignment of the class variable, not the class object. The alignment of a class object is obtained by $(C std.traits.classInstanceAlignment).
512+
$(IX classInstanceAlignment) The $(C .alignof) property of a type is its default alignment value. For classes, $(C .alignof) is the alignment of the class variable, not the class object. The alignment of a class object is obtained by $(C __traits(classInstanceAlignment)).
513513
)
514514

515515
$(P
@@ -549,7 +549,7 @@ void main() {
549549
foreach (Type; Types) {
550550
static if (is (Type == class)) {
551551
size_t size = __traits(classInstanceSize, Type);
552-
size_t alignment = $(HILITE classInstanceAlignment!Type);
552+
size_t alignment = $(HILITE __traits(classInstanceAlignment, Type));
553553

554554
} else {
555555
size_t size = Type.sizeof;
@@ -636,8 +636,7 @@ $(CODE_NAME nextAlignedAddress)T * nextAlignedAddress(T)(T * candidateAddr) {
636636
import std.traits;
637637

638638
static if (is (T == class)) {
639-
const alignment = classInstanceAlignment!T;
640-
639+
const alignment = __traits(classInstanceAlignment, T);
641640
} else {
642641
const alignment = T.alignof;
643642
}
@@ -1314,7 +1313,7 @@ $(LI $(C GC.calloc) and other functions reserve memory, $(C GC.realloc) extends
13141313
13151314
$(LI It is possible to mark the allocated memory by attributes like $(C GC.BlkAttr.NO_SCAN), $(C GC.BlkAttr.NO_INTERIOR), etc.)
13161315
1317-
$(LI The $(C .alignof) property is the default memory alignment of a type. Alignment must be obtained by $(C classInstanceAlignment) for class $(I objects).)
1316+
$(LI The $(C .alignof) property is the default memory alignment of a type. Alignment must be obtained by $(C __traits(classInstanceAlignment)) for class $(I objects).)
13181317
13191318
$(LI The $(C .offsetof) property is the number of bytes a member is from the beginning of the object that it is a part of.)
13201319

changelog/2.100.0.dd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ use exceptions, including `@nogc` and BetterC code.
355355

356356
$(P
357357
For more information, see
358-
$(LINK https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1038.md, DIP 1038).
358+
$(LINK2 https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1038.md, DIP 1038).
359359
)
360360
)
361361

changelog/release-schedule.dd

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,25 @@ Ddoc
33
$(D_S $(TITLE),
44

55
$(UL
6-
$(LI New release are published every $(I two) months, on the first day of every uneven month.)
6+
$(LI New release are published every $(I two) months, on the first day of every even month.)
77
$(LI Two weeks before a new release `master` is merged into `stable` and a first beta is released.)
88
$(LI Point releases are published unscheduled when important issues or regressions get fixed.)
99
)
1010

11-
$(P The release schedule for 2021 is as follows:)
11+
$(P The release schedule for 2022 is as follows:)
1212

1313
$(DIVC release-schedule,
1414
$(TABLE
15-
$(BETA_RELEASE 2020-12-15, 2.095.0)
16-
$(MINOR_RELEASE 2021-01-01, 2.095.0)
17-
$(BETA_RELEASE 2021-02-15, 2.096.0)
18-
$(MINOR_RELEASE 2021-03-01, 2.096.0)
19-
$(BETA_RELEASE 2021-04-15, 2.097.0)
20-
$(MINOR_RELEASE 2021-05-01, 2.097.0)
21-
$(BETA_RELEASE 2021-06-15, 2.098.0)
22-
$(MINOR_RELEASE 2021-07-01, 2.098.0)
23-
$(BETA_RELEASE 2021-08-15, 2.099.0)
24-
$(MINOR_RELEASE 2021-09-01, 2.099.0)
25-
$(BETA_RELEASE 2021-10-15, 2.100.0)
26-
$(MINOR_RELEASE 2021-11-01, 2.100.0)
27-
$(BETA_RELEASE 2021-12-15, 2.101.0)
28-
$(MINOR_RELEASE 2022-01-01, 2.101.0)
15+
$(BETA_RELEASE 2022-02-15, 2.099.0)
16+
$(BETA_RELEASE 2022-03-01, 2.099.0)
17+
$(BETA_RELEASE 2022-04-15, 2.100.0)
18+
$(MINOR_RELEASE 2022-05-01, 2.100.0)
19+
$(BETA_RELEASE 2022-07-15, 2.101.0)
20+
$(MINOR_RELEASE 2022-08-01, 2.101.0)
21+
$(BETA_RELEASE 2022-09-15, 2.102.0)
22+
$(MINOR_RELEASE 2022-10-01, 2.102.0)
23+
$(BETA_RELEASE 2022-11-15, 2.103.0)
24+
$(MINOR_RELEASE 2022-12-01, 2.103.0)
2925
)
3026
)
3127
)

dcompiler.dd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ performs these steps automatically.
7777

7878
$(CONSOLE
7979
C:\Documents and Settings\Your Name>cd \
80-
C:\>unzip dmd.zip
81-
C:\>unzip dmc.zip
80+
C:\\>unzip dmd.zip
81+
C:\\>unzip dmc.zip
8282
)
8383
)
8484
$(LINUX

0 commit comments

Comments
 (0)