Mercurial > projects > dwt-mac
comparison dwt/internal/Library.d @ 7:e831403a80a9
Add 'cast' to casts
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 27 Aug 2008 14:30:35 +0200 |
parents | 380af2bdd8e5 |
children | 30a762abda2a |
comparison
equal
deleted
inserted
replaced
6:b903c16b6f48 | 7:e831403a80a9 |
---|---|
71 while (index < length && isDigit(aVersion[index])) | 71 while (index < length && isDigit(aVersion[index])) |
72 index++; | 72 index++; |
73 try | 73 try |
74 { | 74 { |
75 if (start < length) | 75 if (start < length) |
76 major = to!(int)(aVersion[start .. index]); | 76 major = to!cast(int)(aVersion[start .. index]); |
77 } | 77 } |
78 catch (ConversionException e) | 78 catch (ConversionException e) |
79 { | 79 { |
80 } | 80 } |
81 start = ++index; | 81 start = ++index; |
82 while (index < length && isDigit(aVersion[index])) | 82 while (index < length && isDigit(aVersion[index])) |
83 index++; | 83 index++; |
84 try | 84 try |
85 { | 85 { |
86 if (start < length) | 86 if (start < length) |
87 minor = to!(int)(aVersion[start .. index]); | 87 minor = to!cast(int)(aVersion[start .. index]); |
88 } | 88 } |
89 catch (ConversionException e) | 89 catch (ConversionException e) |
90 { | 90 { |
91 } | 91 } |
92 start = ++index; | 92 start = ++index; |
93 while (index < length && isDigit(aVersion[index])) | 93 while (index < length && isDigit(aVersion[index])) |
94 index++; | 94 index++; |
95 try | 95 try |
96 { | 96 { |
97 if (start < length) | 97 if (start < length) |
98 micro = to!(int)(aVersion[start .. index]); | 98 micro = to!cast(int)(aVersion[start .. index]); |
99 } | 99 } |
100 catch (ConversionException e) | 100 catch (ConversionException e) |
101 { | 101 { |
102 } | 102 } |
103 return buildJAVA_VERSION(major, minor, micro); | 103 return buildJAVA_VERSION(major, minor, micro); |
164 return false; | 164 return false; |
165 } | 165 } |
166 | 166 |
167 static bool load (String libName) { | 167 static bool load (String libName) { |
168 try { | 168 try { |
169 if (libName.indexOf (SEPARATOR) !is -1) { | 169 if (libName.indexOf cast(SEPARATOR) !is -1) { |
170 System.load (libName); | 170 System.load (libName); |
171 } else { | 171 } else { |
172 System.loadLibrary (libName); | 172 System.loadLibrary (libName); |
173 } | 173 } |
174 return true; | 174 return true; |