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.
This commit is contained in:
Alexander Tkachev 2016-06-18 14:34:43 +06:00
parent 1addefad7e
commit b908b286b9
3 changed files with 4 additions and 4 deletions

View file

@ -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));

View file

@ -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<OneDriveUploadRequest, Networking::JsonResponse>(this, &OneDriveUploadRequest::partUploadedCallback);
Networking::ErrorCallback failureCallback = new Common::Callback<OneDriveUploadRequest, Networking::ErrorResponse>(this, &OneDriveUploadRequest::partUploadedErrorCallback);

View file

@ -100,7 +100,7 @@ void StorageWizardDialog::handleCommand(CommandSender *sender, uint32 cmd, uint3
switch (cmd) {
case kCodeBoxCmd: {
Common::String code, message;
int correctFields = 0;
uint32 correctFields = 0;
for (uint32 i = 0; i < CODE_FIELDS; ++i) {
Common::String subcode = _codeWidget[i]->getEditString();
if (subcode.size() == 0) {