Mercurial > projects > ddmd
comparison dmd/FileName.d @ 72:2e2a5c3f943a
reduced warnings by adding override to the methods
think this also normalizes different line endings used all over the place
author | Trass3r |
---|---|
date | Sat, 28 Aug 2010 16:19:48 +0200 |
parents | ccbc1e0bb3f0 |
children | 722df8e7509c |
comparison
equal
deleted
inserted
replaced
71:8e24ef1dd139 | 72:2e2a5c3f943a |
---|---|
37 this(string path, string name) | 37 this(string path, string name) |
38 { | 38 { |
39 super(combine(path, name)); | 39 super(combine(path, name)); |
40 } | 40 } |
41 | 41 |
42 hash_t hashCode() | 42 override hash_t hashCode() |
43 { | 43 { |
44 version (_WIN32) { | 44 version (_WIN32) { |
45 // We need a different hashCode because it must be case-insensitive | 45 // We need a different hashCode because it must be case-insensitive |
46 size_t len = str.length; | 46 size_t len = str.length; |
47 hash_t hash = 0; | 47 hash_t hash = 0; |
82 // darwin HFS is case insensitive, though... | 82 // darwin HFS is case insensitive, though... |
83 return super.hashCode(); | 83 return super.hashCode(); |
84 } | 84 } |
85 } | 85 } |
86 | 86 |
87 bool opEquals(Object obj) | 87 override bool opEquals(Object obj) |
88 { | 88 { |
89 return opCmp(obj) == 0; | 89 return opCmp(obj) == 0; |
90 } | 90 } |
91 | 91 |
92 static bool equals(string name1, string name2) | 92 static bool equals(string name1, string name2) |
93 { | 93 { |
94 return compare(name1, name2) == 0; | 94 return compare(name1, name2) == 0; |
95 } | 95 } |
96 | 96 |
97 int opCmp(Object obj) | 97 override int opCmp(Object obj) |
98 { | 98 { |
99 return compare(str, (cast(FileName)obj).str); | 99 return compare(str, (cast(FileName)obj).str); |
100 } | 100 } |
101 | 101 |
102 static int compare(string name1, string name2) | 102 static int compare(string name1, string name2) |