mirror of
https://github.com/winscp/winscp.git
synced 2026-10-24 02:28:55 +03:00
Minor code errors identified by Clang (2nd after 4019b56f)
Source commit: 904310464d998d3b8f222598c0b7914e6cb7deee
This commit is contained in:
@@ -70,7 +70,7 @@ public:
|
||||
unsigned long WaitResult = WaitForSingleObject(AMutex, Timeout);
|
||||
if (WaitResult == WAIT_TIMEOUT)
|
||||
{
|
||||
throw Exception(LoadStr(MUTEX_RELEASE_TIMEOUT));
|
||||
throw Exception(LoadStr(Message));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3573,7 +3573,7 @@ void __fastcall TCustomScpExplorerForm::AnyInternalEditorModified(
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TCustomScpExplorerForm::LocalEditorClosed(TObject * Sender, bool /*Forced*/)
|
||||
{
|
||||
DebugCheck(FLocalEditors->Extract(Sender) >= 0);
|
||||
DebugCheck(FLocalEditors->Extract(Sender) != NULL);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TCustomScpExplorerForm::TemporaryDirectoryForRemoteFiles(
|
||||
@@ -11934,10 +11934,10 @@ void __fastcall TCustomScpExplorerForm::UpdateQueueFileList()
|
||||
}
|
||||
else
|
||||
{
|
||||
if (FQueueFileList->GetCount() > 0)
|
||||
Refresh = (FQueueFileList->GetCount() > 0);
|
||||
if (Refresh)
|
||||
{
|
||||
FQueueFileList->Clear();
|
||||
Refresh = true;
|
||||
}
|
||||
}
|
||||
int Count = FQueueFileList->GetCount();
|
||||
@@ -12024,11 +12024,6 @@ bool TCustomScpExplorerForm::IsAvailableTerminal(TTerminal * Terminal)
|
||||
return TTerminalManager::Instance()->IsAvailableTerminal(Terminal);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
bool __fastcall TCustomScpExplorerForm::HasManagedSession()
|
||||
{
|
||||
return (ManagedSession != NULL);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
bool TCustomScpExplorerForm::HasAvailableTerminal()
|
||||
{
|
||||
return IsAvailableTerminal(Terminal);
|
||||
|
||||
@@ -805,7 +805,6 @@ public:
|
||||
void __fastcall SuspendWindowLock();
|
||||
void __fastcall ResumeWindowLock();
|
||||
bool HasAvailableTerminal();
|
||||
bool __fastcall HasManagedSession();
|
||||
virtual bool IsLocalBrowserMode();
|
||||
bool CanCloseSession(TManagedTerminal * Session);
|
||||
virtual UnicodeString __fastcall DefaultDownloadTargetDirectory() = 0;
|
||||
|
||||
@@ -204,7 +204,7 @@ UnicodeString __fastcall TGenerateUrlDialog::GenerateUrl(UnicodeString Path)
|
||||
if ((RemoteDirectoryCheck->Enabled && RemoteDirectoryCheck->Checked) ||
|
||||
IsFileUrl())
|
||||
{
|
||||
if (StartsStr(L"/", Path));
|
||||
if (StartsStr(L"/", Path))
|
||||
{
|
||||
Path.Delete(1, 1);
|
||||
}
|
||||
|
||||
@@ -492,7 +492,7 @@ void __fastcall TLoginDialog::Default()
|
||||
//---------------------------------------------------------------------
|
||||
void __fastcall TLoginDialog::LoadContents()
|
||||
{
|
||||
bool UseContentsPanel;
|
||||
bool UseContentsPanel = false;
|
||||
TTreeNode * Node = SessionTree->Selected;
|
||||
if (IsSessionNode(Node))
|
||||
{
|
||||
|
||||
@@ -915,8 +915,8 @@ TForm * __fastcall TMessageForm::Create(const UnicodeString & Msg,
|
||||
if (GroupWith >= 0)
|
||||
{
|
||||
if (DebugAlwaysFalse(GroupWith >= static_cast<int>(Answer)) ||
|
||||
DebugAlwaysFalse(Answer == TimeoutAnswer) &&
|
||||
DebugAlwaysFalse(Answer == DefaultAnswer) &&
|
||||
DebugAlwaysFalse(Answer == TimeoutAnswer) ||
|
||||
DebugAlwaysFalse(Answer == DefaultAnswer) ||
|
||||
DebugAlwaysFalse(Answer == CancelAnswer))
|
||||
{
|
||||
GroupWith = -1;
|
||||
@@ -1015,7 +1015,7 @@ TForm * __fastcall TMessageForm::Create(const UnicodeString & Msg,
|
||||
int MaxTextWidth = ScaleByTextHeightRunTime(Result, mcMaxDialogWidth);
|
||||
// If the message contains SHA-256 hex fingerprint (CERT_TEXT2 on TLS/SSL certificate verification dialog),
|
||||
// allow wider box to fit it
|
||||
if (TRegEx::IsMatch(Msg, L"([0-9a-fA-F]{2}[:\-]){31}[0-9a-fA-F]{2}"))
|
||||
if (TRegEx::IsMatch(Msg, L"([0-9a-fA-F]{2}[:\\-]){31}[0-9a-fA-F]{2}"))
|
||||
{
|
||||
MaxTextWidth = MaxTextWidth * 3 / 2;
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ void __fastcall TNonVisualDataModule::ExplorerActionsUpdate(
|
||||
}
|
||||
void * AuxVoidPtr;
|
||||
int AuxInt;
|
||||
#define HasManagedSession ScpExplorer->HasManagedSession()
|
||||
#define HasManagedSession (ScpExplorer->ManagedSession != NULL)
|
||||
#define HasTerminal ScpExplorer->HasAvailableTerminal()
|
||||
// CURRENT DIRVIEW
|
||||
#define EnabledSelectedOperation (ScpExplorer->EnableSelectedOperation[osCurrent])
|
||||
|
||||
@@ -1055,8 +1055,8 @@ void __fastcall TSiteAdvancedDialog::UpdateControls()
|
||||
// environment/recycle bin sheet
|
||||
EnableControl(OverwrittenToRecycleBinCheck, SftpProtocol && RecycleBinSheet->Enabled);
|
||||
EnableControl(RecycleBinPathEdit,
|
||||
(DeleteToRecycleBinCheck->Enabled && DeleteToRecycleBinCheck->Checked) ||
|
||||
(OverwrittenToRecycleBinCheck->Enabled && OverwrittenToRecycleBinCheck->Checked) &&
|
||||
((DeleteToRecycleBinCheck->Enabled && DeleteToRecycleBinCheck->Checked) ||
|
||||
(OverwrittenToRecycleBinCheck->Enabled && OverwrittenToRecycleBinCheck->Checked)) &&
|
||||
RecycleBinSheet->Enabled);
|
||||
EnableControl(RecycleBinPathLabel, RecycleBinPathEdit->Enabled &&
|
||||
RecycleBinSheet->Enabled);
|
||||
|
||||
@@ -208,7 +208,7 @@ struct TMoveActionData
|
||||
if (CollectFileList)
|
||||
{
|
||||
UnicodeString FileName;
|
||||
TObject * Object;
|
||||
TObject * Object = NULL;
|
||||
if (Action == TSynchronizeChecklist::saDeleteRemote)
|
||||
{
|
||||
FileName = ChecklistItem->GetRemotePath();
|
||||
|
||||
@@ -240,7 +240,7 @@ UnicodeString __fastcall TEditorPreferences::GetName() const
|
||||
FName.SetLength(P - 1);
|
||||
}
|
||||
|
||||
if (FName.ByteType(1) == mbSingleByte)
|
||||
if (FName.ByteType(1) == UnicodeString::ctNotLeadChar)
|
||||
{
|
||||
if (FName.UpperCase() == FName)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user