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/tools/linux/dump_syms/dump_syms.cc | 2 +- src/tools/linux/md2core/minidump-2-core.cc | 12 ++++++------ src/tools/linux/symupload/minidump_upload.cc | 2 +- src/tools/linux/symupload/sym_upload.cc | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/tools/linux') diff --git a/src/tools/linux/dump_syms/dump_syms.cc b/src/tools/linux/dump_syms/dump_syms.cc index ebdf2314..42e582c6 100644 --- a/src/tools/linux/dump_syms/dump_syms.cc +++ b/src/tools/linux/dump_syms/dump_syms.cc @@ -56,7 +56,7 @@ int usage(const char* self) { return 1; } -int main(int argc, char **argv) { +int main(int argc, char** argv) { if (argc < 2) return usage(argv[0]); bool header_only = false; diff --git a/src/tools/linux/md2core/minidump-2-core.cc b/src/tools/linux/md2core/minidump-2-core.cc index a60be323..aade82c9 100644 --- a/src/tools/linux/md2core/minidump-2-core.cc +++ b/src/tools/linux/md2core/minidump-2-core.cc @@ -149,7 +149,7 @@ SetupOptions(int argc, const char* argv[], Options* options) { options->use_filename = false; options->inc_guid = false; - while ((ch = getopt(argc, (char * const *)argv, "fhio:S:v")) != -1) { + while ((ch = getopt(argc, (char * const*)argv, "fhio:S:v")) != -1) { switch (ch) { case 'h': Usage(argc, argv); @@ -224,7 +224,7 @@ writea(int fd, const void* idata, size_t length) { */ static inline int sex() { int probe = 1; - return !*(char *)&probe; + return !*(char*)&probe; } typedef struct elf_timeval { /* Time value with microsecond resolution */ @@ -660,10 +660,10 @@ ParseSystemInfo(const Options& options, CrashedProcess* crashinfo, sysinfo->processor_architecture == MD_CPU_ARCHITECTURE_AMD64) { fputs("Vendor id: ", stderr); const char *nul = - (const char *)memchr(sysinfo->cpu.x86_cpu_info.vendor_id, 0, + (const char*)memchr(sysinfo->cpu.x86_cpu_info.vendor_id, 0, sizeof(sysinfo->cpu.x86_cpu_info.vendor_id)); fwrite(sysinfo->cpu.x86_cpu_info.vendor_id, - nul ? nul - (const char *)&sysinfo->cpu.x86_cpu_info.vendor_id[0] + nul ? nul - (const char*)&sysinfo->cpu.x86_cpu_info.vendor_id[0] : sizeof(sysinfo->cpu.x86_cpu_info.vendor_id), 1, stderr); fputs("\n", stderr); } @@ -759,7 +759,7 @@ ParseEnvironment(const Options& options, CrashedProcess* crashinfo, memcpy(env, range.data(), range.length()); int nul_count = 0; for (char *ptr = env;;) { - ptr = (char *)memchr(ptr, '\000', range.length() - (ptr - env)); + ptr = (char*)memchr(ptr, '\000', range.length() - (ptr - env)); if (!ptr) { break; } @@ -1076,7 +1076,7 @@ AugmentMappings(const Options& options, CrashedProcess* crashinfo, for (unsigned i = 0; i < crashinfo->threads.size(); ++i) { const CrashedProcess::Thread& thread = crashinfo->threads[i]; AddDataToMapping(crashinfo, - string((char *)thread.stack, thread.stack_length), + string((char*)thread.stack, thread.stack_length), thread.stack_addr); } diff --git a/src/tools/linux/symupload/minidump_upload.cc b/src/tools/linux/symupload/minidump_upload.cc index 19f17450..f24e9716 100644 --- a/src/tools/linux/symupload/minidump_upload.cc +++ b/src/tools/linux/symupload/minidump_upload.cc @@ -111,7 +111,7 @@ SetupOptions(int argc, const char *argv[], Options *options) { extern int optind; int ch; - while ((ch = getopt(argc, (char * const *)argv, "p:u:v:x:h?")) != -1) { + while ((ch = getopt(argc, (char * const*)argv, "p:u:v:x:h?")) != -1) { switch (ch) { case 'p': options->product = optarg; diff --git a/src/tools/linux/symupload/sym_upload.cc b/src/tools/linux/symupload/sym_upload.cc index 256f73c5..57df81cf 100644 --- a/src/tools/linux/symupload/sym_upload.cc +++ b/src/tools/linux/symupload/sym_upload.cc @@ -115,7 +115,7 @@ SetupOptions(int argc, const char *argv[], Options *options) { int ch; constexpr char flag_pattern[] = "u:v:x:p:k:t:c:i:hf?"; - while ((ch = getopt(argc, (char * const *)argv, flag_pattern)) != -1) { + while ((ch = getopt(argc, (char * const*)argv, flag_pattern)) != -1) { switch (ch) { case 'h': case '?': -- cgit v1.2.1