Commit ecd0fc57 authored by Shashwat Jolly's avatar Shashwat Jolly
Browse files

Fix compiler warnings

- Declare unused parameters
- Fix comparison of signed and unsigned ints
parent 64f31f0e
...@@ -85,8 +85,8 @@ void EntriesFetchJob::fetchEntries() ...@@ -85,8 +85,8 @@ void EntriesFetchJob::fetchEntries()
qCDebug(ETESYNC_LOG) << "Retrieved item list length" << dataLength; qCDebug(ETESYNC_LOG) << "Retrieved item list length" << dataLength;
const EtebaseItem *etesyncItems[dataLength]; std::vector<const EtebaseItem *> etesyncItems(dataLength, nullptr);
if (etebase_item_list_response_get_data(itemList.get(), etesyncItems)) { if (etebase_item_list_response_get_data(itemList.get(), etesyncItems.data())) {
setError(int(etebase_error_get_code())); setError(int(etebase_error_get_code()));
const char *err = etebase_error_get_message(); const char *err = etebase_error_get_message();
setErrorText(QString::fromUtf8(err)); setErrorText(QString::fromUtf8(err));
...@@ -94,7 +94,7 @@ void EntriesFetchJob::fetchEntries() ...@@ -94,7 +94,7 @@ void EntriesFetchJob::fetchEntries()
Item item; Item item;
for (int i = 0; i < dataLength; i++) { for (uintptr_t i = 0; i < dataLength; i++) {
saveEtebaseItemCache(itemManager.get(), etesyncItems[i], mCacheDir); saveEtebaseItemCache(itemManager.get(), etesyncItems[i], mCacheDir);
setupItem(item, etesyncItems[i], type); setupItem(item, etesyncItems[i], type);
} }
......
...@@ -442,6 +442,8 @@ void EteSyncResource::itemAdded(const Akonadi::Item &item, const Akonadi::Collec ...@@ -442,6 +442,8 @@ void EteSyncResource::itemAdded(const Akonadi::Item &item, const Akonadi::Collec
void EteSyncResource::itemChanged(const Akonadi::Item &item, const QSet<QByteArray> &parts) void EteSyncResource::itemChanged(const Akonadi::Item &item, const QSet<QByteArray> &parts)
{ {
Q_UNUSED(parts)
qCDebug(ETESYNC_LOG) << "Item changed" << item.mimeType() << item.remoteId(); qCDebug(ETESYNC_LOG) << "Item changed" << item.mimeType() << item.remoteId();
qCDebug(ETESYNC_LOG) << "Journal UID" << item.parentCollection().remoteId(); qCDebug(ETESYNC_LOG) << "Journal UID" << item.parentCollection().remoteId();
...@@ -560,6 +562,8 @@ void EteSyncResource::itemRemoved(const Akonadi::Item &item) ...@@ -560,6 +562,8 @@ void EteSyncResource::itemRemoved(const Akonadi::Item &item)
void EteSyncResource::collectionAdded(const Akonadi::Collection &collection, const Akonadi::Collection &parent) void EteSyncResource::collectionAdded(const Akonadi::Collection &collection, const Akonadi::Collection &parent)
{ {
Q_UNUSED(parent)
qCDebug(ETESYNC_LOG) << "Collection added" << collection.mimeType(); qCDebug(ETESYNC_LOG) << "Collection added" << collection.mimeType();
if (credentialsRequired()) { if (credentialsRequired()) {
......
...@@ -73,8 +73,8 @@ void JournalsFetchJob::fetchJournals() ...@@ -73,8 +73,8 @@ void JournalsFetchJob::fetchJournals()
qCDebug(ETESYNC_LOG) << "Retrieved collection list length" << dataLength; qCDebug(ETESYNC_LOG) << "Retrieved collection list length" << dataLength;
const EtebaseCollection *etesyncCollections[dataLength]; std::vector<const EtebaseCollection *> etesyncCollections(dataLength, nullptr);
if (etebase_collection_list_response_get_data(collectionList.get(), etesyncCollections)) { if (etebase_collection_list_response_get_data(collectionList.get(), etesyncCollections.data())) {
setError(int(etebase_error_get_code())); setError(int(etebase_error_get_code()));
const char *err = etebase_error_get_message(); const char *err = etebase_error_get_message();
setErrorText(QString::fromUtf8(err)); setErrorText(QString::fromUtf8(err));
...@@ -82,20 +82,20 @@ void JournalsFetchJob::fetchJournals() ...@@ -82,20 +82,20 @@ void JournalsFetchJob::fetchJournals()
Collection collection; Collection collection;
for (int i = 0; i < dataLength; i++) { for (uintptr_t i = 0; i < dataLength; i++) {
saveEtebaseCollectionCache(collectionManager.get(), etesyncCollections[i], mCacheDir); saveEtebaseCollectionCache(collectionManager.get(), etesyncCollections[i], mCacheDir);
setupCollection(collection, etesyncCollections[i]); setupCollection(collection, etesyncCollections[i]);
} }
int removedCollectionsLength = etebase_collection_list_response_get_removed_memberships_length(collectionList.get()); uintptr_t removedCollectionsLength = etebase_collection_list_response_get_removed_memberships_length(collectionList.get());
if (removedCollectionsLength) { if (removedCollectionsLength) {
const EtebaseRemovedCollection *removedEtesyncCollections[removedCollectionsLength]; std::vector<const EtebaseRemovedCollection *> removedEtesyncCollections(removedCollectionsLength, nullptr);
if (etebase_collection_list_response_get_removed_memberships(collectionList.get(), removedEtesyncCollections)) { if (etebase_collection_list_response_get_removed_memberships(collectionList.get(), removedEtesyncCollections.data())) {
setError(int(etebase_error_get_code())); setError(int(etebase_error_get_code()));
const char *err = etebase_error_get_message(); const char *err = etebase_error_get_message();
setErrorText(QString::fromUtf8(err)); setErrorText(QString::fromUtf8(err));
} }
for (int i = 0; i < removedCollectionsLength; i++) { for (uintptr_t i = 0; i < removedCollectionsLength; i++) {
Collection collection; Collection collection;
const QString journalUid = QString::fromUtf8(etebase_removed_collection_get_uid(removedEtesyncCollections[i])); const QString journalUid = QString::fromUtf8(etebase_removed_collection_get_uid(removedEtesyncCollections[i]));
collection.setRemoteId(journalUid); collection.setRemoteId(journalUid);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment