diff options
author | rubidium <rubidium@openttd.org> | 2009-03-15 00:32:18 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-03-15 00:32:18 +0000 |
commit | b25a4f8231f3ded44038ea454a3d4c6a2dc9217d (patch) | |
tree | 776122508c686680b9c97f37ba3cb92ef905d67f /src/misc/blob.hpp | |
parent | d72273d1f3b55df0e301408d630f24ef92ea8479 (diff) | |
download | openttd-b25a4f8231f3ded44038ea454a3d4c6a2dc9217d.tar.xz |
(svn r15718) -Cleanup: apply some comment coding style on the rest of the sources too
Diffstat (limited to 'src/misc/blob.hpp')
-rw-r--r-- | src/misc/blob.hpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/misc/blob.hpp b/src/misc/blob.hpp index 6238cba3e..56e10a7cf 100644 --- a/src/misc/blob.hpp +++ b/src/misc/blob.hpp @@ -250,19 +250,19 @@ public: { bsize_t old_max_size = MaxRawSize(); if (old_max_size >= new_size) return; - // calculate minimum block size we need to allocate + /* calculate minimum block size we need to allocate */ bsize_t min_alloc_size = sizeof(CHdr) + new_size + Ttail_reserve; - // ask allocation policy for some reasonable block size + /* ask allocation policy for some reasonable block size */ bsize_t alloc_size = AllocPolicy(min_alloc_size); - // allocate new block + /* allocate new block */ CHdr *pNewHdr = RawAlloc(alloc_size); - // setup header + /* setup header */ pNewHdr->m_size = RawSize(); pNewHdr->m_max_size = alloc_size - (sizeof(CHdr) + Ttail_reserve); - // copy existing data + /* copy existing data */ if (RawSize() > 0) memcpy(pNewHdr + 1, ptr_u.m_pData, pNewHdr->m_size); - // replace our block with new one + /* replace our block with new one */ CHdr *pOldHdr = &Hdr(); Init(pNewHdr); if (old_max_size > 0) @@ -320,7 +320,7 @@ public: * 4. Dynamically constructs only used items (as opposite of static array which constructs all items) */ template <class Titem_, class Tbase_ = CBlobBaseSimple> class CBlobT : public Tbase_ { - // make template arguments public: + /* make template arguments public: */ public: typedef Titem_ Titem; typedef Tbase_ Tbase; @@ -418,7 +418,7 @@ public: assert((Tbase::RawSize() % Titem_size) == 0); bsize_t old_size = Size(); if (old_size > 0) { - // destroy removed items; + /* destroy removed items; */ Titem *pI_last_to_destroy = Data(0); for (Titem *pI = Data(old_size - 1); pI >= pI_last_to_destroy; pI--) pI->~Titem_(); } @@ -445,10 +445,10 @@ public: bsize_t old_size = Size(); assert(num_items <= old_size); bsize_t new_size = (num_items <= old_size) ? (old_size - num_items) : 0; - // destroy removed items; + /* destroy removed items; */ Titem *pI_last_to_destroy = Data(new_size); for (Titem *pI = Data(old_size - 1); pI >= pI_last_to_destroy; pI--) pI->~Titem(); - // remove them + /* remove them */ Tbase::ReduceRawSize(num_items * Titem_size); } @@ -482,7 +482,7 @@ public: FORCEINLINE void RemoveBySwap(bsize_t idx) { CheckIdx(idx); - // destroy removed item + /* destroy removed item */ Titem *pRemoved = Data(idx); RemoveBySwap(pRemoved); } @@ -492,14 +492,14 @@ public: { Titem *pLast = Data(Size() - 1); assert(pItem >= Data() && pItem <= pLast); - // move last item to its new place + /* move last item to its new place */ if (pItem != pLast) { pItem->~Titem_(); new (pItem) Titem_(*pLast); } - // destroy the last item + /* destroy the last item */ pLast->~Titem_(); - // and reduce the raw blob size + /* and reduce the raw blob size */ Tbase::ReduceRawSize(Titem_size); } |