Skip to content

Commit

Permalink
GLog: Solve some compilation warnings
Browse files Browse the repository at this point in the history
Those are actually sent to a pull-request, see

  google/glog#81
  • Loading branch information
sergeyvfx committed Dec 30, 2015
1 parent 6b7ead4 commit 4145a4d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
8 changes: 4 additions & 4 deletions extern/libmv/third_party/glog/src/logging.cc
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ static GLogColor SeverityToColor(LogSeverity severity) {
#ifdef OS_WINDOWS

// Returns the character attribute for the given color.
WORD GetColorAttribute(GLogColor color) {
static WORD GetColorAttribute(GLogColor color) {
switch (color) {
case COLOR_RED: return FOREGROUND_RED;
case COLOR_GREEN: return FOREGROUND_GREEN;
Expand All @@ -313,7 +313,7 @@ WORD GetColorAttribute(GLogColor color) {
#else

// Returns the ANSI color code for the given color.
const char* GetAnsiColorCode(GLogColor color) {
static const char* GetAnsiColorCode(GLogColor color) {
switch (color) {
case COLOR_RED: return "1";
case COLOR_GREEN: return "2";
Expand Down Expand Up @@ -1677,7 +1677,7 @@ void LogToStderr() {
namespace base {
namespace internal {

bool GetExitOnDFatal() {
static bool GetExitOnDFatal() {
MutexLock l(&log_mutex);
return exit_on_dfatal;
}
Expand All @@ -1692,7 +1692,7 @@ bool GetExitOnDFatal() {
// and the stack trace is not recorded. The LOG(FATAL) *will* still
// exit the program. Since this function is used only in testing,
// these differences are acceptable.
void SetExitOnDFatal(bool value) {
static void SetExitOnDFatal(bool value) {
MutexLock l(&log_mutex);
exit_on_dfatal = value;
}
Expand Down
6 changes: 3 additions & 3 deletions extern/libmv/third_party/glog/src/symbolize.cc
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ OpenObjectFileContainingPcAndGetStartAddress(uint64_t pc,
// bytes. Output will be truncated as needed, and a NUL character is always
// appended.
// NOTE: code from sandbox/linux/seccomp-bpf/demo.cc.
char *itoa_r(intptr_t i, char *buf, size_t sz, int base, size_t padding) {
static char *itoa_r(intptr_t i, char *buf, size_t sz, int base, size_t padding) {
// Make sure we can write at least one NUL byte.
size_t n = 1;
if (n > sz)
Expand Down Expand Up @@ -696,7 +696,7 @@ char *itoa_r(intptr_t i, char *buf, size_t sz, int base, size_t padding) {

// Safely appends string |source| to string |dest|. Never writes past the
// buffer size |dest_size| and guarantees that |dest| is null-terminated.
void SafeAppendString(const char* source, char* dest, int dest_size) {
static void SafeAppendString(const char* source, char* dest, int dest_size) {
int dest_string_length = strlen(dest);
SAFE_ASSERT(dest_string_length < dest_size);
dest += dest_string_length;
Expand All @@ -709,7 +709,7 @@ void SafeAppendString(const char* source, char* dest, int dest_size) {
// Converts a 64-bit value into a hex string, and safely appends it to |dest|.
// Never writes past the buffer size |dest_size| and guarantees that |dest| is
// null-terminated.
void SafeAppendHexNumber(uint64_t value, char* dest, int dest_size) {
static void SafeAppendHexNumber(uint64_t value, char* dest, int dest_size) {
// 64-bit numbers in hex can have up to 16 digits.
char buf[17] = {'\0'};
SafeAppendString(itoa_r(value, buf, sizeof(buf), 16, 0), dest, dest_size);
Expand Down
2 changes: 1 addition & 1 deletion extern/libmv/third_party/glog/src/utilities.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static void DebugWriteToStderr(const char* data, void *) {
}
}

void DebugWriteToString(const char* data, void *arg) {
static void DebugWriteToString(const char* data, void *arg) {
reinterpret_cast<string*>(arg)->append(data);
}

Expand Down
6 changes: 6 additions & 0 deletions extern/libmv/third_party/glog/src/vlog_is_on.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ _START_GOOGLE_NAMESPACE_

namespace glog_internal_namespace_ {

// Used by logging_unittests.cc so can't make it static here.
GOOGLE_GLOG_DLL_DECL bool SafeFNMatch_(const char* pattern,
size_t patt_len,
const char* str,
size_t str_len);

// Implementation of fnmatch that does not need 0-termination
// of arguments and does not allocate any memory,
// but we only support "*" and "?" wildcards, not the "[...]" patterns.
Expand Down

0 comments on commit 4145a4d

Please sign in to comment.