summaryrefslogtreecommitdiff
path: root/core/include
diff options
context:
space:
mode:
authorWei Li <weili@chromium.org>2016-03-11 17:00:48 -0800
committerWei Li <weili@chromium.org>2016-03-11 17:00:48 -0800
commit97da97662417085774f75c26e535c6fbe70266ae (patch)
tree9654be693dfb20b49be80911fa8089ff319757f3 /core/include
parent55265016faac358266af280db6c62afa34ce2891 (diff)
downloadpdfium-97da97662417085774f75c26e535c6fbe70266ae.tar.xz
Re-enable MSVC warning 4800 for compiling with chromium_code
Mainly change the code to avoid the warnings; in a few cases we have to use explicit casts. BUG=pdfium:29 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1783023002 .
Diffstat (limited to 'core/include')
-rw-r--r--core/include/fpdfapi/cpdf_parser.h2
-rw-r--r--core/include/fpdfapi/fpdf_serial.h4
-rw-r--r--core/include/fxcrt/fx_ext.h12
-rw-r--r--core/include/fxcrt/fx_string.h2
-rw-r--r--core/include/fxcrt/fx_system.h10
-rw-r--r--core/include/fxge/fx_ge.h24
6 files changed, 26 insertions, 28 deletions
diff --git a/core/include/fpdfapi/cpdf_parser.h b/core/include/fpdfapi/cpdf_parser.h
index 4ec8d988e0..f2d7343e87 100644
--- a/core/include/fpdfapi/cpdf_parser.h
+++ b/core/include/fpdfapi/cpdf_parser.h
@@ -130,7 +130,7 @@ class CPDF_Parser {
std::map<FX_DWORD, ObjectInfo> m_ObjectInfo;
std::set<FX_FILESIZE> m_SortedOffset;
CFX_ArrayTemplate<CPDF_Dictionary*> m_Trailers;
- FX_BOOL m_bVersionUpdated;
+ bool m_bVersionUpdated;
CPDF_Object* m_pLinearized;
FX_DWORD m_dwFirstPageNo;
FX_DWORD m_dwXrefStartObjNum;
diff --git a/core/include/fpdfapi/fpdf_serial.h b/core/include/fpdfapi/fpdf_serial.h
index 8cf3fb8a1e..cb0c290783 100644
--- a/core/include/fpdfapi/fpdf_serial.h
+++ b/core/include/fpdfapi/fpdf_serial.h
@@ -26,7 +26,7 @@ class CPDF_Creator {
~CPDF_Creator();
void RemoveSecurity();
- FX_BOOL Create(IFX_StreamWrite* pFile, FX_DWORD flags = 0);
+ bool Create(IFX_StreamWrite* pFile, FX_DWORD flags = 0);
int32_t Continue(IFX_Pause* pPause = NULL);
FX_BOOL SetFileVersion(int32_t fileVersion = 17);
@@ -57,7 +57,7 @@ class CPDF_Creator {
int32_t m_ObjectStreamSize;
FX_DWORD m_dwLastObjNum;
- FX_BOOL Create(FX_DWORD flags);
+ bool Create(FX_DWORD flags);
void ResetStandardSecurity();
void Clear();
int32_t WriteDoc_Stage1(IFX_Pause* pPause);
diff --git a/core/include/fxcrt/fx_ext.h b/core/include/fxcrt/fx_ext.h
index 689d8e8fc4..dda6a5c72b 100644
--- a/core/include/fxcrt/fx_ext.h
+++ b/core/include/fxcrt/fx_ext.h
@@ -60,23 +60,19 @@ inline int FXSYS_toHexDigit(const FX_CHAR c) {
}
inline bool FXSYS_isDecimalDigit(const FX_CHAR c) {
- return std::isdigit(c);
+ return !!std::isdigit(c);
}
inline bool FXSYS_isDecimalDigit(const FX_WCHAR c) {
- return std::iswdigit(c);
+ return !!std::iswdigit(c);
}
inline int FXSYS_toDecimalDigit(const FX_CHAR c) {
- if (!std::isdigit(c))
- return 0;
- return c - '0';
+ return std::isdigit(c) ? c - '0' : 0;
}
inline int FXSYS_toDecimalDigit(const FX_WCHAR c) {
- if (!std::iswdigit(c))
- return 0;
- return c - L'0';
+ return std::iswdigit(c) ? c - L'0' : 0;
}
FX_DWORD FX_HashCode_String_GetA(const FX_CHAR* pStr,
diff --git a/core/include/fxcrt/fx_string.h b/core/include/fxcrt/fx_string.h
index ca29e1321a..d68fc2cb36 100644
--- a/core/include/fxcrt/fx_string.h
+++ b/core/include/fxcrt/fx_string.h
@@ -577,7 +577,7 @@ class CFX_WideString {
void Empty();
- FX_BOOL IsEmpty() const { return !GetLength(); }
+ bool IsEmpty() const { return !GetLength(); }
FX_STRSIZE GetLength() const { return m_pData ? m_pData->m_nDataLength : 0; }
diff --git a/core/include/fxcrt/fx_system.h b/core/include/fxcrt/fx_system.h
index 76c413e7e3..f62e126fbb 100644
--- a/core/include/fxcrt/fx_system.h
+++ b/core/include/fxcrt/fx_system.h
@@ -258,10 +258,12 @@ wchar_t* FXSYS_wcsupr(wchar_t* str);
#define FXDWORD_FROM_MSBFIRST(i) \
(((uint8_t)(i) << 24) | ((uint8_t)((i) >> 8) << 16) | \
((uint8_t)((i) >> 16) << 8) | (uint8_t)((i) >> 24))
-#define FXDWORD_GET_LSBFIRST(p) \
- ((p[3] << 24) | (p[2] << 16) | (p[1] << 8) | (p[0]))
-#define FXDWORD_GET_MSBFIRST(p) \
- ((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | (p[3]))
+#define FXDWORD_GET_LSBFIRST(p) \
+ ((static_cast<FX_DWORD>(p[3]) << 24) | (static_cast<FX_DWORD>(p[2]) << 16) | \
+ (static_cast<FX_DWORD>(p[1]) << 8) | (static_cast<FX_DWORD>(p[0])))
+#define FXDWORD_GET_MSBFIRST(p) \
+ ((static_cast<FX_DWORD>(p[0]) << 24) | (static_cast<FX_DWORD>(p[1]) << 16) | \
+ (static_cast<FX_DWORD>(p[2]) << 8) | (static_cast<FX_DWORD>(p[3])))
#define FXSYS_HIBYTE(word) ((uint8_t)((word) >> 8))
#define FXSYS_LOBYTE(word) ((uint8_t)(word))
#define FXSYS_HIWORD(dword) ((FX_WORD)((dword) >> 16))
diff --git a/core/include/fxge/fx_ge.h b/core/include/fxge/fx_ge.h
index fc9119b123..8a62f13d14 100644
--- a/core/include/fxge/fx_ge.h
+++ b/core/include/fxge/fx_ge.h
@@ -412,20 +412,20 @@ class CFX_FxgeDevice : public CFX_RenderDevice {
CFX_FxgeDevice();
~CFX_FxgeDevice() override;
- FX_BOOL Attach(CFX_DIBitmap* pBitmap,
- int dither_bits = 0,
- FX_BOOL bRgbByteOrder = FALSE,
- CFX_DIBitmap* pOriDevice = NULL,
- FX_BOOL bGroupKnockout = FALSE);
-
- FX_BOOL Create(int width,
- int height,
- FXDIB_Format format,
- int dither_bits = 0,
- CFX_DIBitmap* pOriDevice = NULL);
+ bool Attach(CFX_DIBitmap* pBitmap,
+ int dither_bits = 0,
+ bool bRgbByteOrder = false,
+ CFX_DIBitmap* pOriDevice = NULL,
+ bool bGroupKnockout = false);
+
+ bool Create(int width,
+ int height,
+ FXDIB_Format format,
+ int dither_bits = 0,
+ CFX_DIBitmap* pOriDevice = NULL);
protected:
- FX_BOOL m_bOwnedBitmap;
+ bool m_bOwnedBitmap;
};
class CFX_SkiaDevice : public CFX_RenderDevice {
public: