remove variables set but never read
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Thu, 28 Jul 2022 12:11:06 +0000 (14:11 +0200)
committerClaudio Cambra <claudio.cambra@gmail.com>
Tue, 2 Aug 2022 14:28:50 +0000 (16:28 +0200)
will fix a clang compilation error

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/gui/sharelinkwidget.cpp
src/libsync/clientsideencryption.cpp

index 09186e9723d9ce53c4408d441953fbed69aa36aa..cc3a0952ce2872a75a96781fc12c3e4d36b7c4f7 100644 (file)
@@ -82,13 +82,10 @@ ShareLinkWidget::ShareLinkWidget(AccountPtr account,
 
     _ui->errorLabel->hide();
 
-    auto sharingPossible = true;
     if (!_account->capabilities().sharePublicLink()) {
         qCWarning(lcShareLink) << "Link shares have been disabled";
-        sharingPossible = false;
     } else if (!(maxSharingPermissions & SharePermissionShare)) {
         qCWarning(lcShareLink) << "The file can not be shared because it was shared without sharing permission.";
-        sharingPossible = false;
     }
 
     _ui->enableShareLink->setChecked(false);
index 7a923e490e4649e7cb726dba98120a9a611a6792..3a75707f5b4daa4b84019ea0aa4a2fdf5c8df324 100644 (file)
@@ -1656,7 +1656,6 @@ bool EncryptionHelper::fileEncryption(const QByteArray &key, const QByteArray &i
 
     QByteArray out(blockSize + OCC::Constants::e2EeTagSize - 1, '\0');
     int len = 0;
-    int total_len = 0;
 
     qCDebug(lcCse) << "Starting to encrypt the file" << input->fileName() << input->atEnd();
     while(!input->atEnd()) {
@@ -1673,7 +1672,6 @@ bool EncryptionHelper::fileEncryption(const QByteArray &key, const QByteArray &i
         }
 
         output->write(out, len);
-        total_len += len;
     }
 
     if(1 != EVP_EncryptFinal_ex(ctx, unsignedData(out), &len)) {
@@ -1681,7 +1679,6 @@ bool EncryptionHelper::fileEncryption(const QByteArray &key, const QByteArray &i
         return false;
     }
     output->write(out, len);
-    total_len += len;
 
     /* Get the e2EeTag */
     QByteArray e2EeTag(OCC::Constants::e2EeTagSize, '\0');
@@ -1865,7 +1862,6 @@ QByteArray EncryptionHelper::StreamingDecryptor::chunkDecryption(const char *inp
         return QByteArray();
     }
 
-    qint64 bytesWritten = 0;
     qint64 inputPos = 0;
 
     QByteArray decryptedBlock(blockSize + OCC::Constants::e2EeTagSize - 1, '\0');
@@ -1894,8 +1890,6 @@ QByteArray EncryptionHelper::StreamingDecryptor::chunkDecryption(const char *inp
             return QByteArray();
         }
 
-        bytesWritten += writtenToOutput;
-
         // advance input position for further read
         inputPos += encryptedBlock.size();
 
@@ -1934,8 +1928,6 @@ QByteArray EncryptionHelper::StreamingDecryptor::chunkDecryption(const char *inp
             return QByteArray();
         }
 
-        bytesWritten += writtenToOutput;
-
         _decryptedSoFar += OCC::Constants::e2EeTagSize;
 
         _isFinished = true;