From 5a14a67e060e7f325025e924c83489cfa236e3dc Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 1 Feb 2012 13:03:46 -0800 Subject: converted a bunch of narrowing implicit conversions to explicit --- indra/llmessage/llbufferstream.cpp | 4 ++-- indra/llmessage/llcurl.cpp | 4 ++-- indra/llmessage/llhttpclient.cpp | 2 +- indra/llmessage/llmime.cpp | 4 ++-- indra/llmessage/llsdmessage.cpp | 2 +- indra/llmessage/llsdmessagebuilder.cpp | 2 +- indra/llmessage/message.cpp | 6 +++--- 7 files changed, 12 insertions(+), 12 deletions(-) (limited to 'indra/llmessage') diff --git a/indra/llmessage/llbufferstream.cpp b/indra/llmessage/llbufferstream.cpp index 6257983c43..bb65d16670 100644 --- a/indra/llmessage/llbufferstream.cpp +++ b/indra/llmessage/llbufferstream.cpp @@ -273,7 +273,7 @@ streampos LLBufferStreamBuf::seekoff( // NULL is fine break; } - address = mBuffer->seek(mChannels.in(), base_addr, off); + address = (S32)mBuffer->seek(mChannels.in(), base_addr, off); if(address) { LLBufferArray::segment_iterator_t iter; @@ -304,7 +304,7 @@ streampos LLBufferStreamBuf::seekoff( // NULL is fine break; } - address = mBuffer->seek(mChannels.out(), base_addr, off); + address = (S32)mBuffer->seek(mChannels.out(), base_addr, off); if(address) { LLBufferArray::segment_iterator_t iter; diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index e17380fdf5..344463f036 100644 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -428,9 +428,9 @@ size_t curlReadCallback(char* data, size_t size, size_t nmemb, void* user_data) LLCurl::Easy* easy = (LLCurl::Easy*)user_data; S32 n = size * nmemb; - S32 startpos = easy->getInput().tellg(); + S32 startpos = (S32)easy->getInput().tellg(); easy->getInput().seekg(0, std::ios::end); - S32 endpos = easy->getInput().tellg(); + S32 endpos = (S32)easy->getInput().tellg(); easy->getInput().seekg(startpos, std::ios::beg); S32 maxn = endpos - startpos; n = llmin(n, maxn); diff --git a/indra/llmessage/llhttpclient.cpp b/indra/llmessage/llhttpclient.cpp index dd4e3a6300..98983ad28a 100644 --- a/indra/llmessage/llhttpclient.cpp +++ b/indra/llmessage/llhttpclient.cpp @@ -158,7 +158,7 @@ namespace if(fstream.is_open()) { fstream.seekg(0, std::ios::end); - U32 fileSize = fstream.tellg(); + U32 fileSize = (U32)fstream.tellg(); fstream.seekg(0, std::ios::beg); std::vector fileBuffer(fileSize); fstream.read(&fileBuffer[0], fileSize); diff --git a/indra/llmessage/llmime.cpp b/indra/llmessage/llmime.cpp index 943a734927..9d9c4ebd68 100644 --- a/indra/llmessage/llmime.cpp +++ b/indra/llmessage/llmime.cpp @@ -388,7 +388,7 @@ bool LLMimeParser::Impl::parseHeaders( // not to read past limit when we get() the newline. S32 max_get = llmin((S32)LINE_BUFFER_LENGTH, limit - mScanCount - 1); istr.getline(mBuffer, max_get, '\r'); - mScanCount += istr.gcount(); + mScanCount += (S32)istr.gcount(); int c = istr.get(); if(EOF == c) { @@ -496,7 +496,7 @@ void LLMimeParser::Impl::scanPastSeparator( // past limit when we get() the newline. S32 max_get = llmin((S32)LINE_BUFFER_LENGTH, limit - mScanCount - 1); istr.getline(mBuffer, max_get, '\r'); - mScanCount += istr.gcount(); + mScanCount += (S32)istr.gcount(); if(istr.gcount() >= LINE_BUFFER_LENGTH - 1) { // that's way too long to be a separator, so ignore it. diff --git a/indra/llmessage/llsdmessage.cpp b/indra/llmessage/llsdmessage.cpp index 9148c9dd15..1c93c12d99 100644 --- a/indra/llmessage/llsdmessage.cpp +++ b/indra/llmessage/llsdmessage.cpp @@ -88,7 +88,7 @@ bool LLSDMessage::httpListener(const LLSD& request) request, url, "POST", reply, error), LLSD(), // headers - timeout); + (F32)timeout); return false; } diff --git a/indra/llmessage/llsdmessagebuilder.cpp b/indra/llmessage/llsdmessagebuilder.cpp index 2698a271ee..615221e0ad 100644 --- a/indra/llmessage/llsdmessagebuilder.cpp +++ b/indra/llmessage/llsdmessagebuilder.cpp @@ -317,7 +317,7 @@ void LLSDMessageBuilder::copyFromMessageData(const LLMsgData& data) // S64 not supported in LLSD so we just truncate it case MVT_S64: - addS32(varname, *(S64*)mvci.getData()); + addS32(varname, (S32)*(S64*)mvci.getData()); break; case MVT_F32: diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp index d0b0e178b8..6a425cfe98 100644 --- a/indra/llmessage/message.cpp +++ b/indra/llmessage/message.cpp @@ -3147,7 +3147,7 @@ bool LLMessageSystem::generateDigestForWindowAndUUIDs(char* digest, const S32 wi LL_ERRS("Messaging") << "Trying to generate complex digest on a machine without a shared secret!" << llendl; } - U32 now = time(NULL); + U32 now = (U32)time(NULL); now /= window; @@ -3167,7 +3167,7 @@ bool LLMessageSystem::isMatchingDigestForWindowAndUUIDs(const char* digest, cons } char our_digest[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */ - U32 now = time(NULL); + U32 now = (U32)time(NULL); now /= window; @@ -3213,7 +3213,7 @@ bool LLMessageSystem::generateDigestForWindow(char* digest, const S32 window) co LL_ERRS("Messaging") << "Trying to generate simple digest on a machine without a shared secret!" << llendl; } - U32 now = time(NULL); + U32 now = (U32)time(NULL); now /= window; -- cgit v1.2.3 From d32c1c28b4e2add4e51361d13356b6638c6f0817 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 1 Feb 2012 16:39:27 -0800 Subject: cleaned up linden_common.h, removing stuff that is mostly unused --- indra/llmessage/llbufferstream.cpp | 4 ++-- indra/llmessage/llxfer.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/llmessage') diff --git a/indra/llmessage/llbufferstream.cpp b/indra/llmessage/llbufferstream.cpp index bb65d16670..6257983c43 100644 --- a/indra/llmessage/llbufferstream.cpp +++ b/indra/llmessage/llbufferstream.cpp @@ -273,7 +273,7 @@ streampos LLBufferStreamBuf::seekoff( // NULL is fine break; } - address = (S32)mBuffer->seek(mChannels.in(), base_addr, off); + address = mBuffer->seek(mChannels.in(), base_addr, off); if(address) { LLBufferArray::segment_iterator_t iter; @@ -304,7 +304,7 @@ streampos LLBufferStreamBuf::seekoff( // NULL is fine break; } - address = (S32)mBuffer->seek(mChannels.out(), base_addr, off); + address = mBuffer->seek(mChannels.out(), base_addr, off); if(address) { LLBufferArray::segment_iterator_t iter; diff --git a/indra/llmessage/llxfer.h b/indra/llmessage/llxfer.h index 989e8b2cab..f9348eb11f 100644 --- a/indra/llmessage/llxfer.h +++ b/indra/llmessage/llxfer.h @@ -29,6 +29,7 @@ #include "message.h" #include "lltimer.h" +#include "llextendedstatus.h" const S32 LL_XFER_LARGE_PAYLOAD = 7680; -- cgit v1.2.3