summaryrefslogtreecommitdiff
path: root/core/src/fxcrt
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-07-22 15:04:26 -0700
committerTom Sepez <tsepez@chromium.org>2015-07-22 15:04:26 -0700
commit4eb4d7f6c707cc2c23c806aa540d055c8832b55d (patch)
tree43b7a7fac7b4ce08c287bfc03d09e5e1201e20d0 /core/src/fxcrt
parent7cc97521db1e52d5927f5605de5f9a7102f8af40 (diff)
downloadpdfium-4eb4d7f6c707cc2c23c806aa540d055c8832b55d.tar.xz
Revert "Fix else-after-returns throughout pdfium."
This reverts commit 7cc97521db1e52d5927f5605de5f9a7102f8af40.
Diffstat (limited to 'core/src/fxcrt')
-rw-r--r--core/src/fxcrt/fx_basic_array.cpp3
-rw-r--r--core/src/fxcrt/fx_basic_bstring.cpp11
-rw-r--r--core/src/fxcrt/fx_basic_util.cpp24
-rw-r--r--core/src/fxcrt/fx_basic_wstring.cpp9
4 files changed, 21 insertions, 26 deletions
diff --git a/core/src/fxcrt/fx_basic_array.cpp b/core/src/fxcrt/fx_basic_array.cpp
index 4ab34bb022..56b2f57f3c 100644
--- a/core/src/fxcrt/fx_basic_array.cpp
+++ b/core/src/fxcrt/fx_basic_array.cpp
@@ -243,8 +243,7 @@ void** CFX_BaseSegmentedArray::GetIndex(int seg_index) const
ASSERT(m_IndexDepth != 0);
if (m_IndexDepth == 1) {
return (void**)m_pIndex;
- }
- if (m_IndexDepth == 2) {
+ } else if (m_IndexDepth == 2) {
return (void**)((void**)m_pIndex)[seg_index / m_IndexSize];
}
int tree_size = 1;
diff --git a/core/src/fxcrt/fx_basic_bstring.cpp b/core/src/fxcrt/fx_basic_bstring.cpp
index 5eeb33b049..9f54414110 100644
--- a/core/src/fxcrt/fx_basic_bstring.cpp
+++ b/core/src/fxcrt/fx_basic_bstring.cpp
@@ -132,9 +132,10 @@ CFX_ByteString::CFX_ByteString(const CFX_ByteStringC& stringSrc)
if (stringSrc.IsEmpty()) {
m_pData = NULL;
return;
+ } else {
+ m_pData = NULL;
+ *this = stringSrc;
}
- m_pData = NULL;
- *this = stringSrc;
}
CFX_ByteString::CFX_ByteString(const CFX_ByteStringC& str1, const CFX_ByteStringC& str2)
{
@@ -970,15 +971,13 @@ int CFX_ByteString::Compare(const CFX_ByteStringC& str) const
for (int i = 0; i < min_len; i ++) {
if ((uint8_t)m_pData->m_String[i] < str.GetAt(i)) {
return -1;
- }
- if ((uint8_t)m_pData->m_String[i] > str.GetAt(i)) {
+ } else if ((uint8_t)m_pData->m_String[i] > str.GetAt(i)) {
return 1;
}
}
if (this_len < that_len) {
return -1;
- }
- if (this_len > that_len) {
+ } else if (this_len > that_len) {
return 1;
}
return 0;
diff --git a/core/src/fxcrt/fx_basic_util.cpp b/core/src/fxcrt/fx_basic_util.cpp
index 26eeacce1b..f23bf4bc27 100644
--- a/core/src/fxcrt/fx_basic_util.cpp
+++ b/core/src/fxcrt/fx_basic_util.cpp
@@ -457,18 +457,18 @@ CFX_Matrix_3by3 CFX_Matrix_3by3::Inverse()
FX_FLOAT det = a*(e*i - f*h) - b*(i*d - f*g) + c*(d*h - e*g);
if (FXSYS_fabs(det) < 0.0000001)
return CFX_Matrix_3by3();
-
- return CFX_Matrix_3by3(
- (e*i - f*h) / det,
- -(b*i - c*h) / det,
- (b*f - c*e) / det,
- -(d*i - f*g) / det,
- (a*i - c*g) / det,
- -(a*f - c*d) / det,
- (d*h - e*g) / det,
- -(a*h - b*g) / det,
- (a*e - b*d) / det
- );
+ else
+ return CFX_Matrix_3by3(
+ (e*i - f*h) / det,
+ -(b*i - c*h) / det,
+ (b*f - c*e) / det,
+ -(d*i - f*g) / det,
+ (a*i - c*g) / det,
+ -(a*f - c*d) / det,
+ (d*h - e*g) / det,
+ -(a*h - b*g) / det,
+ (a*e - b*d) / det
+ );
}
CFX_Matrix_3by3 CFX_Matrix_3by3::Multiply(const CFX_Matrix_3by3 &m)
diff --git a/core/src/fxcrt/fx_basic_wstring.cpp b/core/src/fxcrt/fx_basic_wstring.cpp
index b6b595588d..2442daed27 100644
--- a/core/src/fxcrt/fx_basic_wstring.cpp
+++ b/core/src/fxcrt/fx_basic_wstring.cpp
@@ -485,8 +485,7 @@ int CFX_WideString::Compare(const CFX_WideString& str) const
return 0;
}
return -1;
- }
- if (str.m_pData == NULL) {
+ } else if (str.m_pData == NULL) {
return 1;
}
int this_len = m_pData->m_nDataLength;
@@ -495,15 +494,13 @@ int CFX_WideString::Compare(const CFX_WideString& str) const
for (int i = 0; i < min_len; i ++) {
if (m_pData->m_String[i] < str.m_pData->m_String[i]) {
return -1;
- }
- if (m_pData->m_String[i] > str.m_pData->m_String[i]) {
+ } else if (m_pData->m_String[i] > str.m_pData->m_String[i]) {
return 1;
}
}
if (this_len < that_len) {
return -1;
- }
- if (this_len > that_len) {
+ } else if (this_len > that_len) {
return 1;
}
return 0;