summaryrefslogtreecommitdiff
path: root/core/include/fxcrt
diff options
context:
space:
mode:
Diffstat (limited to 'core/include/fxcrt')
-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
3 files changed, 11 insertions, 13 deletions
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))