Răsfoiți Sursa

Compiler warnings discovered by build server

Source commit: 3a3e2b040db3bae9377e34ddf81cab612ee07604
Martin Prikryl 9 ani în urmă
părinte
comite
f2ce5adc98

+ 1 - 1
source/core/HierarchicalStorage.cpp

@@ -1087,7 +1087,7 @@ size_t __fastcall TCustomIniFileStorage::ReadBinaryData(const UnicodeString Name
   size_t Len;
   size_t Len;
   if (HandleReadByMasterStorage(Name))
   if (HandleReadByMasterStorage(Name))
   {
   {
-    Len = FMasterStorage->ReadBinaryData(Name, Buffer, Size);
+    FMasterStorage->ReadBinaryData(Name, Buffer, Size);
   }
   }
   else
   else
   {
   {

+ 2 - 0
source/core/Terminal.cpp

@@ -4113,6 +4113,7 @@ void __fastcall TTerminal::AnyCommand(const UnicodeString Command,
   TCaptureOutputEvent OutputEvent)
   TCaptureOutputEvent OutputEvent)
 {
 {
 
 
+  #pragma warn -inl
   class TOutputProxy
   class TOutputProxy
   {
   {
   public:
   public:
@@ -4147,6 +4148,7 @@ void __fastcall TTerminal::AnyCommand(const UnicodeString Command,
     TCallSessionAction & FAction;
     TCallSessionAction & FAction;
     TCaptureOutputEvent FOutputEvent;
     TCaptureOutputEvent FOutputEvent;
   };
   };
+  #pragma warn .inl
 
 
   TCallSessionAction Action(ActionLog, Command, CurrentDirectory);
   TCallSessionAction Action(ActionLog, Command, CurrentDirectory);
   TOutputProxy ProxyOutputEvent(Action, OutputEvent);
   TOutputProxy ProxyOutputEvent(Action, OutputEvent);

+ 0 - 2
source/forms/Authenticate.cpp

@@ -154,7 +154,6 @@ void __fastcall TAuthenticateForm::Log(const UnicodeString Message)
 //---------------------------------------------------------------------------
 //---------------------------------------------------------------------------
 void __fastcall TAuthenticateForm::MakeLogItemVisible(int Index)
 void __fastcall TAuthenticateForm::MakeLogItemVisible(int Index)
 {
 {
-  int CountVisible = LogView->Height / LogView->ItemHeight;
   if (Index < LogView->TopIndex)
   if (Index < LogView->TopIndex)
   {
   {
     LogView->TopIndex = Index;
     LogView->TopIndex = Index;
@@ -534,7 +533,6 @@ void __fastcall TAuthenticateForm::LogViewDrawItem(TWinControl * /*Control*/, in
 
 
   LogView->Canvas->FillRect(Rect);
   LogView->Canvas->FillRect(Rect);
 
 
-  int Height = LogItemHeight(Index);
   // tfVerticalCenter does not seem to center the text,
   // tfVerticalCenter does not seem to center the text,
   // so we need to deflate the vertical size too
   // so we need to deflate the vertical size too
   Rect.Inflate(-FHorizontalLogPadding,  -FVerticalLogPadding);
   Rect.Inflate(-FHorizontalLogPadding,  -FVerticalLogPadding);

+ 1 - 2
source/forms/NonVisual.cpp

@@ -1168,8 +1168,7 @@ void __fastcall TNonVisualDataModule::UpdateCustomCommandsToolbarList(TTBXToolba
   for (int CommandIndex = 0; CommandIndex < List->Count; CommandIndex++, Index++)
   for (int CommandIndex = 0; CommandIndex < List->Count; CommandIndex++, Index++)
   {
   {
     TTBCustomItem * Item = Toolbar->Items->Items[Index];
     TTBCustomItem * Item = Toolbar->Items->Items[Index];
-    int CommandIndex2 = (Item->Tag & CustomCommandIndexMask);
-    DebugAssert(CommandIndex2 == CommandIndex);
+    DebugAssert((Item->Tag & CustomCommandIndexMask) == CommandIndex);
     int State = ScpExplorer->CustomCommandState(*List->Commands[CommandIndex], false, ccltAll);
     int State = ScpExplorer->CustomCommandState(*List->Commands[CommandIndex], false, ccltAll);
     DebugAssert(State >= 0);
     DebugAssert(State >= 0);
     Item->Enabled = (State > 0);
     Item->Enabled = (State > 0);

+ 0 - 1
source/forms/Preferences.cpp

@@ -1126,7 +1126,6 @@ void __fastcall TPreferencesDialog::UpdateControls()
     int CommandIndex = GetCommandIndex(CustomCommandsView->ItemIndex);
     int CommandIndex = GetCommandIndex(CustomCommandsView->ItemIndex);
     bool CommandSelected = (CustomCommandsView->Selected != NULL);
     bool CommandSelected = (CustomCommandsView->Selected != NULL);
     bool CustomCommandSelected = CommandSelected && (CommandList == FCustomCommandList);
     bool CustomCommandSelected = CommandSelected && (CommandList == FCustomCommandList);
-    bool ExtensionSelected = CommandSelected && (CommandList == FExtensionList);
     EnableControl(EditCommandButton, CustomCommandSelected);
     EnableControl(EditCommandButton, CustomCommandSelected);
     EnableControl(RemoveCommandButton, CommandSelected);
     EnableControl(RemoveCommandButton, CommandSelected);
     EnableControl(UpCommandButton, CommandSelected && (CommandIndex > 0));
     EnableControl(UpCommandButton, CommandSelected && (CommandIndex > 0));

+ 0 - 1
source/forms/Progress.cpp

@@ -350,7 +350,6 @@ void __fastcall TProgressForm::ApplicationModalBegin(TObject * /*Sender*/)
 //---------------------------------------------------------------------
 //---------------------------------------------------------------------
 void __fastcall TProgressForm::SetProgressData(TFileOperationProgressType & AData)
 void __fastcall TProgressForm::SetProgressData(TFileOperationProgressType & AData)
 {
 {
-  TDateTime N = Now();
   bool InstantUpdate = false;
   bool InstantUpdate = false;
 
 
   // workaround: to force displaing first file data immediately,
   // workaround: to force displaing first file data immediately,

+ 1 - 1
source/windows/WinConfiguration.cpp

@@ -2804,7 +2804,7 @@ void __fastcall TCustomCommandType::LoadExtension(TStrings * Lines)
             UnicodeString DependencyVersion = Value;
             UnicodeString DependencyVersion = Value;
             UnicodeString Dependency = CutToChar(Value, L' ', true).LowerCase();
             UnicodeString Dependency = CutToChar(Value, L' ', true).LowerCase();
             Value = Value.Trim();
             Value = Value.Trim();
-            bool Failed = false;
+            bool Failed;
             if (Dependency == L"winscp")
             if (Dependency == L"winscp")
             {
             {
               int Version = StrToCompoundVersion(Value);
               int Version = StrToCompoundVersion(Value);