[chromium-style] auto variable type must not deduce to a raw pointer type

This commit is contained in:
Jeremy Apthorp 2018-04-17 15:41:47 -07:00
parent 667c43398c
commit a635f078c6
61 changed files with 189 additions and 188 deletions

View file

@ -135,7 +135,7 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
void ConvertStringWithSeparatorToVector(std::vector<std::string>* vec,
const char* separator,
const char* cmd_switch) {
auto command_line = base::CommandLine::ForCurrentProcess();
auto* command_line = base::CommandLine::ForCurrentProcess();
auto string_with_separator = command_line->GetSwitchValueASCII(cmd_switch);
if (!string_with_separator.empty())
*vec = base::SplitString(string_with_separator, separator,
@ -146,7 +146,7 @@ void ConvertStringWithSeparatorToVector(std::vector<std::string>* vec,
void AddPepperFlashFromCommandLine(
std::vector<content::PepperPluginInfo>* plugins) {
auto command_line = base::CommandLine::ForCurrentProcess();
auto* command_line = base::CommandLine::ForCurrentProcess();
base::FilePath flash_path =
command_line->GetSwitchValuePath(switches::kPpapiFlashPath);
if (flash_path.empty())
@ -161,7 +161,7 @@ void AddPepperFlashFromCommandLine(
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
void AddWidevineCdmFromCommandLine(
std::vector<content::PepperPluginInfo>* plugins) {
auto command_line = base::CommandLine::ForCurrentProcess();
auto* command_line = base::CommandLine::ForCurrentProcess();
base::FilePath widevine_cdm_path =
command_line->GetSwitchValuePath(switches::kWidevineCdmPath);
if (widevine_cdm_path.empty())

View file

@ -39,7 +39,7 @@
namespace {
#ifdef ENABLE_RUN_AS_NODE
const auto kRunAsNode = "ELECTRON_RUN_AS_NODE";
const char kRunAsNode[] = "ELECTRON_RUN_AS_NODE";
#endif
#if defined(ENABLE_RUN_AS_NODE) || defined(OS_WIN)

View file

@ -61,7 +61,7 @@ AtomMainDelegate::AtomMainDelegate() {}
AtomMainDelegate::~AtomMainDelegate() {}
bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
auto command_line = base::CommandLine::ForCurrentProcess();
auto* command_line = base::CommandLine::ForCurrentProcess();
logging::LoggingSettings settings;
#if defined(OS_WIN)
@ -129,7 +129,7 @@ bool AtomMainDelegate::BasicStartupComplete(int* exit_code) {
void AtomMainDelegate::PreSandboxStartup() {
brightray::MainDelegate::PreSandboxStartup();
auto command_line = base::CommandLine::ForCurrentProcess();
auto* command_line = base::CommandLine::ForCurrentProcess();
std::string process_type =
command_line->GetSwitchValueASCII(::switches::kProcessType);

View file

@ -17,7 +17,7 @@ bool IsUrlArg(const base::CommandLine::CharType* arg) {
// the first character must be a letter for this to be a URL
auto c = *arg;
if (('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z')) {
for (auto p = arg + 1; *p; ++p) {
for (auto* p = arg + 1; *p; ++p) {
c = *p;
// colon indicates that the argument starts with a URI scheme
@ -1377,7 +1377,7 @@ bool IsBlacklistedArg(const base::CommandLine::CharType* arg) {
static const char* prefixes[] = {"--", "-", "/"};
int prefix_length = 0;
for (auto& prefix : prefixes) {
for (auto*& prefix : prefixes) {
if (base::StartsWith(a, prefix, base::CompareCase::SENSITIVE)) {
prefix_length = strlen(prefix);
break;