File tree 5 files changed +135
-9
lines changed 5 files changed +135
-9
lines changed Original file line number Diff line number Diff line change
1
+ * .d.htm
2
+ * .exe
3
+ chello
4
+ dclient
5
+ dserver
6
+ d2html
7
+ dhry
8
+ hello
9
+ htmlget
10
+ listener
11
+ pi
12
+ sieve
13
+ wc
14
+ wc2
15
+ winsamp
16
+
Original file line number Diff line number Diff line change
1
+ # #
2
+ # Example Makefile for the D programming language
3
+ # #
4
+ TARGETS = \
5
+ d2html \
6
+ dhry \
7
+ hello \
8
+ htmlget \
9
+ listener \
10
+ pi \
11
+ sieve \
12
+ wc \
13
+ wc2
14
+
15
+ # # Those examples are Windows specific:
16
+ # chello
17
+ # dserver
18
+ # dclient
19
+ # winsamp
20
+
21
+ SRC = \
22
+ chello.d \
23
+ d2html.d \
24
+ dclient.d \
25
+ dhry.d \
26
+ dserver.d \
27
+ hello.d \
28
+ htmlget.d \
29
+ listener.d \
30
+ pi.d \
31
+ sieve.d \
32
+ wc.d \
33
+ wc2.d \
34
+ winsamp.d
35
+ DFLAGS =
36
+ LFLAGS =
37
+
38
+
39
+ # #
40
+ # # Those values are immutables
41
+ # # For languages such as C and C++, builtin rules are provided.
42
+ # # But for D, you had to had to do everything by hand.
43
+ # # Basically, if you had some Makefile knowledge, this is all you need.
44
+ # #
45
+ # # For explanation / more advanced use, see:
46
+ # # http://www.gnu.org/software/make/manual/html_node/Suffix-Rules.html
47
+ .SUFFIXES : .d
48
+ .d.o :
49
+ $(DMD ) $(DFLAGS ) -c $< -of$@
50
+ # #
51
+
52
+ LINK = dmd
53
+ DMD = dmd
54
+ RM = rm -rf
55
+ OBJS = $(SRC:.d=.o )
56
+
57
+ all : $(TARGETS )
58
+
59
+ clean :
60
+ $(RM ) $(OBJS )
61
+
62
+ fclean : clean
63
+ $(RM ) $(TARGETS )
64
+ $(RM ) * .d.htm
65
+
66
+ re : fclean all
67
+
68
+ chello : $(OBJS )
69
+ $(LINK ) $(LFLAGS ) $(OBJS ) -of$@
70
+
71
+ .PHONY : all clean fclean re
72
+ .NOTPARALLEL : clean
73
+
74
+ d2html : d2html.o
75
+ $(LINK ) $(LFLAGS ) $< -of$@
76
+
77
+ dclient : dclient.o
78
+ $(LINK ) $(LFLAGS ) $< -of$@
79
+
80
+ dhry : dhry.o
81
+ $(LINK ) $(LFLAGS ) $< -of$@
82
+
83
+ dserver : dserver.o
84
+ $(LINK ) $(LFLAGS ) $< -of$@
85
+
86
+ hello : hello.o
87
+ $(LINK ) $(LFLAGS ) $< -of$@
88
+
89
+ htmlget : htmlget.o
90
+ $(LINK ) $(LFLAGS ) $< -of$@
91
+
92
+ listener : listener.o
93
+ $(LINK ) $(LFLAGS ) $< -of$@
94
+
95
+ pi : pi.o
96
+ $(LINK ) $(LFLAGS ) $< -of$@
97
+
98
+ sieve : sieve.o
99
+ $(LINK ) $(LFLAGS ) $< -of$@
100
+
101
+ wc2 : wc2.o
102
+ $(LINK ) $(LFLAGS ) $< -of$@
103
+
104
+ wc : wc.o
105
+ $(LINK ) $(LFLAGS ) $< -of$@
106
+
107
+ winsamp : winsamp.o
108
+ $(LINK ) $(LFLAGS ) $< -of$@
Original file line number Diff line number Diff line change @@ -176,8 +176,10 @@ int main(string[] args)
176
176
dst.write(c);
177
177
src.read(c);
178
178
179
- while (ishexdigit(c))
180
- dst.write(c);
179
+ while (ishexdigit(c)) {
180
+ dst.write(c);
181
+ src.read(c);
182
+ }
181
183
182
184
// TODO: add support for hexadecimal floats
183
185
}
@@ -186,8 +188,10 @@ int main(string[] args)
186
188
dst.write(c);
187
189
src.read(c);
188
190
189
- while (c == ' 0' || c == ' 1' )
190
- dst.write(c);
191
+ while (c == ' 0' || c == ' 1' ) {
192
+ dst.write(c);
193
+ src.read(c);
194
+ }
191
195
}
192
196
else // octal
193
197
{
@@ -384,7 +388,7 @@ int main(string[] args)
384
388
}
385
389
else
386
390
// whatever it is, it's not a valid D token
387
- throw new Error(" unrecognized token" );
391
+ throw new Error(" unrecognized token " ~ c );
388
392
// ~ break;
389
393
}
390
394
}
Original file line number Diff line number Diff line change @@ -21,9 +21,7 @@ int main(string[] args)
21
21
}
22
22
23
23
string url = args[1 ];
24
- int i;
25
-
26
- i = indexOf(url, " ://" );
24
+ auto i = indexOf(url, " ://" );
27
25
28
26
if (i != - 1 )
29
27
{
Original file line number Diff line number Diff line change 50
50
if (sset.isSet(reads[i]))
51
51
{
52
52
char [1024 ] buf;
53
- int read = reads[i].receive(buf);
53
+ auto read = reads[i].receive(buf);
54
54
55
55
if (Socket .ERROR == read)
56
56
{
You can’t perform that action at this time.
0 commit comments