diff options
author | Ansariel <ansariel.hiller@phoenixviewer.com> | 2024-06-01 15:49:26 +0200 |
---|---|---|
committer | Ansariel <ansariel.hiller@phoenixviewer.com> | 2024-06-01 15:49:26 +0200 |
commit | b42f9d836b4c0f7fbd4bdae1734021e2a09fdbe8 (patch) | |
tree | d73404c2fbacce379a57e2d03a6cd54558590859 /indra/llcorehttp | |
parent | cb3bd8865aa0f9fb8a247ea595cf1973057ba91f (diff) |
Re-enable a lot of compiler warnings for MSVC and address the C4267 "possible loss of precision" warnings
Diffstat (limited to 'indra/llcorehttp')
-rw-r--r-- | indra/llcorehttp/_httplibcurl.cpp | 2 | ||||
-rw-r--r-- | indra/llcorehttp/_httpoprequest.cpp | 9 | ||||
-rw-r--r-- | indra/llcorehttp/_httppolicy.cpp | 6 | ||||
-rw-r--r-- | indra/llcorehttp/examples/http_texture_load.cpp | 4 |
4 files changed, 11 insertions, 10 deletions
diff --git a/indra/llcorehttp/_httplibcurl.cpp b/indra/llcorehttp/_httplibcurl.cpp index e646271c84..8ed517ffca 100644 --- a/indra/llcorehttp/_httplibcurl.cpp +++ b/indra/llcorehttp/_httplibcurl.cpp @@ -442,7 +442,7 @@ bool HttpLibcurl::completeRequest(CURLM * multi_handle, CURL * handle, CURLcode int HttpLibcurl::getActiveCount() const { - return mActiveOps.size(); + return static_cast<int>(mActiveOps.size()); } diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index 5165a6eb62..6186e7a308 100644 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -267,7 +267,7 @@ void HttpOpRequest::visitNotifier(HttpRequest * request) if (mReplyOffset || mReplyLength) { // Got an explicit offset/length in response - response->setRange(mReplyOffset, mReplyLength, mReplyFullLength); + response->setRange(mReplyOffset, static_cast<unsigned int>(mReplyLength), static_cast<unsigned int>(mReplyFullLength)); } response->setContentType(mReplyConType); response->setRetries(mPolicyRetries, mPolicy503Retries); @@ -328,7 +328,7 @@ HttpStatus HttpOpRequest::setupGetByteRange(HttpRequest::policy_t policy_id, LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; setupCommon(policy_id, url, NULL, options, headers); mReqMethod = HOR_GET; - mReqOffset = offset; + mReqOffset = static_cast<off_t>(offset); mReqLength = len; if (offset || len) { @@ -607,7 +607,7 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) long data_size(0); if (mReqBody) { - data_size = mReqBody->size(); + data_size = static_cast<long>(mReqBody->size()); } check_curl_easy_setopt(mCurlHandle, CURLOPT_POSTFIELDS, static_cast<void *>(NULL)); check_curl_easy_setopt(mCurlHandle, CURLOPT_POSTFIELDSIZE, data_size); @@ -618,13 +618,14 @@ HttpStatus HttpOpRequest::prepareRequest(HttpService * service) case HOR_PATCH: check_curl_easy_setopt(mCurlHandle, CURLOPT_CUSTOMREQUEST, "PATCH"); // fall through. The rest is the same as PUT + [[fallthrough]]; case HOR_PUT: { check_curl_easy_setopt(mCurlHandle, CURLOPT_UPLOAD, 1); long data_size(0); if (mReqBody) { - data_size = mReqBody->size(); + data_size = static_cast<long>(mReqBody->size()); } check_curl_easy_setopt(mCurlHandle, CURLOPT_INFILESIZE, data_size); mCurlHeaders = curl_slist_append(mCurlHeaders, "Expect:"); diff --git a/indra/llcorehttp/_httppolicy.cpp b/indra/llcorehttp/_httppolicy.cpp index 704c8abb93..a39d2f21a9 100644 --- a/indra/llcorehttp/_httppolicy.cpp +++ b/indra/llcorehttp/_httppolicy.cpp @@ -98,7 +98,7 @@ HttpPolicy::~HttpPolicy() HttpRequest::policy_t HttpPolicy::createPolicyClass() { - const HttpRequest::policy_t policy_class(mClasses.size()); + const HttpRequest::policy_t policy_class(static_cast<HttpRequest::policy_t>(mClasses.size())); if (policy_class >= HTTP_POLICY_CLASS_LIMIT) { return HttpRequest::INVALID_POLICY_ID; @@ -432,8 +432,8 @@ int HttpPolicy::getReadyCount(HttpRequest::policy_t policy_class) const { if (policy_class < mClasses.size()) { - return (mClasses[policy_class]->mReadyQueue.size() - + mClasses[policy_class]->mRetryQueue.size()); + return static_cast<int>((mClasses[policy_class]->mReadyQueue.size() + + mClasses[policy_class]->mRetryQueue.size())); } return 0; } diff --git a/indra/llcorehttp/examples/http_texture_load.cpp b/indra/llcorehttp/examples/http_texture_load.cpp index 4d1e52b766..3c7c8ed634 100644 --- a/indra/llcorehttp/examples/http_texture_load.cpp +++ b/indra/llcorehttp/examples/http_texture_load.cpp @@ -519,7 +519,7 @@ void WorkingSet::onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * r { // More success LLCore::BufferArray * data(response->getBody()); - mByteCount += data ? data->size() : 0; + mByteCount += data ? static_cast<long>(data->size()) : 0L; ++mSuccesses; } else @@ -602,7 +602,7 @@ void WorkingSet::loadAssetUuids(FILE * in) mAssets.push_back(asset); } } - mRemaining = mLimit = mAssets.size(); + mRemaining = mLimit = static_cast<int>(mAssets.size()); } |