From b908b286b9767ff7a0207ce9414279ce5291762c Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Sat, 18 Jun 2016 14:34:43 +0600 Subject: CLOUD: Fix "signed/unsigned integers" warning The "comparison between signed and unsigned integer expressions" one. Note that in UploadRequests size() and pos() are acutally signed, because they could return -1. This commit implies that Requests are working with such Streams which doesn't. --- backends/cloud/dropbox/dropboxuploadrequest.cpp | 4 ++-- backends/cloud/onedrive/onedriveuploadrequest.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'backends') diff --git a/backends/cloud/dropbox/dropboxuploadrequest.cpp b/backends/cloud/dropbox/dropboxuploadrequest.cpp index 5765892a70..f1fb818d36 100644 --- a/backends/cloud/dropbox/dropboxuploadrequest.cpp +++ b/backends/cloud/dropbox/dropboxuploadrequest.cpp @@ -69,7 +69,7 @@ void DropboxUploadRequest::uploadNextPart() { Common::JSONObject jsonRequestParameters; if (_contentsStream->pos() == 0 || _sessionId == "") { - if (_contentsStream->size() <= UPLOAD_PER_ONE_REQUEST) { + if ((uint32)_contentsStream->size() <= UPLOAD_PER_ONE_REQUEST) { url = "https://content.dropboxapi.com/2/files/upload"; jsonRequestParameters.setVal("path", new Common::JSONValue(_savePath)); jsonRequestParameters.setVal("mode", new Common::JSONValue("overwrite")); @@ -80,7 +80,7 @@ void DropboxUploadRequest::uploadNextPart() { jsonRequestParameters.setVal("close", new Common::JSONValue(false)); } } else { - if (_contentsStream->size() - _contentsStream->pos() <= UPLOAD_PER_ONE_REQUEST) { + if ((uint32)(_contentsStream->size() - _contentsStream->pos()) <= UPLOAD_PER_ONE_REQUEST) { url += "finish"; Common::JSONObject jsonCursor, jsonCommit; jsonCursor.setVal("session_id", new Common::JSONValue(_sessionId)); diff --git a/backends/cloud/onedrive/onedriveuploadrequest.cpp b/backends/cloud/onedrive/onedriveuploadrequest.cpp index bc54a811a9..08f45935d2 100644 --- a/backends/cloud/onedrive/onedriveuploadrequest.cpp +++ b/backends/cloud/onedrive/onedriveuploadrequest.cpp @@ -62,7 +62,7 @@ void OneDriveUploadRequest::start() { void OneDriveUploadRequest::uploadNextPart() { const uint32 UPLOAD_PER_ONE_REQUEST = 10 * 1024 * 1024; - if (_uploadUrl == "" && _contentsStream->size() > UPLOAD_PER_ONE_REQUEST) { + if (_uploadUrl == "" && (uint32)_contentsStream->size() > UPLOAD_PER_ONE_REQUEST) { Common::String url = "https://api.onedrive.com/v1.0/drive/special/approot:/"+ConnMan.urlEncode(_savePath)+":/upload.createSession"; //folder must exist Networking::JsonCallback callback = new Common::Callback(this, &OneDriveUploadRequest::partUploadedCallback); Networking::ErrorCallback failureCallback = new Common::Callback(this, &OneDriveUploadRequest::partUploadedErrorCallback); -- cgit v1.2.3