summaryrefslogtreecommitdiff
path: root/core/src/fxcrt
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2016-02-24 09:51:16 -0500
committerDan Sinclair <dsinclair@chromium.org>2016-02-24 09:51:16 -0500
commit50cce609050e1a40e1d6936e0a3f0614b4483eee (patch)
treebdcd3399ee0c2fc5352ec8b008499a91ee08a422 /core/src/fxcrt
parenta7f70cc1ff7d54b92d9c55326c1439a25116e00c (diff)
downloadpdfium-50cce609050e1a40e1d6936e0a3f0614b4483eee.tar.xz
Fixing whitespace lint errors.
This CL enables several of the diabled whitelist/* lint checks. R=thestig@chromium.org, tsepez@chromium.org Review URL: https://codereview.chromium.org/1730553002 .
Diffstat (limited to 'core/src/fxcrt')
-rw-r--r--core/src/fxcrt/fx_arabic.cpp93
-rw-r--r--core/src/fxcrt/fx_basic_bstring.cpp4
-rw-r--r--core/src/fxcrt/fx_extension.cpp9
3 files changed, 10 insertions, 96 deletions
diff --git a/core/src/fxcrt/fx_arabic.cpp b/core/src/fxcrt/fx_arabic.cpp
index 14a57603e1..953e74ca76 100644
--- a/core/src/fxcrt/fx_arabic.cpp
+++ b/core/src/fxcrt/fx_arabic.cpp
@@ -383,67 +383,12 @@ int32_t FX_BidiResolveExplicit(int32_t iBaseLevel,
if (iCount < 1) {
return 0;
}
-#if 0
- int32_t iLastNest = iNest;
-#endif
+
int32_t iSize = classes.GetSize();
int32_t i = iStart, iCur, iCls;
for (; i < iSize && iCount > 0; i++, iCount--) {
iCur = iCls = classes.GetAt(i);
-#if 0
- switch (iCls) {
- case FX_BIDICLASS_LRO:
- case FX_BIDICLASS_LRE:
- classes.SetAt(i, FX_BIDICLASS_BN);
- iCls = FX_BIDICLASS_BN;
- iNest ++;
- if (FX_BidiGreaterEven(iBaseLevel) <= MAX_LEVEL) {
- int32_t iLevel = FX_BidiGreaterEven(iBaseLevel);
- levels.SetAt(i, iLevel);
- i += FX_BidiResolveExplicit(iLevel,
- (iCls == FX_BIDICLASS_LRE ? FX_BIDICLASS_N : FX_BIDICLASS_L),
- classes,
- levels,
- i + 1,
- iCount - 1,
- iNest);
- iNest --;
- continue;
- }
- break;
- case FX_BIDICLASS_RLO:
- case FX_BIDICLASS_RLE:
- classes.SetAt(i, FX_BIDICLASS_BN);
- iCls = FX_BIDICLASS_BN;
- iNest ++;
- if (FX_BidiGreaterOdd(iBaseLevel) <= MAX_LEVEL) {
- int32_t iLevel = FX_BidiGreaterOdd(iBaseLevel);
- levels.SetAt(i, iLevel);
- i += FX_BidiResolveExplicit(iLevel,
- (iCls == FX_BIDICLASS_RLE ? FX_BIDICLASS_N : FX_BIDICLASS_R),
- classes,
- levels,
- i + 1,
- iCount - 1,
- iNest);
- iNest --;
- continue;
- }
- break;
- case FX_BIDICLASS_PDF:
- classes.SetAt(i, FX_BIDICLASS_BN);
- iCls = FX_BIDICLASS_BN;
- if (iNest) {
- if (iLastNest < iNest) {
- iNest --;
- } else {
- iSize = i;
- }
- }
- break;
- }
- iCur = iCls;
-#endif
+
if (iDirection != FX_BIDICLASS_N) {
iCls = iDirection;
}
@@ -553,39 +498,7 @@ void FX_BidiResolveWeak(int32_t iBaseLevel,
int32_t i = 0, iCount = 0, iClsCur, iClsRun, iClsNew, iAction;
for (; i <= iSize; i++) {
iClsCur = classes.GetAt(i);
-#if 0
- if (iClsCur == FX_BIDICLASS_BN) {
- levels.SetAt(i, iLevelCur);
- if (i == iSize && iLevelCur != iBaseLevel) {
- iClsCur = FX_BidiDirection(iLevelCur);
- classes.SetAt(i, iClsCur);
- } else if (i < iSize) {
- int32_t iLevelNext, iLevelNew;
- iClsNew = classes.GetAt(i + 1);
- iLevelNext = levels.GetAt(i + 1);
- if (iClsNew != FX_BIDICLASS_BN && iLevelCur != iLevelNext) {
- iLevelNew = iLevelNext;
- if (iLevelCur > iLevelNew) {
- iLevelNew = iLevelCur;
- }
- levels.SetAt(i, iLevelNew);
- iClsCur = FX_BidiDirection(iLevelNew);
- classes.SetAt(i, iClsCur);
- iLevelCur = iLevelNext;
- } else {
- if (iCount) {
- iCount ++;
- }
- continue;
- }
- } else {
- if (iCount) {
- iCount ++;
- }
- continue;
- }
- }
-#endif
+
FXSYS_assert(iClsCur <= FX_BIDICLASS_BN);
iAction = gc_FX_BidiWeakActions[iState][iClsCur];
iClsRun = FX_BidiGetDeferredType(iAction);
diff --git a/core/src/fxcrt/fx_basic_bstring.cpp b/core/src/fxcrt/fx_basic_bstring.cpp
index af06f0074b..8b4442e823 100644
--- a/core/src/fxcrt/fx_basic_bstring.cpp
+++ b/core/src/fxcrt/fx_basic_bstring.cpp
@@ -486,9 +486,7 @@ void CFX_ByteString::FormatV(const FX_CHAR* lpszFormat, va_list argList) {
nMaxLen += 2;
} else if (*lpsz == '*') {
nWidth = va_arg(argList, int);
- } else if (*lpsz == '-' || *lpsz == '+' || *lpsz == '0' || *lpsz == ' ')
- ;
- else {
+ } else if (*lpsz != '-' && *lpsz != '+' && *lpsz != '0' && *lpsz != ' ') {
break;
}
}
diff --git a/core/src/fxcrt/fx_extension.cpp b/core/src/fxcrt/fx_extension.cpp
index 456e6bd7f3..31f645ae0f 100644
--- a/core/src/fxcrt/fx_extension.cpp
+++ b/core/src/fxcrt/fx_extension.cpp
@@ -332,9 +332,12 @@ void FX_Random_GenerateBase(FX_DWORD* pBuffer, int32_t iCount) {
FX_HashCode_String_GetA((const FX_CHAR*)&st2, sizeof(st2), TRUE);
::srand((dwHash1 << 16) | (FX_DWORD)dwHash2);
#else
- time_t tmLast = time(NULL), tmCur;
- while ((tmCur = time(NULL)) == tmLast)
- ;
+ time_t tmLast = time(NULL);
+ time_t tmCur;
+ while ((tmCur = time(NULL)) == tmLast) {
+ continue;
+ }
+
::srand((tmCur << 16) | (tmLast & 0xFFFF));
#endif
while (iCount-- > 0) {