mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2025-12-24 00:04:58 +01:00
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 <saugustine@google.com> Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
parent
a741027533
commit
09b056975d
289 changed files with 3770 additions and 3775 deletions
|
|
@ -47,9 +47,9 @@ using std::dec;
|
|||
using std::hex;
|
||||
|
||||
|
||||
Module::Module(const string &name, const string &os,
|
||||
const string &architecture, const string &id,
|
||||
const string &code_id /* = "" */) :
|
||||
Module::Module(const string& name, const string& os,
|
||||
const string& architecture, const string& id,
|
||||
const string& code_id /* = "" */) :
|
||||
name_(name),
|
||||
os_(os),
|
||||
architecture_(architecture),
|
||||
|
|
@ -64,7 +64,7 @@ Module::~Module() {
|
|||
it != functions_.end(); ++it) {
|
||||
delete *it;
|
||||
}
|
||||
for (vector<StackFrameEntry *>::iterator it = stack_frame_entries_.begin();
|
||||
for (vector<StackFrameEntry*>::iterator it = stack_frame_entries_.begin();
|
||||
it != stack_frame_entries_.end(); ++it) {
|
||||
delete *it;
|
||||
}
|
||||
|
|
@ -80,7 +80,7 @@ void Module::SetAddressRanges(const vector<Range>& ranges) {
|
|||
address_ranges_ = ranges;
|
||||
}
|
||||
|
||||
void Module::AddFunction(Function *function) {
|
||||
void Module::AddFunction(Function* function) {
|
||||
// FUNC lines must not hold an empty name, so catch the problem early if
|
||||
// callers try to add one.
|
||||
assert(!function->name.empty());
|
||||
|
|
@ -124,13 +124,13 @@ void Module::AddFunction(Function *function) {
|
|||
}
|
||||
}
|
||||
|
||||
void Module::AddFunctions(vector<Function *>::iterator begin,
|
||||
vector<Function *>::iterator end) {
|
||||
for (vector<Function *>::iterator it = begin; it != end; ++it)
|
||||
void Module::AddFunctions(vector<Function*>::iterator begin,
|
||||
vector<Function*>::iterator end) {
|
||||
for (vector<Function*>::iterator it = begin; it != end; ++it)
|
||||
AddFunction(*it);
|
||||
}
|
||||
|
||||
void Module::AddStackFrameEntry(StackFrameEntry *stack_frame_entry) {
|
||||
void Module::AddStackFrameEntry(StackFrameEntry* stack_frame_entry) {
|
||||
if (!AddressIsInModule(stack_frame_entry->address)) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -138,7 +138,7 @@ void Module::AddStackFrameEntry(StackFrameEntry *stack_frame_entry) {
|
|||
stack_frame_entries_.push_back(stack_frame_entry);
|
||||
}
|
||||
|
||||
void Module::AddExtern(Extern *ext) {
|
||||
void Module::AddExtern(Extern* ext) {
|
||||
if (!AddressIsInModule(ext->address)) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -151,17 +151,17 @@ void Module::AddExtern(Extern *ext) {
|
|||
}
|
||||
}
|
||||
|
||||
void Module::GetFunctions(vector<Function *> *vec,
|
||||
vector<Function *>::iterator i) {
|
||||
void Module::GetFunctions(vector<Function*>* vec,
|
||||
vector<Function*>::iterator i) {
|
||||
vec->insert(i, functions_.begin(), functions_.end());
|
||||
}
|
||||
|
||||
void Module::GetExterns(vector<Extern *> *vec,
|
||||
vector<Extern *>::iterator i) {
|
||||
void Module::GetExterns(vector<Extern*>* vec,
|
||||
vector<Extern*>::iterator i) {
|
||||
vec->insert(i, externs_.begin(), externs_.end());
|
||||
}
|
||||
|
||||
Module::File *Module::FindFile(const string &name) {
|
||||
Module::File* Module::FindFile(const string& name) {
|
||||
// A tricky bit here. The key of each map entry needs to be a
|
||||
// pointer to the entry's File's name string. This means that we
|
||||
// can't do the initial lookup with any operation that would create
|
||||
|
|
@ -175,7 +175,7 @@ Module::File *Module::FindFile(const string &name) {
|
|||
FileByNameMap::iterator destiny = files_.lower_bound(&name);
|
||||
if (destiny == files_.end()
|
||||
|| *destiny->first != name) { // Repeated string comparison, boo hoo.
|
||||
File *file = new File(name);
|
||||
File* file = new File(name);
|
||||
file->source_id = -1;
|
||||
destiny = files_.insert(destiny,
|
||||
FileByNameMap::value_type(&file->name, file));
|
||||
|
|
@ -183,23 +183,23 @@ Module::File *Module::FindFile(const string &name) {
|
|||
return destiny->second;
|
||||
}
|
||||
|
||||
Module::File *Module::FindFile(const char *name) {
|
||||
Module::File* Module::FindFile(const char* name) {
|
||||
string name_string = name;
|
||||
return FindFile(name_string);
|
||||
}
|
||||
|
||||
Module::File *Module::FindExistingFile(const string &name) {
|
||||
Module::File* Module::FindExistingFile(const string& name) {
|
||||
FileByNameMap::iterator it = files_.find(&name);
|
||||
return (it == files_.end()) ? NULL : it->second;
|
||||
}
|
||||
|
||||
void Module::GetFiles(vector<File *> *vec) {
|
||||
void Module::GetFiles(vector<File*>* vec) {
|
||||
vec->clear();
|
||||
for (FileByNameMap::iterator it = files_.begin(); it != files_.end(); ++it)
|
||||
vec->push_back(it->second);
|
||||
}
|
||||
|
||||
void Module::GetStackFrameEntries(vector<StackFrameEntry *> *vec) const {
|
||||
void Module::GetStackFrameEntries(vector<StackFrameEntry*>* vec) const {
|
||||
*vec = stack_frame_entries_;
|
||||
}
|
||||
|
||||
|
|
@ -214,7 +214,7 @@ void Module::AssignSourceIds() {
|
|||
// info, by setting each one's source id to zero.
|
||||
for (FunctionSet::const_iterator func_it = functions_.begin();
|
||||
func_it != functions_.end(); ++func_it) {
|
||||
Function *func = *func_it;
|
||||
Function* func = *func_it;
|
||||
for (vector<Line>::iterator line_it = func->lines.begin();
|
||||
line_it != func->lines.end(); ++line_it)
|
||||
line_it->file->source_id = 0;
|
||||
|
|
@ -238,7 +238,7 @@ bool Module::ReportError() {
|
|||
return false;
|
||||
}
|
||||
|
||||
bool Module::WriteRuleMap(const RuleMap &rule_map, std::ostream &stream) {
|
||||
bool Module::WriteRuleMap(const RuleMap& rule_map, std::ostream& stream) {
|
||||
for (RuleMap::const_iterator it = rule_map.begin();
|
||||
it != rule_map.end(); ++it) {
|
||||
if (it != rule_map.begin())
|
||||
|
|
@ -261,7 +261,7 @@ bool Module::AddressIsInModule(Address address) const {
|
|||
return false;
|
||||
}
|
||||
|
||||
bool Module::Write(std::ostream &stream, SymbolData symbol_data) {
|
||||
bool Module::Write(std::ostream& stream, SymbolData symbol_data) {
|
||||
stream << "MODULE " << os_ << " " << architecture_ << " "
|
||||
<< id_ << " " << name_ << "\n";
|
||||
if (!stream.good())
|
||||
|
|
@ -277,7 +277,7 @@ bool Module::Write(std::ostream &stream, SymbolData symbol_data) {
|
|||
// Write out files.
|
||||
for (FileByNameMap::iterator file_it = files_.begin();
|
||||
file_it != files_.end(); ++file_it) {
|
||||
File *file = file_it->second;
|
||||
File* file = file_it->second;
|
||||
if (file->source_id >= 0) {
|
||||
stream << "FILE " << file->source_id << " " << file->name << "\n";
|
||||
if (!stream.good())
|
||||
|
|
@ -288,7 +288,7 @@ bool Module::Write(std::ostream &stream, SymbolData symbol_data) {
|
|||
// Write out functions and their lines.
|
||||
for (FunctionSet::const_iterator func_it = functions_.begin();
|
||||
func_it != functions_.end(); ++func_it) {
|
||||
Function *func = *func_it;
|
||||
Function* func = *func_it;
|
||||
vector<Line>::iterator line_it = func->lines.begin();
|
||||
for (auto range_it = func->ranges.cbegin();
|
||||
range_it != func->ranges.cend(); ++range_it) {
|
||||
|
|
@ -322,7 +322,7 @@ bool Module::Write(std::ostream &stream, SymbolData symbol_data) {
|
|||
// Write out 'PUBLIC' records.
|
||||
for (ExternSet::const_iterator extern_it = externs_.begin();
|
||||
extern_it != externs_.end(); ++extern_it) {
|
||||
Extern *ext = *extern_it;
|
||||
Extern* ext = *extern_it;
|
||||
stream << "PUBLIC " << hex
|
||||
<< (ext->address - load_address_) << " 0 "
|
||||
<< ext->name << dec << "\n";
|
||||
|
|
@ -331,10 +331,10 @@ bool Module::Write(std::ostream &stream, SymbolData symbol_data) {
|
|||
|
||||
if (symbol_data != NO_CFI) {
|
||||
// Write out 'STACK CFI INIT' and 'STACK CFI' records.
|
||||
vector<StackFrameEntry *>::const_iterator frame_it;
|
||||
vector<StackFrameEntry*>::const_iterator frame_it;
|
||||
for (frame_it = stack_frame_entries_.begin();
|
||||
frame_it != stack_frame_entries_.end(); ++frame_it) {
|
||||
StackFrameEntry *entry = *frame_it;
|
||||
StackFrameEntry* entry = *frame_it;
|
||||
stream << "STACK CFI INIT " << hex
|
||||
<< (entry->address - load_address_) << " "
|
||||
<< entry->size << " " << dec;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue