Mercurial > hg > forks > yadex
comparison src/wads.cc @ 79:0602d9bf474a
Various cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 26 Sep 2011 17:14:54 +0300 |
parents | a68786b9c74b |
children | 2f1ecc1c5f72 |
comparison
equal
deleted
inserted
replaced
78:626678d4ecf3 | 79:0602d9bf474a |
---|---|
170 find an entry in the master directory | 170 find an entry in the master directory |
171 */ | 171 */ |
172 | 172 |
173 MDirPtr FindMasterDir(MDirPtr from, const char *name) | 173 MDirPtr FindMasterDir(MDirPtr from, const char *name) |
174 { | 174 { |
175 while (from) | 175 while (from != NULL) |
176 { | 176 { |
177 if (!y_strnicmp(from->dir.name, name, WAD_NAME)) | 177 if (!y_strnicmp(from->dir.name, name, WAD_NAME)) |
178 break; | 178 return from; |
179 from = from->next; | 179 from = from->next; |
180 } | 180 } |
181 return from; | 181 return NULL; |
182 } | 182 } |
183 | 183 |
184 | 184 |
185 /* | 185 /* |
186 * Find an entry in the master directory | 186 * Find an entry in the master directory |
187 */ | 187 */ |
188 MDirPtr FindMasterDir(MDirPtr from, const char *name1, const char *name2) | 188 MDirPtr FindMasterDir(MDirPtr from, const char *name1, const char *name2) |
189 { | 189 { |
190 while (from) | 190 while (from != NULL) |
191 { | 191 { |
192 if (!y_strnicmp(from->dir.name, name1, WAD_NAME) | 192 if (!y_strnicmp(from->dir.name, name1, WAD_NAME) || |
193 || !y_strnicmp(from->dir.name, name2, WAD_NAME)) | 193 !y_strnicmp(from->dir.name, name2, WAD_NAME)) |
194 break; | 194 return from; |
195 from = from->next; | 195 from = from->next; |
196 } | 196 } |
197 return from; | 197 return NULL; |
198 } | 198 } |
199 | 199 |
200 | 200 |
201 /* | 201 /* |
202 output bytes to a binary file with error checking | 202 output bytes to a binary file with error checking |
260 rc = 2; | 260 rc = 2; |
261 goto byebye; | 261 goto byebye; |
262 } | 262 } |
263 | 263 |
264 byebye: | 264 byebye: |
265 if (data != 0) | 265 FreeMemory(data); |
266 FreeMemory(data); | |
267 return rc; | 266 return rc; |
268 } | 267 } |