Skip to content

Commit 354d2ee

Browse files
committed
Merge remote-tracking branch 'upstream/master' into stable
2 parents 3640684 + 146ec3f commit 354d2ee

File tree

11 files changed

+181
-55
lines changed

11 files changed

+181
-55
lines changed

css/style.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1552,11 +1552,13 @@ textarea.d_code_stdin, textarea.d_code_args
15521552
background: white;
15531553
margin-left: 2px;
15541554
outline: none;
1555+
hyphens: none;
15551556
}
15561557

15571558
pre.d_code_output {
15581559
border: none;
15591560
max-height: 30em;
1561+
overflow: auto;
15601562
}
15611563

15621564
div.d_code {margin: 0; padding: 0; background: #F5F5F5;}
@@ -1572,6 +1574,13 @@ div.d_code_output, div.d_code_stdin, div.d_code_args, div.d_code_unittest
15721574

15731575
.d_code_title {font-weight: bold;padding: 5px;}
15741576

1577+
pre.d_code
1578+
{
1579+
overflow-x: auto;
1580+
white-space: pre;
1581+
word-wrap: unset;
1582+
}
1583+
15751584
.CodeMirror-wrap {padding: 3px;}
15761585
.CodeMirror {line-height: normal; border: 1px solid #CCC; background: #FCFCFC; height: auto}
15771586
.cm-s-eclipse .CodeMirror-matchingbracket {border:1px solid grey;color:black !important;}

d-keyring.gpg

5.61 KB
Binary file not shown.

d-keyring.gpg.sig

0 Bytes
Binary file not shown.

foundation/sponsors.dd

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,27 @@ $(P On this page, we recognize some of those who have made monetary donations to
1919
Each $(LINK2 $(ROOT_DIR)foundation/donate.html, donation), big and small, enables us to keep working toward our goals.
2020
)
2121

22+
$(H2 Corporate and Organizational Sponsors)
23+
24+
$(DIVC orgs-using-d center,
25+
$(DORG Symmetry Investments, http://symmetryinvestments.com/about-us/, symmetry.png,
26+
Alternative Investment Management,
27+
Analytics and investment tools.
28+
$(LINK_ROW
29+
$(FA_TALK www.youtube.com/watch?v=xJy6ifCekCE&index=34&list=PL3jwVPmk_PRxo23yyoc0Ip_cP3-rCm7eB, Excel-D) $(FA_SEPARATOR)
30+
$(FA_GITHUB symmetryinvestments)
31+
)
32+
)
33+
$(DORG Weka.IO, http://www.weka.io, weka.png,
34+
Software defined storage,
35+
Complete distributed storage solution (over 200K LoC).
36+
$(LINK_ROW
37+
$(FA_TALK dconf.org/2016/talks/zvibel.html, DConf talk) $(FA_SEPARATOR)
38+
$(FA_HIRING www.weka.io)
39+
)
40+
)
41+
)
42+
2243
$(H2 Backers on OpenCollective)
2344

2445
<script src='https://opencollective.com/dlang/banner.js?style={"a":{"color":"black"}}'></script>
@@ -32,7 +53,7 @@ $(LINK2 mailto:social@dlang.org, social@dlang.org). We're eager to add you to it
3253

3354
$(UL
3455
$(LI Andrei Alexandrescu)
35-
$(LI Symmetry Investments)
56+
$(LI Etienne Cimon)
3657
$(LI John Hall)
3758
$(LI Gerhardus Jansen)
3859
$(LI Radu Racariu)
@@ -62,10 +83,55 @@ $(UL
6283
Macros:
6384
TITLE=D Language Foundation Sponsors
6485
SUBNAV=$(SUBNAV_FOUNDATION)
86+
FA_HIRING=$(FA_ICON rocket) $(HTTP $1, Hiring)
87+
FA_GITHUB=$(FA_ICON github) $(HTTPS github.com/$1, Github)
88+
FA_TALK=$(FA_ICON youtube-play) $(HTTP $1, $2)
89+
FA_SEPARATOR=&nbsp;
90+
FA_TESTIMONIAL=$(FA_ICON heart)
91+
FA_QUOTE=$(FA_ICON quote-left) $0 $(FA_ICON quote-right)
92+
LINK_ROW=$(DIVC orgs-using-d-linkrow, $1)
93+
DORGIMG=<a class="orgs-using-d-img-wrapper vcontainer-box" href="$1"><img class="vcontainer-element" src="$(ROOT_DIR)images/orgs-using-d/$2" /></a>
94+
DORG=$(DIVC orgs-using-d-cell, $(DORGIMG $2, $3) <h3 class="dont-highlight-link">$(LINK2 $2, $1)</h3> $(P $(DIVC orgs-using-d-desc, $4 ) $(DIVC orgs-using-d-uses donthyphenate, $5)))
95+
6596
EXTRA_HEADERS=$(T style,
6697
#opencollective-banner h2 {
6798
color: red;
6899
}
69-
100+
.orgs-using-d-cell {
101+
width: 280px;
102+
display: inline-block;
103+
vertical-align: top;
104+
margin-bottom: 0.5em;
105+
padding-left: 25px;
106+
padding-right: 25px;
107+
padding-bottom: 10px;
108+
}
109+
.orgs-using-d h3 {
110+
margin: 0.4em;
111+
margin-left: 0;
112+
margin-right: 0;
113+
text-align: center;
114+
}
115+
.orgs-using-d-img-wrapper {
116+
width: 280px;
117+
height: 100px;
118+
padding-bottom: 10px;
119+
text-align: center;
120+
}
121+
.orgs-using-d img {
122+
max-width: 280px;
123+
max-height: 100px;
124+
}
125+
.orgs-using-d-desc {
126+
font-style: italic;
127+
margin-left: -1px;
128+
margin-right: -1px;
129+
}
130+
.orgs-using-d-uses {
131+
padding-top: 10px;
132+
}
133+
.orgs-using-d-linkrow {
134+
padding-top: 5px;
135+
}
70136
)
71137
_=

gpg_keys.dd

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,39 @@ $(H2 D Release Team)
55
$(P Since 2.067.0 dmd binaries and git tags are signed by D's release managers. The following GnuPG keys can be used to verify those signatures.)
66

77
$(PRE
8-
pub 4096R/0xAB8FE924C2F7E724 2014-09-01 [expires: 2020-03-25]
9-
Key fingerprint = AFC7 DB45 693D 62BB 472B F27B AB8F E924 C2F7 E724
10-
uid Martin Nowak (dawg) $(LT)me@dawg.eu$(GT)
11-
uid Martin Nowak $(LT)martin.nowak@plugintheworld.com$(GT)
12-
uid Martin Nowak $(LT)code@dawg.eu$(GT)
13-
uid Martin Nowak $(LT)martin@dlang.org$(GT)
14-
sub 4096R/0xB273811612BB1939 2015-02-27 [expires: 2020-03-25]
15-
sub 4096R/0xA78068C444E12E4D 2014-09-01 [expires: 2020-03-25]
16-
17-
pub 2048R/0x5004F0FAD051576D 2016-01-29
18-
Key fingerprint = BBED 1B08 8CED 7F95 8917 FBE8 5004 F0FA D051 576D
19-
uid Vladimir Panteleev $(LT)gpg@thecybershadow.net$(GT)
20-
sub 2048R/0x3850E93043EBB12C 2016-01-29
21-
22-
pub 4096R/0x2055F76601A36FB0 2015-11-24 [expires: 2026-03-23]
23-
Key fingerprint = 8FDB 8D35 7AF4 68A9 428A CE3C 2055 F766 01A3 6FB0
24-
uid Sebastian Wilzbach $(LT)seb@wilzba.ch$(GT)
25-
uid Sebastian Wilzbach $(LT)sebi@wilzbach.me$(GT)
26-
sub 4096R/0xFEB1F8D40328010D 2015-11-24 [expires: 2020-11-22]
27-
28-
pub 4096R/0x65394AFEF4A68565 2018-03-26 [expires: 2020-03-25]
29-
Key fingerprint = F771 5881 4C19 E5E0 7BA1 079A 6539 4AFE F4A6 8565
30-
uid DLang Nightly (bot) $(LT)builder@nightlies.dlang.org$(GT)
31-
sub 4096R/0x318B84C8855CCD65 2018-03-26 [expires: 2020-03-25]
32-
sub 4096R/0xD2EDBA9B3200C132 2018-03-26 [expires: 2020-03-25]
8+
pub rsa4096/0xAB8FE924C2F7E724 2014-09-01 [SC] [expires: 2020-03-25]
9+
AFC7DB45693D62BB472BF27BAB8FE924C2F7E724
10+
uid Martin Nowak (dawg) $(LT)me@dawg.eu$(GT)
11+
uid Martin Nowak $(LT)martin.nowak@plugintheworld.com$(GT)
12+
uid Martin Nowak $(LT)code@dawg.eu$(GT)
13+
uid Martin Nowak $(LT)martin@dlang.org$(GT)
14+
sub rsa4096/0xB273811612BB1939 2015-02-27 [S] [expires: 2020-03-25]
15+
sub rsa4096/0xA78068C444E12E4D 2014-09-01 [E] [expires: 2020-03-25]
16+
17+
pub rsa2048/0x5004F0FAD051576D 2016-01-29 [SC]
18+
BBED1B088CED7F958917FBE85004F0FAD051576D
19+
uid Vladimir Panteleev $(LT)gpg@thecybershadow.net$(GT)
20+
sub rsa2048/0x3850E93043EBB12C 2016-01-29 [E]
21+
22+
pub rsa4096/0x2055F76601A36FB0 2015-11-24 [SC] [expires: 2026-03-23]
23+
8FDB8D357AF468A9428ACE3C2055F76601A36FB0
24+
uid Sebastian Wilzbach $(LT)seb@wilzba.ch$(GT)
25+
uid Sebastian Wilzbach $(LT)sebi@wilzbach.me$(GT)
26+
sub rsa4096/0xFEB1F8D40328010D 2015-11-24 [E] [expires: 2020-11-22]
27+
28+
pub rsa4096/0x65394AFEF4A68565 2018-03-26 [SC] [expires: 2020-03-25]
29+
F77158814C19E5E07BA1079A65394AFEF4A68565
30+
uid DLang Nightly (bot) $(LT)builder@nightlies.dlang.org$(GT)
31+
sub rsa4096/0x318B84C8855CCD65 2018-03-26 [S] [expires: 2020-03-25]
32+
sub rsa4096/0xD2EDBA9B3200C132 2018-03-26 [E] [expires: 2020-03-25]
33+
34+
pub rsa4096/0xBCDD73FFC3EB6146 2020-03-12 [SC] [expires: 2022-03-12]
35+
F46A10D0AB44C3D15DD65797BCDD73FFC3EB6146
36+
uid Martin Nowak $(LT)code@dawg.eu$(GT)
37+
uid Martin Nowak $(LT)martin.nowak@7learnings.com$(GT)
38+
uid Martin Nowak $(LT)martin@dlang.org$(GT)
39+
sub rsa4096/0x9A813AD3C11508BC 2020-03-12 [E] [expires: 2022-03-12]
40+
sub rsa4096/0xDB8C5218B9329CF8 2020-03-12 [S] [expires: 2022-03-12]
3341
)
3442

3543
$(P You can also download them as $(LINK2 d-keyring.gpg,keyring) file.)

images/orgs-using-d/weka.png

8.04 KB
Loading

index.dd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,7 @@ Macros:
769769
padding-left: 1em;
770770
position: relative;
771771
width: 32em;
772+
max-width: 32em;
772773
}
773774

774775
body#Home #content > .intro #your-code-here .tip

orgs-using-d.dd

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,6 @@ $(DIVC orgs-using-d center,
201201
$(FA_GITHUB veelo/Pascal2D)
202202
)
203203
)
204-
$(DORG Sociomantic, https://www.sociomantic.com, sociomantic.png,
205-
Real-time personalized advertising,
206-
Key infrastructure in D - main sponsor of D conference 2016 and 2017.
207-
$(LINK_ROW
208-
$(FA_TALK dconf.org/2016/talks/lucarella.html, DConf talk) $(FA_SEPARATOR)
209-
$(FA_HIRING www.sociomantic.com/jobs/d-software-developer)
210-
)
211-
)
212204
$(DORG Symmetry Investments, http://symmetryinvestments.com/about-us/, symmetry.png,
213205
Alternative Investment Management,
214206
Analytics and investment tools.

spec/betterc.dd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ $(H2 $(LNAME2 retained, Retained Features))
8484
$(LI `switch` with strings)
8585
$(LI `final switch`)
8686
$(LI `unittest`)
87+
$(LI $(DDSUBLINK spec/interfaceToC, calling_printf, `printf` format validation))
8788
)
8889

8990
$(H3 $(LNAME2 unittests, Running unittests in `-betterC`))

spec/interfaceToC.dd

Lines changed: 68 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -208,30 +208,79 @@ extern (C)
208208
---
209209

210210

211-
$(H2 $(LNAME2 calling_printf, Calling printf()))
212-
213-
$(P This mostly means checking that the
214-
$(LINK2 http://www.digitalmars.com/rtl/stdio.html#printf, printf format specifier)
215-
matches the corresponding D data type.
216-
Although printf is designed to handle 0 terminated strings,
217-
not D dynamic arrays of chars, it turns out that since D
218-
dynamic arrays are a length followed by a pointer to the data,
219-
the $(D %.*s) format works:
220-
)
211+
$(H2 $(LNAME2 calling_printf, Calling `printf()`))
221212

222-
------
223-
void foo(char[] string)
213+
$(P `printf` can be directly called from D code:)
214+
---
215+
import core.stdc.stdio;
216+
217+
int main
224218
{
225-
printf("my string is: %.*s\n", string.length, string.ptr);
219+
printf("hello world\n");
220+
return 0;
226221
}
227-
------
222+
---
223+
224+
$(P Printing values works as it does in C:)
225+
---
226+
int apples;
227+
printf("there are %d apples\n", apples);
228+
---
229+
$(P Correctly matching the format specifier to the D type is necessary.
230+
The D compiler recognizes the printf formats and diagnoses mismatches
231+
with the supplied arguments. The specification for the formats
232+
used by D is the C99 specification 7.19.6.1.
233+
)
234+
235+
$(P A generous interpretation of what is a match between the argument
236+
and format specifier is taken, for example, an unsigned type can
237+
be printed with a signed format specifier. Diagnosed incompatibilites
238+
are:
239+
)
240+
241+
$(UL
242+
$(LI incompatible sizes which may cause argument misalignment)
243+
$(LI dereferencing arguments that are not pointers)
244+
$(LI insufficient number of arguments)
245+
$(LI struct, array and slice arguments are not allowed)
246+
$(LI non-pointer arguments to `s` specifier)
247+
$(LI non-Standard formats)
248+
$(LI undefined behavior per C99)
249+
)
250+
251+
$(H3 Strings)
228252

229-
$(P The $(CODE printf) format string literal
230-
in the example doesn't end with $(CODE '\0').
231-
This is because string literals,
232-
when they are not part of an initializer to a larger data structure,
233-
have a $(CODE '\0') character helpfully stored after the end of them.
253+
$(P A string cannot be printed directly. But `%.*s` can be used:
234254
)
255+
---
256+
string s = "betty";
257+
printf("hello %.*s\n", cast(int) s.length, s.ptr);
258+
---
259+
$(P The cast to `int` is required.
260+
)
261+
262+
$(H3 `size_t` and `ptrdiff_t`)
263+
264+
$(P These use the `zd` and `dt` format specifiers respectively:
265+
)
266+
267+
---
268+
int* p, q;
269+
printf("size of an int is %zt, pointer difference is %td\n", int.sizeof, p - q);
270+
---
271+
272+
$(H3 Non-Standard Format Specifiers)
273+
274+
$(P Non-Standard format specifiers will be rejected by the compiler.
275+
Since the checking is only done for formats as string literals,
276+
non-Standard ones can be used:
277+
)
278+
---
279+
const char* format = "value: %K\n";
280+
printf(format, value);
281+
---
282+
283+
$(H3 Modern Formatted Writing)
235284

236285
$(P An improved D function for formatted output is
237286
$(CODE std.stdio.writef()).

0 commit comments

Comments
 (0)