diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-12-30 14:51:21 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-12-30 15:01:28 +0300 |
commit | 6b7ead4fe808d6442fe7ae9b7f4ec38de8f35ee0 (patch) | |
tree | ebf2e87f4450d5e689a84fc9bc7ed6263e295748 /extern/libmv/third_party/glog/src/vlog_is_on.cc | |
parent | 2583cc88dea50d143a27aeafaa0870cc668662c4 (diff) |
Libmv: Update to the latest upstream version
Main reason is to bring up new Glog which should have MSVC 2015
support.
Diffstat (limited to 'extern/libmv/third_party/glog/src/vlog_is_on.cc')
-rw-r--r-- | extern/libmv/third_party/glog/src/vlog_is_on.cc | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/extern/libmv/third_party/glog/src/vlog_is_on.cc b/extern/libmv/third_party/glog/src/vlog_is_on.cc index cd7fc19bca8..4c95583b683 100644 --- a/extern/libmv/third_party/glog/src/vlog_is_on.cc +++ b/extern/libmv/third_party/glog/src/vlog_is_on.cc @@ -62,8 +62,6 @@ _START_GOOGLE_NAMESPACE_ namespace glog_internal_namespace_ { -namespace { - // 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. @@ -97,8 +95,6 @@ GOOGLE_GLOG_DLL_DECL bool SafeFNMatch_(const char* pattern, } } -} // namespace - } // namespace glog_internal_namespace_ using glog_internal_namespace_::SafeFNMatch_; @@ -166,30 +162,32 @@ int SetVLOGLevel(const char* module_pattern, int log_level) { int result = FLAGS_v; int const pattern_len = strlen(module_pattern); bool found = false; - MutexLock l(&vmodule_lock); // protect whole read-modify-write - for (const VModuleInfo* info = vmodule_list; - info != NULL; info = info->next) { - if (info->module_pattern == module_pattern) { - if (!found) { + { + MutexLock l(&vmodule_lock); // protect whole read-modify-write + for (const VModuleInfo* info = vmodule_list; + info != NULL; info = info->next) { + if (info->module_pattern == module_pattern) { + if (!found) { + result = info->vlog_level; + found = true; + } + info->vlog_level = log_level; + } else if (!found && + SafeFNMatch_(info->module_pattern.c_str(), + info->module_pattern.size(), + module_pattern, pattern_len)) { result = info->vlog_level; found = true; } + } + if (!found) { + VModuleInfo* info = new VModuleInfo; + info->module_pattern = module_pattern; info->vlog_level = log_level; - } else if (!found && - SafeFNMatch_(info->module_pattern.c_str(), - info->module_pattern.size(), - module_pattern, pattern_len)) { - result = info->vlog_level; - found = true; + info->next = vmodule_list; + vmodule_list = info; } } - if (!found) { - VModuleInfo* info = new VModuleInfo; - info->module_pattern = module_pattern; - info->vlog_level = log_level; - info->next = vmodule_list; - vmodule_list = info; - } RAW_VLOG(1, "Set VLOG level for \"%s\" to %d", module_pattern, log_level); return result; } |