Skip to content

Commit f370f35

Browse files
committed
Update samples
1 parent f7babe2 commit f370f35

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

samples/dhry.d

+5-5
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ void main()
579579
printf (" should be: %d\n", 2);
580580
printf (" Int_Comp: %d\n", Ptr_Glob.variant.var_1.Int_Comp);
581581
printf (" should be: %d\n", 17);
582-
printf (" Str_Comp: %.*s\n", Ptr_Glob.variant.var_1.Str_Comp);
582+
printf (" Str_Comp: %.*s\n", Ptr_Glob.variant.var_1.Str_Comp.ptr);
583583
printf (" should be: DHRYSTONE PROGRAM, SOME STRING\n");
584584
printf ("Next_Ptr_Glob.\n");
585585
printf (" Ptr_Comp: %d\n", cast(int) Next_Ptr_Glob.Ptr_Comp);
@@ -590,7 +590,7 @@ void main()
590590
printf (" should be: %d\n", 1);
591591
printf (" Int_Comp: %d\n", Next_Ptr_Glob.variant.var_1.Int_Comp);
592592
printf (" should be: %d\n", 18);
593-
printf (" Str_Comp: %.*s\n", Next_Ptr_Glob.variant.var_1.Str_Comp);
593+
printf (" Str_Comp: %.*s\n", Next_Ptr_Glob.variant.var_1.Str_Comp.ptr);
594594
printf (" should be: DHRYSTONE PROGRAM, SOME STRING\n");
595595
printf ("Int_1_Loc: %d\n", Int_1_Loc);
596596
printf (" should be: %d\n", 5);
@@ -600,9 +600,9 @@ void main()
600600
printf (" should be: %d\n", 7);
601601
printf ("Enum_Loc: %d\n", Enum_Loc);
602602
printf (" should be: %d\n", 1);
603-
printf ("Str_1_Loc: %.*s\n", Str_1_Loc);
603+
printf ("Str_1_Loc: %.*s\n", Str_1_Loc.ptr);
604604
printf (" should be: DHRYSTONE PROGRAM, 1'ST STRING\n");
605-
printf ("Str_2_Loc: %.*s\n", Str_2_Loc);
605+
printf ("Str_2_Loc: %.*s\n", Str_2_Loc.ptr);
606606
printf (" should be: DHRYSTONE PROGRAM, 2'ND STRING\n");
607607
printf ("\n");
608608

@@ -632,7 +632,7 @@ void main()
632632

633633
fprintf(Ap, "\n");
634634
fprintf(Ap, "Dhrystone Benchmark, Version 2.1 (Language: D)\n");
635-
fprintf(Ap, "%.*s\n", Reg_Define);
635+
fprintf(Ap, "%.*s\n", Reg_Define.ptr);
636636
fprintf(Ap, "Microseconds for one loop: %7.1lf\n", Microseconds);
637637
fprintf(Ap, "Dhrystones per second: %10.1lf\n", Dhrystones_Per_Second);
638638
fprintf(Ap, "VAX MIPS rating: %10.3lf\n", Vax_Mips);

samples/htmlget.d

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ int main(string[] args)
4646
else
4747
{
4848
domain = url[0 .. i];
49-
url = url[i .. url.length];
49+
url = url[i .. $];
5050
}
5151

5252
ushort port;
@@ -58,7 +58,7 @@ int main(string[] args)
5858
}
5959
else
6060
{
61-
port = to!ushort(domain[i + 1 .. domain.length]);
61+
port = to!ushort(domain[i + 1 .. $]);
6262
domain = domain[0 .. i];
6363
}
6464

@@ -92,7 +92,7 @@ int main(string[] args)
9292
if (line.length > CONTENT_TYPE_NAME.length &&
9393
!icmp(CONTENT_TYPE_NAME, line[0 .. CONTENT_TYPE_NAME.length]))
9494
{
95-
auto type = line[CONTENT_TYPE_NAME.length .. line.length];
95+
auto type = line[CONTENT_TYPE_NAME.length .. $];
9696

9797
if (type.length <= 5 || icmp("text/", type[0 .. 5]))
9898
throw new Exception("URL is not text");

samples/wc2.d

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ int main (string[] args)
4646
}
4747
if (inword)
4848
{
49-
auto w = input[wstart .. input.length];
49+
auto w = input[wstart .. $];
5050
dictionary[w]++;
5151
}
5252
}

0 commit comments

Comments
 (0)