diff options
| -rw-r--r-- | indra/llcorehttp/httpcommon.cpp | 9 | ||||
| -rw-r--r-- | indra/llcorehttp/httpcommon.h | 6 | ||||
| -rw-r--r-- | indra/llcorehttp/tests/test_httpstatus.hpp | 4 | 
3 files changed, 8 insertions, 11 deletions
| diff --git a/indra/llcorehttp/httpcommon.cpp b/indra/llcorehttp/httpcommon.cpp index c423047bb0..1829062af6 100644 --- a/indra/llcorehttp/httpcommon.cpp +++ b/indra/llcorehttp/httpcommon.cpp @@ -50,11 +50,12 @@ HttpStatus::type_enum_t EXT_CURL_EASY;  HttpStatus::type_enum_t EXT_CURL_MULTI;  HttpStatus::type_enum_t LLCORE; -HttpStatus::operator unsigned long() const +HttpStatus::operator U32() const  { -	static const int shift(sizeof(unsigned long) * 4); +	// Effectively, concatenate mType (high) with mStatus (low). +	static const int shift(sizeof(mDetails->mStatus) * 8); -	unsigned long result(((unsigned long)mDetails->mType) << shift | (unsigned long)(int)mDetails->mStatus); +	U32 result(U32(mDetails->mType) << shift | U32((int)mDetails->mStatus));  	return result;  } @@ -64,7 +65,7 @@ std::string HttpStatus::toHex() const  	std::ostringstream result;  	result.width(8);  	result.fill('0'); -	result << std::hex << operator unsigned long(); +	result << std::hex << operator U32();  	return result.str();  } diff --git a/indra/llcorehttp/httpcommon.h b/indra/llcorehttp/httpcommon.h index b2db01d038..ea0c38abd7 100644 --- a/indra/llcorehttp/httpcommon.h +++ b/indra/llcorehttp/httpcommon.h @@ -382,10 +382,10 @@ struct HttpStatus  	/// creates an ambiguous second path to integer conversion  	/// which tends to find programming errors such as formatting  	/// the status to a stream (operator<<). -	operator unsigned long() const; -	unsigned long toULong() const +	operator U32() const; +	U32 toULong() const  	{ -		return operator unsigned long(); +		return operator U32();  	}  	/// And to convert to a hex string. diff --git a/indra/llcorehttp/tests/test_httpstatus.hpp b/indra/llcorehttp/tests/test_httpstatus.hpp index 10cda799e7..cbe3f574d4 100644 --- a/indra/llcorehttp/tests/test_httpstatus.hpp +++ b/indra/llcorehttp/tests/test_httpstatus.hpp @@ -244,11 +244,7 @@ void HttpStatusTestObjectType::test<7>()  	HttpStatus status(404);  	std::string msg = status.toHex();  	// std::cout << "Result:  " << msg << std::endl; -#if ADDRESS_SIZE == 32  	ensure_equals(msg, "01940001"); -#else -	ensure_equals(msg, "19400000001"); -#endif  } | 
