fixes data types for 32 bit systems

This commit is contained in:
Peter Thorson
2012-03-07 08:37:12 -06:00
parent 69fb256087
commit b9fd0d99ad
4 changed files with 6 additions and 6 deletions

View File

@@ -176,7 +176,7 @@ public:
<< ",\"bytes\":" << m_bytes
<< ",\"quantiles\":[";
for (int i = 0; i < m_quantile_count; i++) {
for (size_t i = 0; i < m_quantile_count; i++) {
s << (i > 0 ? "," : "");
s << "[";
s << avgs[i] << "," << quantiles[i];

View File

@@ -75,7 +75,7 @@ public:
m_rtts = extract_bool(cmd,"rtts");
// specific to message_test
m_message_count = extract_number<uint64_t>(cmd,"size");
m_message_count = extract_number<size_t>(cmd,"size");
m_message_size = extract_number<uint64_t>(cmd,"count");
m_timeout = extract_number<uint64_t>(cmd,"timeout");
@@ -142,7 +142,7 @@ public:
}
private:
// Simulation Parameters
uint64_t m_message_size;
size_t m_message_size;
uint64_t m_message_count;
uint64_t m_timeout;
bool m_binary;

View File

@@ -57,8 +57,8 @@ uint64_t data::process_payload(std::istream& input,uint64_t size) {
}
if (new_size > m_payload.capacity()) {
m_payload.reserve(std::max<uint64_t>(
new_size, static_cast<uint64_t>(2*m_payload.capacity())
m_payload.reserve(std::max<size_t>(
new_size, static_cast<size_t>(2*m_payload.capacity())
));
}

View File

@@ -125,7 +125,7 @@ void hybi_header::set_payload_size(uint64_t size) {
m_header[1] |= BASIC_PAYLOAD_16BIT_CODE;
}
m_payload_size = size;
*(reinterpret_cast<uint16_t*>(&m_header[BASIC_HEADER_LENGTH])) = htons(size);
*(reinterpret_cast<uint16_t*>(&m_header[BASIC_HEADER_LENGTH])) = htons(static_cast<uint16_t>(size));
} else if (size <= frame::limits::PAYLOAD_SIZE_JUMBO) {
if (get_masked()) {
// shift mask bytes to the correct position given the new size