aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Thiago Farina <tfarina@chromium.org>2015-04-27 23:01:34 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2015-04-28 15:15:16 +0000
commitfdc7f98b4e118dfd3580badebaefdd95a372354a (patch)
tree7c8062f7e95e59a262983fa9651c85098e906cc6 /src
parentf636cedabf07d3e1fa01f79478c711717dc0d990 (diff)
Cleanup: Do not include unnecessary headers in blaze_util.h.
The header only uses std::string, std::vector, int and char types, and thus all these headers do not need to be included there. If necessary, they should be included in the relevant source files instead. -- Change-Id: Id1849a0f427016dcf732fe6bfc673e599e8d4b14 MOS_MIGRATED_REVID=92192506
Diffstat (limited to 'src')
-rw-r--r--src/main/cpp/blaze_util.cc4
-rw-r--r--src/main/cpp/blaze_util.h24
-rw-r--r--src/main/cpp/blaze_util_linux.cc5
3 files changed, 15 insertions, 18 deletions
diff --git a/src/main/cpp/blaze_util.cc b/src/main/cpp/blaze_util.cc
index 7b4c86645f..c44de09076 100644
--- a/src/main/cpp/blaze_util.cc
+++ b/src/main/cpp/blaze_util.cc
@@ -22,11 +22,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/stat.h>
+#include <sys/types.h>
#include <sys/xattr.h>
#include <unistd.h>
+
#include <sstream>
#include "src/main/cpp/util/errors.h"
@@ -34,6 +37,7 @@
#include "src/main/cpp/util/file.h"
#include "src/main/cpp/util/numbers.h"
#include "src/main/cpp/util/strings.h"
+#include "src/main/cpp/util/port.h"
using blaze_util::die;
using blaze_util::pdie;
diff --git a/src/main/cpp/blaze_util.h b/src/main/cpp/blaze_util.h
index e36691eb6e..d9b0140a26 100644
--- a/src/main/cpp/blaze_util.h
+++ b/src/main/cpp/blaze_util.h
@@ -16,22 +16,12 @@
// Blaze client.
//
-#ifndef DEVTOOLS_BLAZE_MAIN_BLAZE_UTIL_H__
-#define DEVTOOLS_BLAZE_MAIN_BLAZE_UTIL_H__
-
-#include <pwd.h>
-#include <stdarg.h>
-#include <sys/file.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <sys/types.h>
+#ifndef DEVTOOLS_BLAZE_MAIN_BLAZE_UTIL_H_
+#define DEVTOOLS_BLAZE_MAIN_BLAZE_UTIL_H_
+
#include <string>
#include <vector>
-#include "src/main/cpp/util/exit_code.h"
-#include "src/main/cpp/util/numbers.h"
-#include "src/main/cpp/util/port.h"
-
namespace blaze {
using std::string;
@@ -87,8 +77,9 @@ void ReExecute(const string &executable, int argc, const char *argv[]);
// If 'arg' matches 'key=value', returns address of 'value'.
// If it matches 'key' alone, returns address of next_arg.
// Returns NULL otherwise.
-const char* GetUnaryOption(const char *arg, const char *next_arg,
- const char *key);
+const char* GetUnaryOption(const char *arg,
+ const char *next_arg,
+ const char *key);
// Returns true iff 'arg' equals 'key'.
// Dies with a syntax error if arg starts with 'key='.
@@ -121,4 +112,5 @@ string GetJvmVersion(string java_exe);
bool CheckJavaVersionIsAtLeast(string jvm_version, string version_spec);
} // namespace blaze
-#endif // DEVTOOLS_BLAZE_MAIN_BLAZE_UTIL_H__
+
+#endif // DEVTOOLS_BLAZE_MAIN_BLAZE_UTIL_H_
diff --git a/src/main/cpp/blaze_util_linux.cc b/src/main/cpp/blaze_util_linux.cc
index e128a2b868..b905963b35 100644
--- a/src/main/cpp/blaze_util_linux.cc
+++ b/src/main/cpp/blaze_util_linux.cc
@@ -13,11 +13,12 @@
// limitations under the License.
#include <limits.h>
+#include <pwd.h>
#include <string.h> // strerror
#include <sys/statfs.h>
-#include <unistd.h>
#include <sys/types.h>
-#include <pwd.h>
+#include <sys/socket.h>
+#include <unistd.h>
#include "src/main/cpp/blaze_util.h"
#include "src/main/cpp/blaze_util_platform.h"