浏览代码

base: fix very minor issues found by static analysis.

undefined
Sam Hocevar 10 年前
父节点
当前提交
a581e1719f
共有 2 个文件被更改,包括 14 次插入14 次删除
  1. +2
    -2
      src/lol/base/array.h
  2. +12
    -12
      src/lol/unit.h

+ 2
- 2
src/lol/base/array.h 查看文件

@@ -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 查看文件

@@ -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) \


正在加载...
取消
保存