diff --git a/guid.cpp b/guid.cpp index b0f862a3..9964f286 100644 --- a/guid.cpp +++ b/guid.cpp @@ -83,10 +83,8 @@ guid::from_bytes (const uint8_t *bytes) { g.data3 = *reinterpret_cast (bytes); bytes += sizeof (g.data3); - for (signed i = 7; i >= 0; --i) { - g.data4[i] = *reinterpret_cast (bytes); - ++bytes; - } + for (signed i = 7; i >= 0; --i) + g.data4[i] = *bytes++; return g; } @@ -100,7 +98,7 @@ guid::from_string (const char *bytes) guid::type guid::get_type (void) const { // Top three bits signal the type - unsigned bits = (unsigned)data4[2] >> 5U; + unsigned bits = data4[2] >> 5U; switch (bits) { case 0x0: diff --git a/image.cpp b/image.cpp index d6401807..214806d8 100644 --- a/image.cpp +++ b/image.cpp @@ -53,7 +53,7 @@ write_netpbm (const uint8_t *restrict pixels, // Write the data rows for (size_t y = 0; y < height; ++y) { for (size_t x = 0; x < width; ++x) - output << (uint8_t)pixels[y * stride + x]; + output << pixels[y * stride + x]; } } diff --git a/time.cpp b/time.cpp index 899659e7..09b8bb45 100644 --- a/time.cpp +++ b/time.cpp @@ -114,7 +114,7 @@ util::period_query::poll (void) { // ---------------------------------------------------------------------------- util::rate_limiter::rate_limiter (unsigned rate): m_last (nanoseconds ()), - m_target (static_cast (SECOND) / rate) + m_target (SECOND / rate) { ; }