From b9fd0d99ad2f0644f2c7b8ad2f561b051d68eea8 Mon Sep 17 00:00:00 2001 From: Peter Thorson Date: Wed, 7 Mar 2012 08:37:12 -0600 Subject: [PATCH] fixes data types for 32 bit systems --- examples/wsperf/case.hpp | 2 +- examples/wsperf/generic.hpp | 4 ++-- src/messages/data.cpp | 4 ++-- src/processors/hybi_header.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/wsperf/case.hpp b/examples/wsperf/case.hpp index 2022b4d2ca..7b7d7c7779 100644 --- a/examples/wsperf/case.hpp +++ b/examples/wsperf/case.hpp @@ -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]; diff --git a/examples/wsperf/generic.hpp b/examples/wsperf/generic.hpp index 84470ca865..0b86a7f288 100644 --- a/examples/wsperf/generic.hpp +++ b/examples/wsperf/generic.hpp @@ -75,7 +75,7 @@ public: m_rtts = extract_bool(cmd,"rtts"); // specific to message_test - m_message_count = extract_number(cmd,"size"); + m_message_count = extract_number(cmd,"size"); m_message_size = extract_number(cmd,"count"); m_timeout = extract_number(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; diff --git a/src/messages/data.cpp b/src/messages/data.cpp index 053a53c59c..4765edc10b 100644 --- a/src/messages/data.cpp +++ b/src/messages/data.cpp @@ -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( - new_size, static_cast(2*m_payload.capacity()) + m_payload.reserve(std::max( + new_size, static_cast(2*m_payload.capacity()) )); } diff --git a/src/processors/hybi_header.cpp b/src/processors/hybi_header.cpp index d7d2c5c4d5..49a89888df 100644 --- a/src/processors/hybi_header.cpp +++ b/src/processors/hybi_header.cpp @@ -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(&m_header[BASIC_HEADER_LENGTH])) = htons(size); + *(reinterpret_cast(&m_header[BASIC_HEADER_LENGTH])) = htons(static_cast(size)); } else if (size <= frame::limits::PAYLOAD_SIZE_JUMBO) { if (get_masked()) { // shift mask bytes to the correct position given the new size