Permalink
Browse files

Cleanup warnings

  • Loading branch information...
rescrv committed Aug 21, 2013
1 parent fe0ea8e commit 6445f6c1172b5159e7acf6c729ead1da74723768
Showing with 189 additions and 134 deletions.
  1. +41 −1 e/guard.h
  2. +4 −4 e/nonblocking_bounded_fifo.h
  3. +1 −1 e/varint.h
  4. +3 −3 m4/anal_warnings.m4
  5. +6 −6 test/bitfield.cc
  6. +92 −91 test/buffer.cc
  7. +20 −20 test/convert.cc
  8. +2 −0 test/endian.cc
  9. +8 −0 test/guard.cc
  10. +6 −4 test/intrusive_ptr.cc
  11. +4 −4 test/locking_iterable_fifo.cc
  12. +2 −0 test/runner.cc
View
@@ -60,7 +60,7 @@ class guard_base
other.dismiss();
}
- ~guard_base() {}
+ virtual ~guard_base() {}
protected:
mutable bool m_dismissed;
@@ -86,6 +86,10 @@ class guard_func0 : public guard_base
}
}
+ public:
+ guard_func0(const guard_func0& other);
+ guard_func0& operator = (const guard_func0& rhs);
+
private:
F m_func;
};
@@ -115,6 +119,10 @@ class guard_func1 : public guard_base
}
}
+ public:
+ guard_func1(const guard_func1& other);
+ guard_func1& operator = (const guard_func1& rhs);
+
private:
F m_func;
const P1 m_p1;
@@ -146,6 +154,10 @@ class guard_func2 : public guard_base
}
}
+ public:
+ guard_func2(const guard_func2& other);
+ guard_func2& operator = (const guard_func2& rhs);
+
private:
F m_func;
const P1 m_p1;
@@ -179,6 +191,10 @@ class guard_func3 : public guard_base
}
}
+ public:
+ guard_func3(const guard_func3& other);
+ guard_func3& operator = (const guard_func3& rhs);
+
private:
F m_func;
const P1 m_p1;
@@ -211,6 +227,10 @@ class guard_obj0 : public guard_base
}
}
+ public:
+ guard_obj0(const guard_obj0& other);
+ guard_obj0& operator = (const guard_obj0& rhs);
+
private:
O& m_obj;
F m_func;
@@ -242,6 +262,10 @@ class guard_obj1 : public guard_base
}
}
+ public:
+ guard_obj1(const guard_obj1& other);
+ guard_obj1& operator = (const guard_obj1& rhs);
+
private:
O& m_obj;
F m_func;
@@ -275,6 +299,10 @@ class guard_obj2 : public guard_base
}
}
+ public:
+ guard_obj2(const guard_obj2& other);
+ guard_obj2& operator = (const guard_obj2& rhs);
+
private:
O& m_obj;
F m_func;
@@ -310,6 +338,10 @@ class guard_obj3 : public guard_base
}
}
+ public:
+ guard_obj3(const guard_obj3& other);
+ guard_obj3& operator = (const guard_obj3& rhs);
+
private:
O& m_obj;
F m_func;
@@ -347,6 +379,10 @@ class guard_obj4 : public guard_base
}
}
+ public:
+ guard_obj4(const guard_obj4& other);
+ guard_obj4& operator = (const guard_obj4& rhs);
+
private:
O& m_obj;
F m_func;
@@ -386,6 +422,10 @@ class guard_obj5 : public guard_base
}
}
+ public:
+ guard_obj5(const guard_obj5& other);
+ guard_obj5& operator = (const guard_obj5& rhs);
+
private:
O& m_obj;
F m_func;
@@ -79,10 +79,10 @@ class nonblocking_bounded_fifo
template <typename T>
nonblocking_bounded_fifo<T> :: nonblocking_bounded_fifo(size_t sz)
- : m_sz(sz)
- , m_elems(NULL)
- , m_push(0)
+ : m_push(0)
, m_pop(0)
+ , m_sz(sz)
+ , m_elems(NULL)
{
using namespace e::atomic;
assert(m_sz >= 2);
@@ -189,7 +189,7 @@ nonblocking_bounded_fifo<T> :: pop(T* t)
}
*t = elem->t;
- T fresh;
+ T fresh = T();
elem->t = fresh;
store_64_release(&elem->count, po + m_sz);
return true;
View
@@ -36,7 +36,7 @@ char*
varint64_encode(char* dst, uint64_t value);
// Returns the length of the varint32 or varint64 encoding of "v"
-int
+inline int
varint_length(uint64_t v)
{
int len = 1;
View
@@ -46,7 +46,7 @@ AC_DEFUN([ANAL_WARNINGS],
AX_CHECK_COMPILE_FLAG([-Wchar-subscripts],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wchar-subscripts"],,)
AX_CHECK_COMPILE_FLAG([-Wclobbered],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wclobbered"],,)
AX_CHECK_COMPILE_FLAG([-Wcomment],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wcomment"],,)
- AX_CHECK_COMPILE_FLAG([-Wconversion],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wconversion"],,)
+ dnl AX_CHECK_COMPILE_FLAG([-Wconversion],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wconversion"],,)
AX_CHECK_COMPILE_FLAG([-Wctor-dtor-privacy],[WANAL_CXXFLAGS="${WANAL_CXXFLAGS} -Wctor-dtor-privacy"],,)
AX_CHECK_COMPILE_FLAG([-Wdisabled-optimization],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wdisabled-optimization"],,)
AX_CHECK_COMPILE_FLAG([-Weffc++],[WANAL_CXXFLAGS="${WANAL_CXXFLAGS} -Weffc++"],,)
@@ -80,7 +80,7 @@ AC_DEFUN([ANAL_WARNINGS],
AX_CHECK_COMPILE_FLAG([-Woverloaded-virtual],[WANAL_CXXFLAGS="${WANAL_CXXFLAGS} -Woverloaded-virtual"],,)
AX_CHECK_COMPILE_FLAG([-Wpacked-bitfield-compat],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wpacked-bitfield-compat"],,)
AX_CHECK_COMPILE_FLAG([-Wpacked],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wpacked"],,)
- AX_CHECK_COMPILE_FLAG([-Wpadded],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wpadded"],,)
+ dnl AX_CHECK_COMPILE_FLAG([-Wpadded],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wpadded"],,)
AX_CHECK_COMPILE_FLAG([-Wparentheses],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wparentheses"],,)
AX_CHECK_COMPILE_FLAG([-Wpointer-arith],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wpointer-arith"],,)
AX_CHECK_COMPILE_FLAG([-Wredundant-decls],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wredundant-decls"],,)
@@ -89,7 +89,7 @@ AC_DEFUN([ANAL_WARNINGS],
AX_CHECK_COMPILE_FLAG([-Wsequence-point],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wsequence-point"],,)
AX_CHECK_COMPILE_FLAG([-Wshadow],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wshadow"],,)
AX_CHECK_COMPILE_FLAG([-Wsign-compare],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wsign-compare"],,)
- AX_CHECK_COMPILE_FLAG([-Wsign-conversion],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wsign-conversion"],,)
+ dnl AX_CHECK_COMPILE_FLAG([-Wsign-conversion],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wsign-conversion"],,)
AX_CHECK_COMPILE_FLAG([-Wsign-promo],[WANAL_CXXFLAGS="${WANAL_CXXFLAGS} -Wsign-promo"],,)
AX_CHECK_COMPILE_FLAG([-Wstack-protector],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wstack-protector"],,)
AX_CHECK_COMPILE_FLAG([-Wstrict-aliasing=3],[WANAL_CFLAGS="${WANAL_CFLAGS} -Wstrict-aliasing=3"],,)
View
@@ -39,14 +39,14 @@ namespace
TEST(BitfieldTest, CtorAndDtor)
{
e::bitfield b1(8);
- ASSERT_EQ(8, b1.bits());
- ASSERT_EQ(1, b1.bytes());
+ ASSERT_EQ(8U, b1.bits());
+ ASSERT_EQ(1U, b1.bytes());
e::bitfield b2(16);
- ASSERT_EQ(16, b2.bits());
- ASSERT_EQ(2, b2.bytes());
+ ASSERT_EQ(16U, b2.bits());
+ ASSERT_EQ(2U, b2.bytes());
e::bitfield b3(75);
- ASSERT_EQ(75, b3.bits());
- ASSERT_EQ(10, b3.bytes());
+ ASSERT_EQ(75U, b3.bits());
+ ASSERT_EQ(10U, b3.bytes());
}
static void
Oops, something went wrong.

0 comments on commit 6445f6c

Please sign in to comment.