build: remove useless cast warnings

This commit is contained in:
Danny Robson 2014-07-02 15:45:06 +10:00
parent ff17c51a85
commit d5df6116d5
3 changed files with 5 additions and 7 deletions

View File

@ -83,10 +83,8 @@ guid::from_bytes (const uint8_t *bytes) {
g.data3 = *reinterpret_cast<const uint16_t *> (bytes);
bytes += sizeof (g.data3);
for (signed i = 7; i >= 0; --i) {
g.data4[i] = *reinterpret_cast<const uint8_t *> (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:

View File

@ -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];
}
}

View File

@ -114,7 +114,7 @@ util::period_query::poll (void) {
// ----------------------------------------------------------------------------
util::rate_limiter::rate_limiter (unsigned rate):
m_last (nanoseconds ()),
m_target (static_cast<double> (SECOND) / rate)
m_target (SECOND / rate)
{ ; }