diff options
| author | Christian Blichmann <cblichmann@google.com> | 2022-10-20 11:35:28 +0200 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2022-11-10 16:20:26 -0500 |
| commit | 7763b7ab173151aa01b017e1902e1de716f2a1ee (patch) | |
| tree | 85d0a872c3dfacceb9b655d90d1888d30f246603 | |
| parent | a46fea09fd927e165781d8936aa53e8bea69a78a (diff) | |
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
| -rw-r--r-- | architecture.cpp | 2 | ||||
| -rw-r--r-- | binaryninjaapi.h | 2 | ||||
| -rw-r--r-- | examples/breakpoint/src/breakpoint.cpp | 4 | ||||
| -rw-r--r-- | examples/cmdline_disasm/src/disasm.cpp | 8 | ||||
| -rw-r--r-- | examples/llil_parser/src/llil_parser.cpp | 4 | ||||
| -rw-r--r-- | examples/mlil_parser/src/mlil_parser.cpp | 4 | ||||
| -rw-r--r-- | examples/triage/headers.cpp | 2 | ||||
| -rw-r--r-- | examples/triage/imports.cpp | 2 | ||||
| -rw-r--r-- | examples/workflows/inliner/inliner.cpp | 1 | ||||
| -rw-r--r-- | examples/workflows/tailcall/tailcall.cpp | 1 | ||||
| -rw-r--r-- | examples/x86_extension/src/x86_extension.cpp | 6 | ||||
| -rw-r--r-- | http.cpp | 2 | ||||
| -rw-r--r-- | http.h | 4 | ||||
| -rw-r--r-- | interaction.cpp | 4 | ||||
| -rw-r--r-- | log.cpp | 4 | ||||
| -rw-r--r-- | lowlevelilinstruction.cpp | 2 | ||||
| -rw-r--r-- | mediumlevelilinstruction.cpp | 2 | ||||
| -rw-r--r-- | secretsprovider.cpp | 2 | ||||
| -rw-r--r-- | settings.cpp | 3 | ||||
| -rw-r--r-- | 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 <stdio.h> +#include <cstdio> #include <cstdint> #include <inttypes.h> #include <vector> diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 2809ee7b..0488803e 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -25,7 +25,7 @@ #endif #include <windows.h> #endif -#include <stddef.h> +#include <cstddef> #include <string> #include <vector> #include <map> 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 <inttypes.h> +#include <cinttypes> #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 <stdio.h> -#include <stdlib.h> -#include <stdint.h> -#include <stdbool.h> +#include <cstdio> +#include <cstdlib> +#include <cstdint> +#include <cstdbool> #include <sys/types.h> #include <sys/stat.h> 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 <stdio.h> -#include <inttypes.h> +#include <cstdio> +#include <cinttypes> #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 <stdio.h> -#include <inttypes.h> +#include <cstdio> +#include <cinttypes> #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 <string.h> +#include <cstring> #include <time.h> #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 <string.h> +#include <cstring> #include <algorithm> #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 <cinttypes> #include <cstdint> 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 <cinttypes> #include <cstdint> 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 <inttypes.h> -#include <stdio.h> -#include <string.h> +#include <cinttypes> +#include <cstdio> +#include <cstring> #include "binaryninjaapi.h" #include "asmx86/asmx86.h" @@ -18,7 +18,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS // IN THE SOFTWARE. -#include <string.h> +#include <cstring> #include <chrono> #include <thread> #include <math.h> @@ -26,7 +26,7 @@ #include <unordered_map> #include <functional> #include <utility> -#include <stdint.h> +#include <cstdint> #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 <stdlib.h> -#include <string.h> +#include <cstdlib> +#include <cstring> #include "binaryninjaapi.h" using namespace std; @@ -19,8 +19,8 @@ // IN THE SOFTWARE. #define _CRT_SECURE_NO_WARNINGS -#include <stdarg.h> -#include <stdio.h> +#include <cstdarg> +#include <cstdio> #include <thread> #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 <string.h> +#include <cstring> #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 <string.h> +#include <cstring> #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 <string.h> +#include <cstring> 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 <string.h> +#include <cstring> using namespace BinaryNinja; using namespace std; @@ -19,7 +19,7 @@ // IN THE SOFTWARE. #include "binaryninjaapi.h" -#include <inttypes.h> +#include <cinttypes> using namespace BinaryNinja; using namespace std; |
