summaryrefslogtreecommitdiffstats
path: root/googletest
diff options
context:
space:
mode:
authorZulkarnine Mahmud <zulkarnine2076@gmail.com>2017-07-16 12:59:26 (GMT)
committerGitHub <noreply@github.com>2017-07-16 12:59:26 (GMT)
commit2960aa54e219b21ec9dbde0dc4692ef3010a9970 (patch)
treebb0478af572a22e5fb3e56e4be751be3b55cdf92 /googletest
parenta6b146dfddb9462b901b1eb45ee0d6d761f021bf (diff)
downloadgoogletest-2960aa54e219b21ec9dbde0dc4692ef3010a9970.zip
googletest-2960aa54e219b21ec9dbde0dc4692ef3010a9970.tar.gz
googletest-2960aa54e219b21ec9dbde0dc4692ef3010a9970.tar.bz2
Remove duplicate coderefs/pull/1127/head
Diffstat (limited to 'googletest')
-rw-r--r--googletest/src/gtest.cc22
1 files changed, 6 insertions, 16 deletions
diff --git a/googletest/src/gtest.cc b/googletest/src/gtest.cc
index 9bcb173..fcaf156 100644
--- a/googletest/src/gtest.cc
+++ b/googletest/src/gtest.cc
@@ -2894,27 +2894,17 @@ WORD GetColorAttribute(GTestColor color) {
}
}
-int GetBgOffset(WORD background_mask) {
- if (background_mask == 0) return 0;
+int GetBitOffset(WORD color_mask) {
+ if (color_mask == 0) return 0;
int bitOffset = 0;
- while((background_mask & 1) == 0) {
- background_mask >>= 1;
+ while((color_mask & 1) == 0) {
+ color_mask >>= 1;
++bitOffset;
}
return bitOffset;
}
-int GetFgOffset(WORD foreground_mask) {
- if (foreground_mask == 0) return 0;
-
- int bitOffset = 0;
- while((foreground_mask & 1) == 0) {
- foreground_mask >>= 1;
- ++bitOffset;
- }
- return bitOffset;
-}
WORD GetNewColor(GTestColor color, WORD old_color_attrs) {
// Let's reuse the BG
static const WORD background_mask = BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_INTENSITY;
@@ -2922,8 +2912,8 @@ WORD GetNewColor(GTestColor color, WORD old_color_attrs) {
const WORD existing_bg = old_color_attrs & background_mask;
WORD new_color = GetColorAttribute(color) | existing_bg | FOREGROUND_INTENSITY;
- static const int bg_bitOffset = GetBgOffset(background_mask);
- static const int fg_bitOffset = GetFgOffset(foreground_mask);
+ static const int bg_bitOffset = GetBitOffset(background_mask);
+ static const int fg_bitOffset = GetBitOffset(foreground_mask);
if (((new_color & background_mask) >> bg_bitOffset) == ((new_color & foreground_mask) >> fg_bitOffset)) {
new_color ^= FOREGROUND_INTENSITY; //invert intensity