From 7763b7ab173151aa01b017e1902e1de716f2a1ee Mon Sep 17 00:00:00 2001 From: Christian Blichmann Date: Thu, 20 Oct 2022 11:35:28 +0200 Subject: Include C++ standard headers When compiling in C++ mode, the C++ standard library headers should be included instead of their C counterparts. Drive-by: - Removed include of `json/json.h` from `settings.cpp`, where it was not used --- architecture.cpp | 2 +- binaryninjaapi.h | 2 +- examples/breakpoint/src/breakpoint.cpp | 4 ++-- examples/cmdline_disasm/src/disasm.cpp | 8 ++++---- examples/llil_parser/src/llil_parser.cpp | 4 ++-- examples/mlil_parser/src/mlil_parser.cpp | 4 ++-- examples/triage/headers.cpp | 2 +- examples/triage/imports.cpp | 2 +- examples/workflows/inliner/inliner.cpp | 1 - examples/workflows/tailcall/tailcall.cpp | 1 - examples/x86_extension/src/x86_extension.cpp | 6 +++--- http.cpp | 2 +- http.h | 4 ++-- interaction.cpp | 4 ++-- log.cpp | 4 ++-- lowlevelilinstruction.cpp | 2 +- mediumlevelilinstruction.cpp | 2 +- secretsprovider.cpp | 2 +- settings.cpp | 3 +-- type.cpp | 2 +- 20 files changed, 29 insertions(+), 32 deletions(-) diff --git a/architecture.cpp b/architecture.cpp index 273a69f0..ab12e3ed 100644 --- a/architecture.cpp +++ b/architecture.cpp @@ -19,7 +19,7 @@ // IN THE SOFTWARE. #define _CRT_SECURE_NO_WARNINGS -#include +#include #include #include #include diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 2809ee7b..0488803e 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -25,7 +25,7 @@ #endif #include #endif -#include +#include #include #include #include diff --git a/examples/breakpoint/src/breakpoint.cpp b/examples/breakpoint/src/breakpoint.cpp index 75156e1d..5cddb2a7 100644 --- a/examples/breakpoint/src/breakpoint.cpp +++ b/examples/breakpoint/src/breakpoint.cpp @@ -1,4 +1,4 @@ -#include +#include #include "binaryninjaapi.h" using namespace BinaryNinja; @@ -37,4 +37,4 @@ extern "C" "Convert to breakpoint", "Fill region with breakpoint instructions.", &write_breakpoint); return true; } -} \ No newline at end of file +} diff --git a/examples/cmdline_disasm/src/disasm.cpp b/examples/cmdline_disasm/src/disasm.cpp index 49d4d650..cd119dee 100644 --- a/examples/cmdline_disasm/src/disasm.cpp +++ b/examples/cmdline_disasm/src/disasm.cpp @@ -1,7 +1,7 @@ -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/examples/llil_parser/src/llil_parser.cpp b/examples/llil_parser/src/llil_parser.cpp index fcff0612..7566d4f1 100644 --- a/examples/llil_parser/src/llil_parser.cpp +++ b/examples/llil_parser/src/llil_parser.cpp @@ -1,5 +1,5 @@ -#include -#include +#include +#include #include "binaryninjacore.h" #include "binaryninjaapi.h" #include "lowlevelilinstruction.h" diff --git a/examples/mlil_parser/src/mlil_parser.cpp b/examples/mlil_parser/src/mlil_parser.cpp index 6122dbc7..941b0021 100644 --- a/examples/mlil_parser/src/mlil_parser.cpp +++ b/examples/mlil_parser/src/mlil_parser.cpp @@ -1,5 +1,5 @@ -#include -#include +#include +#include #include "binaryninjacore.h" #include "binaryninjaapi.h" #include "mediumlevelilinstruction.h" diff --git a/examples/triage/headers.cpp b/examples/triage/headers.cpp index 1bd9d732..40775b61 100644 --- a/examples/triage/headers.cpp +++ b/examples/triage/headers.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include "headers.h" #include "fontsettings.h" diff --git a/examples/triage/imports.cpp b/examples/triage/imports.cpp index 9102ba27..aa3b18b7 100644 --- a/examples/triage/imports.cpp +++ b/examples/triage/imports.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include "imports.h" #include "view.h" diff --git a/examples/workflows/inliner/inliner.cpp b/examples/workflows/inliner/inliner.cpp index da54fbc2..26928931 100644 --- a/examples/workflows/inliner/inliner.cpp +++ b/examples/workflows/inliner/inliner.cpp @@ -1,5 +1,4 @@ #define _CRT_SECURE_NO_WARNINGS -#define NOMINMAX #include #include diff --git a/examples/workflows/tailcall/tailcall.cpp b/examples/workflows/tailcall/tailcall.cpp index 01190987..85414479 100644 --- a/examples/workflows/tailcall/tailcall.cpp +++ b/examples/workflows/tailcall/tailcall.cpp @@ -1,5 +1,4 @@ #define _CRT_SECURE_NO_WARNINGS -#define NOMINMAX #include #include diff --git a/examples/x86_extension/src/x86_extension.cpp b/examples/x86_extension/src/x86_extension.cpp index 80043287..50552cb0 100644 --- a/examples/x86_extension/src/x86_extension.cpp +++ b/examples/x86_extension/src/x86_extension.cpp @@ -1,7 +1,7 @@ #define _CRT_SECURE_NO_WARNINGS -#include -#include -#include +#include +#include +#include #include "binaryninjaapi.h" #include "asmx86/asmx86.h" diff --git a/http.cpp b/http.cpp index 08bdc275..f1b5d100 100644 --- a/http.cpp +++ b/http.cpp @@ -18,7 +18,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. -#include +#include #include #include #include diff --git a/http.h b/http.h index da9cbeb2..b9ffd64d 100644 --- a/http.h +++ b/http.h @@ -26,7 +26,7 @@ #include #include #include -#include +#include #ifdef BINARYNINJACORE_LIBRARY #include "downloadprovider.h" @@ -366,4 +366,4 @@ namespace BinaryNinja::Http #undef _STD_SET #undef _STD_UNORDERED_MAP #undef _STD_MAP -} // namespace BinaryNinjaCore::Http \ No newline at end of file +} // namespace BinaryNinjaCore::Http diff --git a/interaction.cpp b/interaction.cpp index 8bfe4495..7bc1d2fa 100644 --- a/interaction.cpp +++ b/interaction.cpp @@ -1,5 +1,5 @@ -#include -#include +#include +#include #include "binaryninjaapi.h" using namespace std; diff --git a/log.cpp b/log.cpp index 02fea502..0c0b9098 100644 --- a/log.cpp +++ b/log.cpp @@ -19,8 +19,8 @@ // IN THE SOFTWARE. #define _CRT_SECURE_NO_WARNINGS -#include -#include +#include +#include #include #include "binaryninjaapi.h" diff --git a/lowlevelilinstruction.cpp b/lowlevelilinstruction.cpp index b7277831..6325f0a6 100644 --- a/lowlevelilinstruction.cpp +++ b/lowlevelilinstruction.cpp @@ -18,7 +18,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. -#include +#include #ifdef BINARYNINJACORE_LIBRARY #include "lowlevelilfunction.h" #include "lowlevelilssafunction.h" diff --git a/mediumlevelilinstruction.cpp b/mediumlevelilinstruction.cpp index 49a5eed9..33b2c327 100644 --- a/mediumlevelilinstruction.cpp +++ b/mediumlevelilinstruction.cpp @@ -18,7 +18,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. -#include +#include #ifdef BINARYNINJACORE_LIBRARY #include "mediumlevelilfunction.h" #include "mediumlevelilssafunction.h" diff --git a/secretsprovider.cpp b/secretsprovider.cpp index b84113ff..bd2bb88b 100644 --- a/secretsprovider.cpp +++ b/secretsprovider.cpp @@ -19,7 +19,7 @@ // IN THE SOFTWARE. #include "binaryninjaapi.h" -#include +#include using namespace BinaryNinja; diff --git a/settings.cpp b/settings.cpp index d3c80952..59394c42 100644 --- a/settings.cpp +++ b/settings.cpp @@ -1,6 +1,5 @@ #include "binaryninjaapi.h" -#include "json/json.h" -#include +#include using namespace BinaryNinja; using namespace std; diff --git a/type.cpp b/type.cpp index 910c314b..6e1300b0 100644 --- a/type.cpp +++ b/type.cpp @@ -19,7 +19,7 @@ // IN THE SOFTWARE. #include "binaryninjaapi.h" -#include +#include using namespace BinaryNinja; using namespace std; -- cgit v1.3.1