From e1930985430ce289f4fe8525f51050e5d78cc44e Mon Sep 17 00:00:00 2001 From: "ted.mielczarek" Date: Fri, 25 Jun 2010 16:57:07 +0000 Subject: Breakpad: Avoid using the C++ headers. This patch avoids unnecessary use of the headers in files that don't actually use the identifiers they declare in the std:: namespace. It also changes some files to better conform with the "Names and Order of Includes" rules in the Google C++ Style Guide. A=jimb R=mark git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@619 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/common/dwarf/bytereader-inl.h | 4 ++-- src/common/dwarf/cfi_assembler.cc | 6 +++--- src/common/dwarf/dwarf2diehandler.cc | 4 ++-- src/common/dwarf/dwarf2reader.cc | 10 ++++++---- src/common/dwarf/dwarf2reader_cfi_unittest.cc | 9 +++++---- src/common/dwarf_cfi_to_module.h | 3 ++- src/common/dwarf_cu_to_module.cc | 6 ++++-- src/common/linux/dump_symbols.cc | 13 +++++++------ src/common/linux/dump_symbols.h | 3 ++- src/common/linux/file_id.cc | 9 +++++---- src/common/linux/guid_creator.cc | 12 ++++++------ src/common/linux/http_upload.cc | 6 +++--- src/common/linux/libcurl_wrapper.h | 3 ++- src/common/module.cc | 6 +++--- src/common/module.h | 3 ++- src/common/module_unittest.cc | 8 ++++---- src/common/test_assembler.cc | 4 ++-- 17 files changed, 60 insertions(+), 49 deletions(-) (limited to 'src/common') diff --git a/src/common/dwarf/bytereader-inl.h b/src/common/dwarf/bytereader-inl.h index 57fce448..3c167089 100644 --- a/src/common/dwarf/bytereader-inl.h +++ b/src/common/dwarf/bytereader-inl.h @@ -29,10 +29,10 @@ #ifndef UTIL_DEBUGINFO_BYTEREADER_INL_H__ #define UTIL_DEBUGINFO_BYTEREADER_INL_H__ -#include - #include "common/dwarf/bytereader.h" +#include + namespace dwarf2reader { inline uint8 ByteReader::ReadOneByte(const char* buffer) const { diff --git a/src/common/dwarf/cfi_assembler.cc b/src/common/dwarf/cfi_assembler.cc index 50e92e5a..a6a5aca6 100644 --- a/src/common/dwarf/cfi_assembler.cc +++ b/src/common/dwarf/cfi_assembler.cc @@ -32,11 +32,11 @@ // cfi_assembler.cc: Implementation of google_breakpad::CFISection class. // See cfi_assembler.h for details. -#include -#include - #include "common/dwarf/cfi_assembler.h" +#include +#include + namespace google_breakpad { using dwarf2reader::DwarfPointerEncoding; diff --git a/src/common/dwarf/dwarf2diehandler.cc b/src/common/dwarf/dwarf2diehandler.cc index 099f5193..5d019293 100644 --- a/src/common/dwarf/dwarf2diehandler.cc +++ b/src/common/dwarf/dwarf2diehandler.cc @@ -31,10 +31,10 @@ // dwarf2diehandler.cc: Implement the dwarf2reader::DieDispatcher class. // See dwarf2diehandler.h for details. -#include - #include "common/dwarf/dwarf2diehandler.h" +#include + namespace dwarf2reader { DIEDispatcher::~DIEDispatcher() { diff --git a/src/common/dwarf/dwarf2reader.cc b/src/common/dwarf/dwarf2reader.cc index 1a397019..a2915bad 100644 --- a/src/common/dwarf/dwarf2reader.cc +++ b/src/common/dwarf/dwarf2reader.cc @@ -31,16 +31,18 @@ // Implementation of dwarf2reader::LineInfo, dwarf2reader::CompilationUnit, // and dwarf2reader::CallFrameInfo. See dwarf2reader.h for details. -#include -#include -#include +#include "common/dwarf/dwarf2reader.h" + +#include +#include +#include + #include #include #include #include #include "common/dwarf/bytereader-inl.h" -#include "common/dwarf/dwarf2reader.h" #include "common/dwarf/bytereader.h" #include "common/dwarf/line_state_machine.h" diff --git a/src/common/dwarf/dwarf2reader_cfi_unittest.cc b/src/common/dwarf/dwarf2reader_cfi_unittest.cc index 85889f88..1a2431c7 100644 --- a/src/common/dwarf/dwarf2reader_cfi_unittest.cc +++ b/src/common/dwarf/dwarf2reader_cfi_unittest.cc @@ -31,7 +31,8 @@ // dwarf2reader_cfi_unittest.cc: Unit tests for dwarf2reader::CallFrameInfo -#include +#include + #include // The '.eh_frame' format, used by the Linux C++ ABI for exception @@ -45,9 +46,9 @@ // interpretation against the test's intentions. Each ELF file is named // "cfitest-TEST", where TEST identifies the particular test. #ifdef WRITE_ELF -#include -#include -#include +#include +#include +#include extern "C" { // To compile with WRITE_ELF, you should add the 'include' directory // of the binutils, gcc, or gdb source tree to your #include path; diff --git a/src/common/dwarf_cfi_to_module.h b/src/common/dwarf_cfi_to_module.h index 4f4ce0a2..dc11ec53 100644 --- a/src/common/dwarf_cfi_to_module.h +++ b/src/common/dwarf_cfi_to_module.h @@ -39,7 +39,8 @@ #ifndef COMMON_LINUX_DWARF_CFI_TO_MODULE_H #define COMMON_LINUX_DWARF_CFI_TO_MODULE_H -#include +#include + #include #include diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc index 03206d22..4792d900 100644 --- a/src/common/dwarf_cu_to_module.cc +++ b/src/common/dwarf_cu_to_module.cc @@ -31,10 +31,12 @@ // Implement the DwarfCUToModule class; see dwarf_cu_to_module.h. +#include "common/dwarf_cu_to_module.h" + +#include + #include -#include -#include "common/dwarf_cu_to_module.h" #include "common/dwarf_line_to_module.h" namespace google_breakpad { diff --git a/src/common/linux/dump_symbols.cc b/src/common/linux/dump_symbols.cc index a9d2cb46..d8a78942 100644 --- a/src/common/linux/dump_symbols.cc +++ b/src/common/linux/dump_symbols.cc @@ -32,18 +32,20 @@ // dump_symbols.cc: implement google_breakpad::WriteSymbolFile: // Find all the debugging info in a file and dump it as a Breakpad symbol file. +#include "common/linux/dump_symbols.h" + +#include #include +#include #include #include +#include +#include +#include #include #include #include -#include -#include -#include -#include -#include #include #include "common/dwarf/bytereader-inl.h" @@ -51,7 +53,6 @@ #include "common/dwarf_cfi_to_module.h" #include "common/dwarf_cu_to_module.h" #include "common/dwarf_line_to_module.h" -#include "common/linux/dump_symbols.h" #include "common/linux/file_id.h" #include "common/module.h" #include "common/stabs_reader.h" diff --git a/src/common/linux/dump_symbols.h b/src/common/linux/dump_symbols.h index 0b6d0c02..5422b1c8 100644 --- a/src/common/linux/dump_symbols.h +++ b/src/common/linux/dump_symbols.h @@ -35,8 +35,9 @@ #ifndef COMMON_LINUX_DUMP_SYMBOLS_H__ #define COMMON_LINUX_DUMP_SYMBOLS_H__ +#include + #include -#include namespace google_breakpad { diff --git a/src/common/linux/file_id.cc b/src/common/linux/file_id.cc index e76d0b0a..d2461b9c 100644 --- a/src/common/linux/file_id.cc +++ b/src/common/linux/file_id.cc @@ -33,21 +33,22 @@ // #include "common/linux/file_id.h" -#include "common/linux/linux_libc_support.h" -#include "common/linux/linux_syscall_support.h" #include +#include #include #include #include +#include #include #include #include #include #include -#include -#include + +#include "common/linux/linux_libc_support.h" +#include "common/linux/linux_syscall_support.h" namespace google_breakpad { diff --git a/src/common/linux/guid_creator.cc b/src/common/linux/guid_creator.cc index 7611cc3e..678f5904 100644 --- a/src/common/linux/guid_creator.cc +++ b/src/common/linux/guid_creator.cc @@ -27,14 +27,14 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include -#include -#include -#include -#include - #include "common/linux/guid_creator.h" +#include +#include +#include +#include +#include + // // GUIDGenerator // diff --git a/src/common/linux/http_upload.cc b/src/common/linux/http_upload.cc index f0f9a6de..1ab4b12b 100644 --- a/src/common/linux/http_upload.cc +++ b/src/common/linux/http_upload.cc @@ -27,14 +27,14 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include +#include "common/linux/http_upload.h" + +#include #include #include #include #include -#include "common/linux/http_upload.h" - namespace { // Callback to get the response data from server. diff --git a/src/common/linux/libcurl_wrapper.h b/src/common/linux/libcurl_wrapper.h index 08aa9586..ce549889 100644 --- a/src/common/linux/libcurl_wrapper.h +++ b/src/common/linux/libcurl_wrapper.h @@ -30,9 +30,10 @@ // A wrapper for libcurl to do HTTP Uploads, to support easy mocking // and unit testing of the HTTPUpload class. +#include + #include #include -#include namespace google_breakpad { class LibcurlWrapper { diff --git a/src/common/module.cc b/src/common/module.cc index fd36f3f9..f7f5788e 100644 --- a/src/common/module.cc +++ b/src/common/module.cc @@ -31,11 +31,11 @@ // module.cc: Implement google_breakpad::Module. See module.h. -#include -#include - #include "common/module.h" +#include +#include + namespace google_breakpad { Module::Module(const string &name, const string &os, diff --git a/src/common/module.h b/src/common/module.h index 92012249..64707f3f 100644 --- a/src/common/module.h +++ b/src/common/module.h @@ -38,10 +38,11 @@ #ifndef COMMON_LINUX_MODULE_H__ #define COMMON_LINUX_MODULE_H__ +#include + #include #include #include -#include #include "google_breakpad/common/breakpad_types.h" diff --git a/src/common/module_unittest.cc b/src/common/module_unittest.cc index dab0dac3..18c8ad61 100644 --- a/src/common/module_unittest.cc +++ b/src/common/module_unittest.cc @@ -31,10 +31,10 @@ // module_unittest.cc: Unit tests for google_breakpad::Module. -#include -#include -#include -#include +#include +#include +#include +#include #include #include diff --git a/src/common/test_assembler.cc b/src/common/test_assembler.cc index 261691b0..3271176c 100644 --- a/src/common/test_assembler.cc +++ b/src/common/test_assembler.cc @@ -32,13 +32,13 @@ // test_assembler.cc: Implementation of google_breakpad::TestAssembler. // See test_assembler.h for details. +#include "common/test_assembler.h" + #include #include #include -#include "common/test_assembler.h" - namespace google_breakpad { namespace test_assembler { -- cgit v1.2.1