digitalmars.D.bugs - [Issue 2065] New: Return value of std.file.exists() is inverted.
- d-bugmail puremagic.com (19/19) May 02 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2065
- d-bugmail puremagic.com (10/17) May 03 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2065
- d-bugmail puremagic.com (7/7) May 12 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2065
- Janice Caron (4/8) May 12 2008 It's certainly conceptually different. The first one returns an int,
- d-bugmail puremagic.com (12/19) May 12 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2065
- d-bugmail puremagic.com (15/28) May 12 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2065
- d-bugmail puremagic.com (9/9) May 17 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2065
- d-bugmail puremagic.com (4/4) May 22 2008 http://d.puremagic.com/issues/show_bug.cgi?id=2065
http://d.puremagic.com/issues/show_bug.cgi?id=2065 Summary: Return value of std.file.exists() is inverted. Product: D Version: 2.014 Platform: PC URL: http://dsource.org/projects/phobos/changeset/683 OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: Phobos AssignedTo: andrei metalanguage.com ReportedBy: torhu yahoo.com In r683, the Windows version of this function is changed into return the wrong value. The correct return statement would be "return result != 0xFFFFFFFF;" The relevant docs: http://msdn.microsoft.com/en-us/library/aa915578.aspx --
May 02 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2065 andrei metalanguage.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNEDIn r683, the Windows version of this function is changed into return the wrong value. The correct return statement would be "return result != 0xFFFFFFFF;" The relevant docs: http://msdn.microsoft.com/en-us/library/aa915578.aspxOuch. How did that ever go through? The fix will go into the next release. Thanks! --
May 03 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2065 I'm having a hard time seeing how: return (result == 0xFFFFFFFF) ? 0 : 1; is different from: return result != 0xFFFFFFFF; --
May 12 2008
On 12/05/2008, d-bugmail puremagic.com <d-bugmail puremagic.com> wrote:I'm having a hard time seeing how: return (result == 0xFFFFFFFF) ? 0 : 1; is different from: return result != 0xFFFFFFFF;It's certainly conceptually different. The first one returns an int, with possible values 0 and 1. The second one returns a bool with possible values false and true.
May 12 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2065I'm having a hard time seeing how: return (result == 0xFFFFFFFF) ? 0 : 1; is different from: return result != 0xFFFFFFFF;I see that revision 682 and before had: return (result == 0xFFFFFFFF) ? 0 : 1; which is correct. In revision 683 I fixed exists to return bool instead of int (just like $DEITY intended it) and in the process I introduced the bug: return result == 0xFFFFFFFF; The one I recently checked into dsource has: return result != 0xFFFFFFFF; which should fix the bug. Sorry for the mistake. --
May 12 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2065On 12/05/2008, d-bugmail puremagic.com <d-bugmail puremagic.com> wrote:In fact it seems the constants 0 and 1 are implicitly convertible to bool but no other integral values, which is a nice touch. I tried this program and was pleasantly surprised: void main() { bool a = 0; bool b = 1; bool c = 2; } It does not compile, but it does if you remove the definition of c. This is the kind of smarts that I'd like to extend to inferring data ranges and signedness. --I'm having a hard time seeing how: return (result == 0xFFFFFFFF) ? 0 : 1; is different from: return result != 0xFFFFFFFF;It's certainly conceptually different. The first one returns an int, with possible values 0 and 1. The second one returns a bool with possible values false and true.
May 12 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2065 andrei metalanguage.com changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED Fixed in 2.014. --
May 17 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2065 Fixed dmd 1.030 and 2.014 --
May 22 2008