debug: use appropriate signed literals for CHECK
This commit is contained in:
parent
0b811e636e
commit
8f8896b0f6
@ -41,7 +41,7 @@ debug::backtrace::backtrace (void):
|
|||||||
while ((last = ::backtrace (&m_frames[0], trunc_cast<int> (m_frames.size ()))) == size)
|
while ((last = ::backtrace (&m_frames[0], trunc_cast<int> (m_frames.size ()))) == size)
|
||||||
m_frames.resize (size = m_frames.size () * 2);
|
m_frames.resize (size = m_frames.size () * 2);
|
||||||
|
|
||||||
CHECK_GT (last, 0);
|
CHECK_GT (last, 0u);
|
||||||
m_frames.resize (last);
|
m_frames.resize (last);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ template <domain D>
|
|||||||
void
|
void
|
||||||
net::socket<D, type::STREAM>::send (const uint8_t *restrict data, size_t len) {
|
net::socket<D, type::STREAM>::send (const uint8_t *restrict data, size_t len) {
|
||||||
CHECK (data != NULL);
|
CHECK (data != NULL);
|
||||||
CHECK_GT (len, 0);
|
CHECK_GT (len, 0u);
|
||||||
|
|
||||||
for (size_t sent = 0; sent < len; ) {
|
for (size_t sent = 0; sent < len; ) {
|
||||||
ssize_t result = ::send (this->m_fd, static_cast<const void *>(data + sent), len - sent, 0);
|
ssize_t result = ::send (this->m_fd, static_cast<const void *>(data + sent), len - sent, 0);
|
||||||
@ -181,7 +181,7 @@ template <domain D>
|
|||||||
size_t
|
size_t
|
||||||
net::socket<D, type::STREAM>::recv (uint8_t *restrict data, size_t len) {
|
net::socket<D, type::STREAM>::recv (uint8_t *restrict data, size_t len) {
|
||||||
CHECK (data != NULL);
|
CHECK (data != NULL);
|
||||||
CHECK_GT (len, 0);
|
CHECK_GT (len, 0u);
|
||||||
|
|
||||||
ssize_t received = ::recv (this->m_fd, data, len, 0);
|
ssize_t received = ::recv (this->m_fd, data, len, 0);
|
||||||
if (received < 0)
|
if (received < 0)
|
||||||
@ -261,7 +261,7 @@ net::socket<D, type::DGRAM>::send_addr (const address_type &addr,
|
|||||||
const uint8_t *restrict data,
|
const uint8_t *restrict data,
|
||||||
size_t len) {
|
size_t len) {
|
||||||
CHECK (data != NULL);
|
CHECK (data != NULL);
|
||||||
CHECK_GT (len, 0);
|
CHECK_GT (len, 0u);
|
||||||
|
|
||||||
typename address_type::sockaddr_type addr_in = addr.to_sockaddr ();
|
typename address_type::sockaddr_type addr_in = addr.to_sockaddr ();
|
||||||
|
|
||||||
@ -278,7 +278,7 @@ typename net::socket<D, type::DGRAM>::address_type
|
|||||||
net::socket<D, type::DGRAM>::recv_addr (uint8_t *restrict data,
|
net::socket<D, type::DGRAM>::recv_addr (uint8_t *restrict data,
|
||||||
size_t len) {
|
size_t len) {
|
||||||
CHECK (data != NULL);
|
CHECK (data != NULL);
|
||||||
CHECK_GT (len, 0);
|
CHECK_GT (len, 0u);
|
||||||
|
|
||||||
typename address_type::sockaddr_type addr_in;
|
typename address_type::sockaddr_type addr_in;
|
||||||
socklen_t addr_len = sizeof (addr_in);
|
socklen_t addr_len = sizeof (addr_in);
|
||||||
|
@ -372,11 +372,11 @@ util::operator<< (std::ostream &os, const util::region<S,T> &rhs) {
|
|||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
namespace util { namespace debug {
|
namespace util { namespace debug {
|
||||||
template <size_t S, typename T>
|
template <size_t S, typename T>
|
||||||
struct validator<util::region,S,T> {
|
struct validator<util::region<S,T>> {
|
||||||
static bool is_valid (const util::region<S,T> &r)
|
static bool is_valid (const util::region<S,T> &r)
|
||||||
{
|
{
|
||||||
CHECK_GE (r.area (), 0);
|
CHECK_GE (r.area (), 0u);
|
||||||
CHECK_GE (min (r.e), 0);
|
CHECK_GE (min (r.e), 0u);
|
||||||
|
|
||||||
return r.area () >= 0 && min (r.e) >= 0;
|
return r.area () >= 0 && min (r.e) >= 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user