Don’t use using directives (“using namespace”) in tools.

The contents of tools are moved into the namespace
crashpad::(anonymous namespace).

https://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Namespaces

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/627273004
This commit is contained in:
Mark Mentovai 2014-10-07 17:30:09 -04:00
parent 6d1af6922f
commit 40602fab1f
3 changed files with 27 additions and 15 deletions

View File

@ -35,10 +35,9 @@
#include "util/posix/symbolic_constants_posix.h"
#include "util/stdlib/string_number_conversion.h"
namespace crashpad {
namespace {
using namespace crashpad;
struct Options {
std::string file_path;
std::string mach_service;
@ -179,9 +178,7 @@ void Usage(const std::string& me) {
ToolSupport::UsageTail(me);
}
} // namespace
int main(int argc, char* argv[]) {
int CatchExceptionToolMain(int argc, char* argv[]) {
const std::string me(basename(argv[0]));
enum OptionFlags {
@ -300,3 +297,10 @@ int main(int argc, char* argv[]) {
return EXIT_SUCCESS;
}
} // namespace
} // namespace crashpad
int main(int argc, char* argv[]) {
return crashpad::CatchExceptionToolMain(argc, argv);
}

View File

@ -35,10 +35,9 @@
#include "util/mach/symbolic_constants_mach.h"
#include "util/stdlib/string_number_conversion.h"
namespace crashpad {
namespace {
using namespace crashpad;
//! \brief Manages a pool of Mach send rights, deallocating all send rights upon
//! destruction.
//!
@ -348,9 +347,7 @@ void Usage(const std::string& me) {
ToolSupport::UsageTail(me);
}
} // namespace
int main(int argc, char* argv[]) {
int ExceptionPortToolMain(int argc, char* argv[]) {
const std::string me(basename(argv[0]));
enum ExitCode {
@ -587,3 +584,10 @@ int main(int argc, char* argv[]) {
return kExitSuccess;
}
} // namespace
} // namespace crashpad
int main(int argc, char* argv[]) {
return crashpad::ExceptionPortToolMain(argc, argv);
}

View File

@ -30,10 +30,9 @@
#include "util/mac/service_management.h"
#include "util/stdlib/objc.h"
namespace crashpad {
namespace {
using namespace crashpad;
void Usage(const std::string& me) {
fprintf(stderr,
"Usage: %s -L -l LABEL [OPTION]... COMMAND [ARG]...\n"
@ -52,9 +51,7 @@ void Usage(const std::string& me) {
ToolSupport::UsageTail(me);
}
} // namespace
int main(int argc, char* argv[]) {
int OnDemandServiceToolMain(int argc, char* argv[]) {
const std::string me(basename(argv[0]));
enum Operation {
@ -190,3 +187,10 @@ int main(int argc, char* argv[]) {
}
}
}
} // namespace
} // namespace crashpad
int main(int argc, char* argv[]) {
return crashpad::OnDemandServiceToolMain(argc, argv);
}