Browse Source

base: fix very minor issues found by static analysis.

undefined
Sam Hocevar 10 years ago
parent
commit
a581e1719f
2 changed files with 14 additions and 14 deletions
  1. +2
    -2
      src/lol/base/array.h
  2. +12
    -12
      src/lol/unit.h

+ 2
- 2
src/lol/base/array.h View File

@@ -321,13 +321,13 @@ public:
* aligned data. */
Element *tmp = reinterpret_cast<Element *>(reinterpret_cast<uintptr_t>
(new uint8_t[sizeof(Element) * toreserve]));
ASSERT(tmp, "out of memory in Array class");
for (int i = 0; i < m_count; i++)
{
new(&tmp[i]) Element(m_data[i]);
m_data[i].~Element();
}
if (m_data)
delete[] reinterpret_cast<uint8_t *>(m_data);
delete[] reinterpret_cast<uint8_t *>(m_data);
m_data = tmp;
m_reserved = toreserve;
}


+ 12
- 12
src/lol/unit.h View File

@@ -370,29 +370,29 @@ public:


#define LOLUNIT_ASSERT_EQUAL(a, b) \
LOLUNIT_ASSERT_OP(==, !!, "equality", "", a, b)
LOLUNIT_ASSERT_OP(==, (bool), "equality", "", a, b)
#define LOLUNIT_ASSERT_EQUAL_MESSAGE(m, a, b) \
LOLUNIT_ASSERT_OP(==, !!, "equality", LOLUNIT_MSG(m), a, b)
LOLUNIT_ASSERT_OP(==, (bool), "equality", LOLUNIT_MSG(m), a, b)
#define LOLUNIT_ASSERT_DIFFERENT(a, b) \
LOLUNIT_ASSERT_OP(!=, !!, "inequality", "", a, b)
LOLUNIT_ASSERT_OP(!=, (bool), "inequality", "", a, b)
#define LOLUNIT_ASSERT_DIFFERENT_MESSAGE(m, a, b) \
LOLUNIT_ASSERT_OP(!=, !!, "inequality", LOLUNIT_MSG(m), a, b)
LOLUNIT_ASSERT_OP(!=, (bool), "inequality", LOLUNIT_MSG(m), a, b)
#define LOLUNIT_ASSERT_LESS(a, b) \
LOLUNIT_ASSERT_OP(<, !!, "less than", "", a, b)
LOLUNIT_ASSERT_OP(<, (bool), "less than", "", a, b)
#define LOLUNIT_ASSERT_LESS_MESSAGE(m, a, b) \
LOLUNIT_ASSERT_OP(<, !!, "less than", LOLUNIT_MSG(m), a, b)
LOLUNIT_ASSERT_OP(<, (bool), "less than", LOLUNIT_MSG(m), a, b)
#define LOLUNIT_ASSERT_LEQUAL(a, b) \
LOLUNIT_ASSERT_OP(<=, !!, "less than or equal", "", a, b)
LOLUNIT_ASSERT_OP(<=, (bool), "less than or equal", "", a, b)
#define LOLUNIT_ASSERT_LEQUAL_MESSAGE(m, a, b) \
LOLUNIT_ASSERT_OP(<=, !!, "less than or equal", LOLUNIT_MSG(m), a, b)
LOLUNIT_ASSERT_OP(<=, (bool), "less than or equal", LOLUNIT_MSG(m), a, b)
#define LOLUNIT_ASSERT_GREATER(a, b) \
LOLUNIT_ASSERT_OP(>, !!, "greater than", "", a, b)
LOLUNIT_ASSERT_OP(>, (bool), "greater than", "", a, b)
#define LOLUNIT_ASSERT_GREATER_MESSAGE(m, a, b) \
LOLUNIT_ASSERT_OP(>, !!, "greater than", LOLUNIT_MSG(m), a, b)
LOLUNIT_ASSERT_OP(>, (bool), "greater than", LOLUNIT_MSG(m), a, b)
#define LOLUNIT_ASSERT_GEQUAL(a, b) \
LOLUNIT_ASSERT_OP(>=, !!, "greater than or equal", "", a, b)
LOLUNIT_ASSERT_OP(>=, (bool), "greater than or equal", "", a, b)
#define LOLUNIT_ASSERT_GEQUAL_MESSAGE(m, a, b) \
LOLUNIT_ASSERT_OP(>=, !!, "greater than or equal", LOLUNIT_MSG(m), a, b)
LOLUNIT_ASSERT_OP(>=, (bool), "greater than or equal", LOLUNIT_MSG(m), a, b)


#define LOLUNIT_ASSERT_NOT_EQUAL(a, b) \


Loading…
Cancel
Save