diff options
Diffstat (limited to 'Source/CursesDialog')
-rw-r--r-- | Source/CursesDialog/ccmake.cxx | 16 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesBoolWidget.h | 5 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesCacheEntryComposite.h | 5 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesColor.h | 5 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesDummyWidget.h | 5 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesFilePathWidget.h | 5 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesForm.h | 5 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesLabelWidget.h | 5 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesLongMessageForm.h | 5 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesMainForm.h | 5 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesOptionsWidget.h | 5 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesPathWidget.h | 5 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesStandardIncludes.h | 5 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesStringWidget.h | 5 | ||||
-rw-r--r-- | Source/CursesDialog/cmCursesWidget.h | 5 | ||||
-rw-r--r-- | Source/CursesDialog/form/CMakeLists.txt | 8 | ||||
-rw-r--r-- | Source/CursesDialog/form/frm_driver.c | 4 |
17 files changed, 38 insertions, 60 deletions
diff --git a/Source/CursesDialog/ccmake.cxx b/Source/CursesDialog/ccmake.cxx index 9a26db5..85e256b 100644 --- a/Source/CursesDialog/ccmake.cxx +++ b/Source/CursesDialog/ccmake.cxx @@ -2,11 +2,15 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include <csignal> +#include <cstdio> +#include <cstdlib> #include <cstring> #include <iostream> #include <string> #include <vector> +#include <unistd.h> + #include "cmsys/Encoding.hxx" #include "cmCursesColor.h" @@ -54,7 +58,12 @@ void onsig(int /*unused*/) { if (cmCursesForm::CurrentForm) { endwin(); - initscr(); /* Initialization */ + if (initscr() == nullptr) { + static const char errmsg[] = "Error: ncurses initialization failed\n"; + auto r = write(STDERR_FILENO, errmsg, sizeof(errmsg) - 1); + static_cast<void>(r); + exit(1); + } noecho(); /* Echo off */ cbreak(); /* nl- or cr not needed */ keypad(stdscr, true); /* Use key symbols as KEY_DOWN */ @@ -124,7 +133,10 @@ int main(int argc, char const* const* argv) cmCursesForm::DebugStart(); } - initscr(); /* Initialization */ + if (initscr() == nullptr) { + fprintf(stderr, "Error: ncurses initialization failed\n"); + exit(1); + } noecho(); /* Echo off */ cbreak(); /* nl- or cr not needed */ keypad(stdscr, true); /* Use key symbols as KEY_DOWN */ diff --git a/Source/CursesDialog/cmCursesBoolWidget.h b/Source/CursesDialog/cmCursesBoolWidget.h index 8c96256..746825b 100644 --- a/Source/CursesDialog/cmCursesBoolWidget.h +++ b/Source/CursesDialog/cmCursesBoolWidget.h @@ -1,7 +1,6 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cmCursesBoolWidget_h -#define cmCursesBoolWidget_h +#pragma once #include "cmConfigure.h" // IWYU pragma: keep @@ -29,5 +28,3 @@ public: void SetValueAsBool(bool value); bool GetValueAsBool(); }; - -#endif // cmCursesBoolWidget_h diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.h b/Source/CursesDialog/cmCursesCacheEntryComposite.h index a711363..d414918 100644 --- a/Source/CursesDialog/cmCursesCacheEntryComposite.h +++ b/Source/CursesDialog/cmCursesCacheEntryComposite.h @@ -1,7 +1,6 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cmCursesCacheEntryComposite_h -#define cmCursesCacheEntryComposite_h +#pragma once #include "cmConfigure.h" // IWYU pragma: keep @@ -41,5 +40,3 @@ protected: int LabelWidth; int EntryWidth; }; - -#endif // cmCursesCacheEntryComposite_h diff --git a/Source/CursesDialog/cmCursesColor.h b/Source/CursesDialog/cmCursesColor.h index f83265f..4e8a1e4 100644 --- a/Source/CursesDialog/cmCursesColor.h +++ b/Source/CursesDialog/cmCursesColor.h @@ -1,7 +1,6 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cmCursesColor_h -#define cmCursesColor_h +#pragma once class cmCursesColor { @@ -23,5 +22,3 @@ public: protected: static short GetColor(char id, short fallback); }; - -#endif // cmCursesColor_h diff --git a/Source/CursesDialog/cmCursesDummyWidget.h b/Source/CursesDialog/cmCursesDummyWidget.h index 07b7288..4347746 100644 --- a/Source/CursesDialog/cmCursesDummyWidget.h +++ b/Source/CursesDialog/cmCursesDummyWidget.h @@ -1,7 +1,6 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cmCursesDummyWidget_h -#define cmCursesDummyWidget_h +#pragma once #include "cmConfigure.h" // IWYU pragma: keep @@ -24,5 +23,3 @@ public: // handled. bool HandleInput(int& key, cmCursesMainForm* fm, WINDOW* w) override; }; - -#endif // cmCursesDummyWidget_h diff --git a/Source/CursesDialog/cmCursesFilePathWidget.h b/Source/CursesDialog/cmCursesFilePathWidget.h index 3f71259..2ae5d14 100644 --- a/Source/CursesDialog/cmCursesFilePathWidget.h +++ b/Source/CursesDialog/cmCursesFilePathWidget.h @@ -1,7 +1,6 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cmCursesFilePathWidget_h -#define cmCursesFilePathWidget_h +#pragma once #include "cmConfigure.h" // IWYU pragma: keep @@ -15,5 +14,3 @@ public: cmCursesFilePathWidget(cmCursesFilePathWidget const&) = delete; cmCursesFilePathWidget& operator=(cmCursesFilePathWidget const&) = delete; }; - -#endif // cmCursesFilePathWidget_h diff --git a/Source/CursesDialog/cmCursesForm.h b/Source/CursesDialog/cmCursesForm.h index e3626e6..93459b9 100644 --- a/Source/CursesDialog/cmCursesForm.h +++ b/Source/CursesDialog/cmCursesForm.h @@ -1,7 +1,6 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cmCursesForm_h -#define cmCursesForm_h +#pragma once #include "cmConfigure.h" // IWYU pragma: keep @@ -62,5 +61,3 @@ protected: FORM* Form; }; - -#endif // cmCursesForm_h diff --git a/Source/CursesDialog/cmCursesLabelWidget.h b/Source/CursesDialog/cmCursesLabelWidget.h index 9e75681..c10aa37 100644 --- a/Source/CursesDialog/cmCursesLabelWidget.h +++ b/Source/CursesDialog/cmCursesLabelWidget.h @@ -1,7 +1,6 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cmCursesLabelWidget_h -#define cmCursesLabelWidget_h +#pragma once #include "cmConfigure.h" // IWYU pragma: keep @@ -28,5 +27,3 @@ public: // handled bool HandleInput(int& key, cmCursesMainForm* fm, WINDOW* w) override; }; - -#endif // cmCursesLabelWidget_h diff --git a/Source/CursesDialog/cmCursesLongMessageForm.h b/Source/CursesDialog/cmCursesLongMessageForm.h index da9fea2..4f69cb1 100644 --- a/Source/CursesDialog/cmCursesLongMessageForm.h +++ b/Source/CursesDialog/cmCursesLongMessageForm.h @@ -1,7 +1,6 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cmCursesLongMessageForm_h -#define cmCursesLongMessageForm_h +#pragma once #include "cmConfigure.h" // IWYU pragma: keep @@ -59,5 +58,3 @@ protected: FIELD* Fields[2]; }; - -#endif // cmCursesLongMessageForm_h diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h index 2e06b90..c6db66f 100644 --- a/Source/CursesDialog/cmCursesMainForm.h +++ b/Source/CursesDialog/cmCursesMainForm.h @@ -1,7 +1,6 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cmCursesMainForm_h -#define cmCursesMainForm_h +#pragma once #include "cmConfigure.h" // IWYU pragma: keep @@ -170,5 +169,3 @@ protected: std::string OldSearchString; bool SearchMode; }; - -#endif // cmCursesMainForm_h diff --git a/Source/CursesDialog/cmCursesOptionsWidget.h b/Source/CursesDialog/cmCursesOptionsWidget.h index 0de8e64..cb06e4d 100644 --- a/Source/CursesDialog/cmCursesOptionsWidget.h +++ b/Source/CursesDialog/cmCursesOptionsWidget.h @@ -1,7 +1,6 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cmCursesOptionsWidget_h -#define cmCursesOptionsWidget_h +#pragma once #include "cmConfigure.h" // IWYU pragma: keep @@ -35,5 +34,3 @@ protected: std::vector<std::string> Options; std::vector<std::string>::size_type CurrentOption; }; - -#endif // cmCursesOptionsWidget_h diff --git a/Source/CursesDialog/cmCursesPathWidget.h b/Source/CursesDialog/cmCursesPathWidget.h index fb365e9..79e342e 100644 --- a/Source/CursesDialog/cmCursesPathWidget.h +++ b/Source/CursesDialog/cmCursesPathWidget.h @@ -1,7 +1,6 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cmCursesPathWidget_h -#define cmCursesPathWidget_h +#pragma once #include "cmConfigure.h" // IWYU pragma: keep @@ -34,5 +33,3 @@ protected: bool Cycle; std::string::size_type CurrentIndex; }; - -#endif // cmCursesPathWidget_h diff --git a/Source/CursesDialog/cmCursesStandardIncludes.h b/Source/CursesDialog/cmCursesStandardIncludes.h index 5b0ad58..9745b97 100644 --- a/Source/CursesDialog/cmCursesStandardIncludes.h +++ b/Source/CursesDialog/cmCursesStandardIncludes.h @@ -1,7 +1,6 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cmCursesStandardIncludes_h -#define cmCursesStandardIncludes_h +#pragma once #include "cmConfigure.h" // IWYU pragma: keep @@ -41,5 +40,3 @@ inline void curses_clear() # undef __attribute__ #endif #undef cm_no__attribute__ - -#endif // cmCursesStandardIncludes_h diff --git a/Source/CursesDialog/cmCursesStringWidget.h b/Source/CursesDialog/cmCursesStringWidget.h index ce06c6d..faa2ade 100644 --- a/Source/CursesDialog/cmCursesStringWidget.h +++ b/Source/CursesDialog/cmCursesStringWidget.h @@ -1,7 +1,6 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cmCursesStringWidget_h -#define cmCursesStringWidget_h +#pragma once #include "cmConfigure.h" // IWYU pragma: keep @@ -65,5 +64,3 @@ protected: std::string OriginalString; bool Done; }; - -#endif // cmCursesStringWidget_h diff --git a/Source/CursesDialog/cmCursesWidget.h b/Source/CursesDialog/cmCursesWidget.h index 9d03c6e..29ec28b 100644 --- a/Source/CursesDialog/cmCursesWidget.h +++ b/Source/CursesDialog/cmCursesWidget.h @@ -1,7 +1,6 @@ /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing for details. */ -#ifndef cmCursesWidget_h -#define cmCursesWidget_h +#pragma once #include "cmConfigure.h" // IWYU pragma: keep @@ -68,5 +67,3 @@ protected: // The page in the main form this widget is in int Page; }; - -#endif // cmCursesWidget_h diff --git a/Source/CursesDialog/form/CMakeLists.txt b/Source/CursesDialog/form/CMakeLists.txt index b468f5b..21c499e 100644 --- a/Source/CursesDialog/form/CMakeLists.txt +++ b/Source/CursesDialog/form/CMakeLists.txt @@ -3,6 +3,14 @@ project(CMAKE_FORM) +# Disable warnings to avoid changing 3rd party code. +if(CMAKE_C_COMPILER_ID MATCHES + "^(GNU|Clang|AppleClang|XLClang|XL|VisualAge|SunPro|HP|Intel)$") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w") +elseif(CMAKE_C_COMPILER_ID STREQUAL "PathScale") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -woffall") +endif() + configure_file(cmFormConfigure.h.in "${CMAKE_CURRENT_BINARY_DIR}/cmFormConfigure.h") add_library(cmForm diff --git a/Source/CursesDialog/form/frm_driver.c b/Source/CursesDialog/form/frm_driver.c index e4e72aa..112ab08 100644 --- a/Source/CursesDialog/form/frm_driver.c +++ b/Source/CursesDialog/form/frm_driver.c @@ -2983,7 +2983,7 @@ INLINE static FIELD *Right_Neighbour_Field(FIELD * field) | Function : static FIELD *Upper_Neighbour_Field(FIELD * field) | | Description : Because of the row-major nature of sorting the fields, -| its more difficult to define whats the upper neighbour +| its more difficult to define what's the upper neighbour | field really means. We define that it must be on a | 'previous' line (cyclic order!) and is the rightmost | field laying on the left side of the given field. If @@ -3030,7 +3030,7 @@ static FIELD *Upper_Neighbour_Field(FIELD * field) | Function : static FIELD *Down_Neighbour_Field(FIELD * field) | | Description : Because of the row-major nature of sorting the fields, -| its more difficult to define whats the down neighbour +| its more difficult to define what's the down neighbour | field really means. We define that it must be on a | 'next' line (cyclic order!) and is the leftmost | field laying on the right side of the given field. If |