Re: D1: std.md5: corrections for the given example

2009-09-19 Thread Stewart Gordon
grauzone wrote: notna wrote: What do you wanna tell us? That while (auto len = file.readBlock(buffer.ptr, buffer.sizeof)) has to work and does not because it's a bug? And that's why you think a bug report should be opened? Enhancement request to allow auto in while, to make it consistent

Re: D1: std.md5: corrections for the given example

2009-09-19 Thread grauzone
notna wrote: grauzone schrieb: md5_example_2.d(7): expression expected, not 'auto' md5_example_2.d(7): found 'len' when expecting ')' md5_example_2.d(7): found '=' instead of statement (this is line 7 after I removed comments and blank lines from your edit) Stewart. God I'm stupid. Sorry

Re: D1: std.md5: corrections for the given example

2009-09-18 Thread Stewart Gordon
notna wrote: grauzone schrieb: http://d.puremagic.com/issues/enter_bug.cgi ??? What do you wanna tell us? Where to report bugs. That while (auto len = file.readBlock(buffer.ptr, buffer.sizeof)) has to work and does not because it's a bug? If you want to know whether a piece of code

Re: D1: std.md5: corrections for the given example

2009-09-18 Thread notna
grauzone schrieb: md5_example_2.d(7): expression expected, not 'auto' md5_example_2.d(7): found 'len' when expecting ')' md5_example_2.d(7): found '=' instead of statement (this is line 7 after I removed comments and blank lines from your edit) Stewart. God I'm stupid. Sorry. I guess I wis

Re: D1: std.md5: corrections for the given example

2009-09-18 Thread grauzone
downs wrote: Stewart Gordon wrote: downs wrote: while (auto len = file.readBlock(buffer.ptr, buffer.sizeof)) md5_example_2.d(7): expression expected, not 'auto' md5_example_2.d(7): found 'len' when expecting ')' md5_example_2.d(7): found '=' instead of statement (this is line 7 after I rem

Re: D1: std.md5: corrections for the given example

2009-09-17 Thread downs
Stewart Gordon wrote: > downs wrote: > >> while (auto len = file.readBlock(buffer.ptr, buffer.sizeof)) > > > md5_example_2.d(7): expression expected, not 'auto' > md5_example_2.d(7): found 'len' when expecting ')' > md5_example_2.d(7): found '=' instead of statement > > (this is line 7 after I

Re: D1: std.md5: corrections for the given example

2009-09-17 Thread notna
Stewart Gordon schrieb: downs wrote: while (auto len = file.readBlock(buffer.ptr, buffer.sizeof)) md5_example_2.d(7): expression expected, not 'auto' md5_example_2.d(7): found 'len' when expecting ')' md5_example_2.d(7): found '=' instead of statement (this is line 7 after I removed comment

Re: D1: std.md5: corrections for the given example

2009-09-17 Thread Stewart Gordon
downs wrote: while (auto len = file.readBlock(buffer.ptr, buffer.sizeof)) md5_example_2.d(7): expression expected, not 'auto' md5_example_2.d(7): found 'len' when expecting ')' md5_example_2.d(7): found '=' instead of statement (this is line 7 after I removed comments and blank lines from yo

Re: D1: std.md5: corrections for the given example

2009-09-17 Thread notna
downs wrote: scope file = new File(fileName, FileMode.In); // int len; while (auto len = file.readBlock(buffer.ptr, buffer.sizeof)) // return digestToString(digest); Thanks, that looks "cleaner"...

Re: D1: std.md5: corrections for the given example

2009-09-17 Thread downs
notna wrote: > Stewart Gordon schrieb: >> The .ptr is necessary, but the cast(uint) isn't. Even if a change of >> type were necessary, just 1U would do. (U is a suffix meaning >> unsigned. There's also L meaning long.) >> >> Stewart. > > Thank Stewart. > > As the std.md5-example is not working

Re: D1: std.md5: corrections for the given example

2009-09-16 Thread notna
Stewart Gordon schrieb: The .ptr is necessary, but the cast(uint) isn't. Even if a change of type were necessary, just 1U would do. (U is a suffix meaning unsigned. There's also L meaning long.) Stewart. Thank Stewart. As the std.md5-example is not working with "unicode" file names (fop

Re: D1: std.md5: corrections for the given example

2009-09-16 Thread Stewart Gordon
notna wrote: This isn't working here (DMD v1.042, Windows XP Pro). I had to replace it with: while ((len = fread(buffer.ptr, cast(uint)1, buffer.sizeof, file)) != 0) ^^^ ^^ The .ptr is necessary, but the cast(uint) isn't. Even if a change of type were ne

D1: std.md5: corrections for the given example

2009-09-16 Thread notna
Hi. In the given example of the D1 std.md5, this line can be found: while ((len = fread(buffer, 1, buffer.sizeof, file)) != 0) This isn't working here (DMD v1.042, Windows XP Pro). I had to replace it with: while ((len = fread(buffer.ptr, cast(uint)1, buffer.sizeof, file)) != 0)