(svn r6137) -Codechange: some very minor cleanups:

- Start using DeleteXXX for every pool item, not manually doing it
  - Use some wrapper to improve logic
  - Rewrote some pieces to improve logic
This commit is contained in:
truelight
2006-08-26 14:22:54 +00:00
parent bd775a243d
commit 44e5e7f0e4
9 changed files with 60 additions and 42 deletions

View File

@@ -57,6 +57,12 @@ static inline bool IsValidSignID(uint index)
return index < GetSignPoolSize() && IsValidSign(GetSign(index));
}
static inline void DeleteSign(Sign *si)
{
DeleteName(si->str);
si->str = STR_NULL;
}
#define FOR_ALL_SIGNS_FROM(ss, start) for (ss = GetSign(start); ss != NULL; ss = (ss->index + 1 < GetSignPoolSize()) ? GetSign(ss->index + 1) : NULL) if (IsValidSign(ss))
#define FOR_ALL_SIGNS(ss) FOR_ALL_SIGNS_FROM(ss, 0)