diff options
author | Alexander Tkachev | 2016-05-31 19:32:16 +0600 |
---|---|---|
committer | Alexander Tkachev | 2016-08-24 16:07:55 +0600 |
commit | ca85d4482af0b2e570565d5aa6d562ec86b10100 (patch) | |
tree | e62fd73f8564a2eca3a619277db764af691aa923 | |
parent | 0d0033fb6ad00e3081bc2854ce5972746b603105 (diff) | |
download | scummvm-rg350-ca85d4482af0b2e570565d5aa6d562ec86b10100.tar.gz scummvm-rg350-ca85d4482af0b2e570565d5aa6d562ec86b10100.tar.bz2 scummvm-rg350-ca85d4482af0b2e570565d5aa6d562ec86b10100.zip |
CLOUD: Use uint64 in StorageInfo
There was a warning regarding 25 GB constant.
By the way, I'm not sure how to print uint64 (%llu is available in C99
only, and gcc produces a warning about that).
-rw-r--r-- | backends/cloud/dropbox/dropboxstorage.cpp | 8 | ||||
-rw-r--r-- | backends/cloud/onedrive/onedrivestorage.cpp | 2 | ||||
-rw-r--r-- | backends/cloud/storageinfo.h | 8 |
3 files changed, 9 insertions, 9 deletions
diff --git a/backends/cloud/dropbox/dropboxstorage.cpp b/backends/cloud/dropbox/dropboxstorage.cpp index 1aae73e524..263c2c8132 100644 --- a/backends/cloud/dropbox/dropboxstorage.cpp +++ b/backends/cloud/dropbox/dropboxstorage.cpp @@ -181,9 +181,9 @@ void DropboxStorage::infoInnerCallback(StorageInfoCallback outerCallback, Networ Common::String name = info.getVal("display_name")->asString(); Common::String email = info.getVal("email")->asString(); Common::JSONObject quota = info.getVal("quota_info")->asObject(); - uint32 quotaNormal = quota.getVal("normal")->asIntegerNumber(); - uint32 quotaShared = quota.getVal("shared")->asIntegerNumber(); - uint32 quotaAllocated = quota.getVal("quota")->asIntegerNumber(); + uint64 quotaNormal = quota.getVal("normal")->asIntegerNumber(); + uint64 quotaShared = quota.getVal("shared")->asIntegerNumber(); + uint64 quotaAllocated = quota.getVal("quota")->asIntegerNumber(); (*outerCallback)(StorageInfoResponse(nullptr, StorageInfo(uid, name, email, quotaNormal+quotaShared, quotaAllocated))); delete outerCallback; } @@ -195,7 +195,7 @@ void DropboxStorage::infoMethodCallback(StorageInfoResponse response) { debug("\nStorage info:"); debug("User name: %s", response.value.name().c_str()); debug("Email: %s", response.value.email().c_str()); - debug("Disk usage: %u/%u", response.value.used(), response.value.available()); + debug("Disk usage: %u/%u", (uint32)response.value.used(), (uint32)response.value.available()); } DropboxStorage *DropboxStorage::loadFromConfig(Common::String keyPrefix) { diff --git a/backends/cloud/onedrive/onedrivestorage.cpp b/backends/cloud/onedrive/onedrivestorage.cpp index fb2ead3364..c64ed6bf72 100644 --- a/backends/cloud/onedrive/onedrivestorage.cpp +++ b/backends/cloud/onedrive/onedrivestorage.cpp @@ -143,7 +143,7 @@ void OneDriveStorage::infoInnerCallback(StorageInfoCallback outerCallback, Netwo Common::JSONObject info = json->asObject(); Common::String uid, name, email; - uint32 quotaUsed = 0, quotaAllocated = 25 * 1024 * 1024 * 1024; // 25 GB, because I actually don't know any way to find out the real one + uint64 quotaUsed = 0, quotaAllocated = 26843545600L; // 25 GB, because I actually don't know any way to find out the real one if (info.contains("createdBy") && info.getVal("createdBy")->isObject()) { Common::JSONObject createdBy = info.getVal("createdBy")->asObject(); diff --git a/backends/cloud/storageinfo.h b/backends/cloud/storageinfo.h index 1492898a6c..e0666bc190 100644 --- a/backends/cloud/storageinfo.h +++ b/backends/cloud/storageinfo.h @@ -34,17 +34,17 @@ namespace Cloud { class StorageInfo { Common::String _uid, _name, _email; - uint32 _usedBytes, _allocatedBytes; + uint64 _usedBytes, _allocatedBytes; public: - StorageInfo(Common::String uid, Common::String name, Common::String email, uint32 used, uint32 allocated): + StorageInfo(Common::String uid, Common::String name, Common::String email, uint64 used, uint64 allocated): _uid(uid), _name(name), _email(email), _usedBytes(used), _allocatedBytes(allocated) {} Common::String uid() const { return _uid; } Common::String name() const { return _name; } Common::String email() const { return _email; } - uint32 used() const { return _usedBytes; } - uint32 available() const { return _allocatedBytes; } + uint64 used() const { return _usedBytes; } + uint64 available() const { return _allocatedBytes; } }; |