Changeset 1818


Ignore:
Timestamp:
Aug 25, 2012, 12:17:14 AM (8 years ago)
Author:
sam
Message:

core: revert unfinished commit that wasn't really interesting.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/array.h

    r1816 r1818  
    4545        for (int i = 0; i < m_count; i++)
    4646            m_data[i].~Element();
    47         if (sizeof(Element) & 1)
    48             delete[] (uint8_t *)(m_data);
    49         else if (sizeof(Element) & 2)
    50             delete[] (uint16_t *)(m_data);
    51         else if (sizeof(Element) & 4)
    52             delete[] (uint32_t *)(m_data);
    53         else
    54             delete[] (uint64_t *)(m_data);
     47        delete[] reinterpret_cast<uint8_t *>(m_data);
    5548    }
    5649
     
    182175            return;
    183176
    184         Element *tmp;
    185         if (sizeof(Element) & 1)
    186             tmp = (Element *)
    187                               (new uint8_t [sizeof(Element) * toreserve]);
    188         else if (sizeof(Element) & 2)
    189             tmp = (Element *)
    190                               (new uint16_t [sizeof(Element) / 2 * toreserve]);
    191         else if (sizeof(Element) & 4)
    192             tmp = (Element *)
    193                               (new uint32_t [sizeof(Element) / 4 * toreserve]);
    194         else
    195             tmp = (Element *)
    196                               (new uint64_t [sizeof(Element) / 8 * toreserve]);
     177        Element *tmp = reinterpret_cast<Element *>
     178                               (new uint8_t [sizeof(Element) * toreserve]);
    197179        for (int i = 0; i < m_count; i++)
    198180        {
     
    201183        }
    202184        if (m_data)
    203         {
    204             if (sizeof(Element) & 1)
    205                 delete[] (uint8_t *)(m_data);
    206             else if (sizeof(Element) & 2)
    207                 delete[] (uint16_t *)(m_data);
    208             else if (sizeof(Element) & 4)
    209                 delete[] (uint32_t *)(m_data);
    210             else
    211                 delete[] (uint64_t *)(m_data);
    212         }
     185            delete[] reinterpret_cast<uint8_t *>(m_data);
    213186        m_data = tmp;
    214187        m_reserved = toreserve;
  • trunk/src/ticker.cpp

    r1816 r1818  
    166166        Profiler::Start(Profiler::STAT_TICK_GAME);
    167167
    168 #if 1
     168#if 0
    169169        Log::Debug("-------------------------------------\n");
    170170        for (int i = 0; i < Entity::ALLGROUP_END; i++)
Note: See TracChangeset for help on using the changeset viewer.