diff --git a/adb/adb.cpp b/adb/adb.cpp index 06e4c50859..2909c3c884 100644 --- a/adb/adb.cpp +++ b/adb/adb.cpp @@ -44,8 +44,6 @@ #include #include #include -#include -#include #include "adb_auth.h" #include "adb_io.h" @@ -66,10 +64,10 @@ std::string adb_version() { // Don't change the format of this --- it's parsed by ddmlib. return android::base::StringPrintf( "Android Debug Bridge version %d.%d.%d\n" - "Version %s-%s\n" + "Version %s\n" "Installed as %s\n", ADB_VERSION_MAJOR, ADB_VERSION_MINOR, ADB_SERVER_VERSION, - PLATFORM_TOOLS_VERSION, android::build::GetBuildNumber().c_str(), + PLATFORM_TOOLS_VERSION, android::base::GetExecutablePath().c_str()); } diff --git a/adb/client/usb_libusb.cpp b/adb/client/usb_libusb.cpp index f2ca63ba3c..95b27c998b 100644 --- a/adb/client/usb_libusb.cpp +++ b/adb/client/usb_libusb.cpp @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -30,7 +31,7 @@ #include #include -#include +#include #include #include diff --git a/adb/sysdeps/posix/network.cpp b/adb/sysdeps/posix/network.cpp index 33ddb4e816..e604a759e2 100644 --- a/adb/sysdeps/posix/network.cpp +++ b/adb/sysdeps/posix/network.cpp @@ -16,6 +16,7 @@ #include "sysdeps/network.h" +#include #include #include #include diff --git a/adb/types.h b/adb/types.h index 0090c98782..6920af4d6a 100644 --- a/adb/types.h +++ b/adb/types.h @@ -22,6 +22,7 @@ #include #include #include +#include #include diff --git a/base/errors_unix.cpp b/base/errors_unix.cpp index 296995efe2..48269b6750 100644 --- a/base/errors_unix.cpp +++ b/base/errors_unix.cpp @@ -17,6 +17,7 @@ #include "android-base/errors.h" #include +#include namespace android { namespace base { diff --git a/base/file.cpp b/base/file.cpp index 2f4a517589..9049216913 100644 --- a/base/file.cpp +++ b/base/file.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include diff --git a/base/logging.cpp b/base/logging.cpp index f89168c0fc..da522019dc 100644 --- a/base/logging.cpp +++ b/base/logging.cpp @@ -24,6 +24,7 @@ #include #include #include +#include // For getprogname(3) or program_invocation_short_name. #if defined(__ANDROID__) || defined(__APPLE__) diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp index d753f0f822..a8987d3024 100644 --- a/fastboot/fastboot.cpp +++ b/fastboot/fastboot.cpp @@ -58,9 +58,7 @@ #include #include #include -#include #include -#include #include #include @@ -1655,7 +1653,7 @@ int FastBootTool::Main(int argc, char* argv[]) { setvbuf(stdout, nullptr, _IONBF, 0); setvbuf(stderr, nullptr, _IONBF, 0); } else if (name == "version") { - fprintf(stdout, "fastboot version %s-%s\n", PLATFORM_TOOLS_VERSION, android::build::GetBuildNumber().c_str()); + fprintf(stdout, "fastboot version %s\n", PLATFORM_TOOLS_VERSION); fprintf(stdout, "Installed as %s\n", android::base::GetExecutablePath().c_str()); return 0; #if !defined(_WIN32) diff --git a/fs_mgr/liblp/reader.cpp b/fs_mgr/liblp/reader.cpp index dcee6d2d86..df7c26d8be 100644 --- a/fs_mgr/liblp/reader.cpp +++ b/fs_mgr/liblp/reader.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include diff --git a/fs_mgr/liblp/writer.cpp b/fs_mgr/liblp/writer.cpp index bffcb7e6e1..66f447df96 100644 --- a/fs_mgr/liblp/writer.cpp +++ b/fs_mgr/liblp/writer.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -32,7 +33,7 @@ namespace fs_mgr { std::string SerializeGeometry(const LpMetadataGeometry& input) { LpMetadataGeometry geometry = input; - memset(geometry.checksum, 0, sizeof(geometry.checksum)); + std::memset(geometry.checksum, 0, sizeof(geometry.checksum)); SHA256(&geometry, sizeof(geometry), geometry.checksum); std::string blob(reinterpret_cast(&geometry), sizeof(geometry)); @@ -72,7 +73,7 @@ std::string SerializeMetadata(const LpMetadata& input) { SHA256(tables.data(), tables.size(), header.tables_checksum); // Compute header checksum. - memset(header.header_checksum, 0, sizeof(header.header_checksum)); + std::memset(header.header_checksum, 0, sizeof(header.header_checksum)); SHA256(&header, sizeof(header), header.header_checksum); std::string header_blob = diff --git a/liblog/logger_write.cpp b/liblog/logger_write.cpp index af8cb2d24a..8ae3257acd 100644 --- a/liblog/logger_write.cpp +++ b/liblog/logger_write.cpp @@ -15,7 +15,7 @@ */ #include -#include +#include /* https://reviews.llvm.org/D45470 */ #include #include #include