From 09b056975dacd1f0f815ad820b6dc9913b0118a3 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 23 Jun 2020 18:55:43 -0400 Subject: fix pointer style to match the style guide We do this in a lot of places, but we're inconsistent. Normalize the code to the Google C++ style guide. Change-Id: Ic2aceab661ce8f6b993dda21b1cdf5d2198dcbbf Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2262932 Reviewed-by: Sterling Augustine Reviewed-by: Mark Mentovai --- src/client/minidump_file_writer_unittest.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/client/minidump_file_writer_unittest.cc') diff --git a/src/client/minidump_file_writer_unittest.cc b/src/client/minidump_file_writer_unittest.cc index 256e3371..16c407d2 100644 --- a/src/client/minidump_file_writer_unittest.cc +++ b/src/client/minidump_file_writer_unittest.cc @@ -70,16 +70,16 @@ typedef struct { ArrayStructure array[0]; } ObjectAndArrayStructure; -static bool WriteFile(const char *path) { +static bool WriteFile(const char* path) { MinidumpFileWriter writer; if (writer.Open(path)) { // Test a single structure google_breakpad::TypedMDRVA strings(&writer); ASSERT_TRUE(strings.Allocate()); strings.get()->integer_value = 0xBEEF; - const char *first = "First String"; + const char* first = "First String"; ASSERT_TRUE(writer.WriteString(first, 0, &strings.get()->first_string)); - const wchar_t *second = L"Second String"; + const wchar_t* second = L"Second String"; ASSERT_TRUE(writer.WriteString(second, 0, &strings.get()->second_string)); // Test an array structure @@ -111,7 +111,7 @@ static bool WriteFile(const char *path) { return writer.Close(); } -static bool CompareFile(const char *path) { +static bool CompareFile(const char* path) { unsigned long expected[] = { #if defined(__BIG_ENDIAN__) 0x0000beef, 0x0000001e, 0x00000018, 0x00000020, 0x00000038, 0x00000000, @@ -146,13 +146,14 @@ static bool CompareFile(const char *path) { }; size_t expected_byte_count = sizeof(expected); int fd = open(path, O_RDONLY, 0600); - void *buffer = malloc(expected_byte_count); + void* buffer = malloc(expected_byte_count); ASSERT_NE(fd, -1); ASSERT_TRUE(buffer); ASSERT_EQ(read(fd, buffer, expected_byte_count), static_cast(expected_byte_count)); - char *b1, *b2; + char* b1; + char* b2; b1 = reinterpret_cast(buffer); b2 = reinterpret_cast(expected); while (*b1 == *b2) { @@ -167,13 +168,13 @@ static bool CompareFile(const char *path) { } static bool RunTests() { - const char *path = "/tmp/minidump_file_writer_unittest.dmp"; + const char* path = "/tmp/minidump_file_writer_unittest.dmp"; ASSERT_TRUE(WriteFile(path)); ASSERT_TRUE(CompareFile(path)); unlink(path); return true; } -extern "C" int main(int argc, const char *argv[]) { +extern "C" int main(int argc, const char* argv[]) { return RunTests() ? 0 : 1; } -- cgit v1.2.1