diff options
| author | Nat Goodspeed <nat@lindenlab.com> | 2016-12-19 16:30:19 -0500 |
|---|---|---|
| committer | Nat Goodspeed <nat@lindenlab.com> | 2016-12-19 16:30:19 -0500 |
| commit | 40fb9d3e58fcb28778c57a835795ff4a1ef90b98 (patch) | |
| tree | 55fe9990117737dfb1a90aa7f7b88f1a504b3e94 /indra/llcorehttp/httpcommon.cpp | |
| parent | 1df282efa1b4de813ceed42549eff47fad21a33d (diff) | |
DRTVWR-418: Use U32 for int (and hex) of HttpStatus in 64-bit too.
Turns out that Monty didn't intend for the int-flavored representation of
HttpStatus to expand to 64 bits even when unsigned long is that wide. So
change the implicit conversion operator, and its uses, to U32 instead. That
produces a consistent toHex() result for both 32-bit and 64-bit builds.
Diffstat (limited to 'indra/llcorehttp/httpcommon.cpp')
| -rw-r--r-- | indra/llcorehttp/httpcommon.cpp | 9 |
1 files changed, 5 insertions, 4 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(); } |
