summaryrefslogtreecommitdiff
path: root/core/include/fxcrt/fx_ext.h
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2015-08-04 13:00:21 -0700
committerNico Weber <thakis@chromium.org>2015-08-04 13:00:21 -0700
commit9d8ec5a6e37e8d1d4d4edca9040de234e2d4728f (patch)
treec97037f398d714665aefccb6eb54d0969ad7030c /core/include/fxcrt/fx_ext.h
parent780cee82236d1b3b0f9b01a22424e4b8ec9a6f12 (diff)
downloadpdfium-9d8ec5a6e37e8d1d4d4edca9040de234e2d4728f.tar.xz
XFA: clang-format all pdfium code.
No behavior change. Generated by: find . -name '*.cpp' -o -name '*.h' | \ grep -E -v 'third_party|thirdparties|lpng_v163|tiff_v403' | \ xargs ../../buildtools/mac/clang-format -i Then manually merged https://codereview.chromium.org/1269223002/ See thread "tabs vs spaces" on pdfium@googlegroups.com for discussion. BUG=none
Diffstat (limited to 'core/include/fxcrt/fx_ext.h')
-rw-r--r--core/include/fxcrt/fx_ext.h122
1 files changed, 63 insertions, 59 deletions
diff --git a/core/include/fxcrt/fx_ext.h b/core/include/fxcrt/fx_ext.h
index 55e522ad1a..0853c89531 100644
--- a/core/include/fxcrt/fx_ext.h
+++ b/core/include/fxcrt/fx_ext.h
@@ -14,33 +14,37 @@
extern "C" {
#endif
-FX_FLOAT FXSYS_tan(FX_FLOAT a);
-FX_FLOAT FXSYS_logb(FX_FLOAT b, FX_FLOAT x);
-FX_FLOAT FXSYS_strtof(const FX_CHAR* pcsStr, int32_t iLength = -1, int32_t *pUsedLen = NULL);
-FX_FLOAT FXSYS_wcstof(const FX_WCHAR* pwsStr, int32_t iLength = -1, int32_t *pUsedLen = NULL);
-FX_WCHAR* FXSYS_wcsncpy(FX_WCHAR* dstStr, const FX_WCHAR* srcStr, size_t count);
-int32_t FXSYS_wcsnicmp(const FX_WCHAR* s1, const FX_WCHAR* s2, size_t count);
-int32_t FXSYS_strnicmp(const FX_CHAR* s1, const FX_CHAR* s2, size_t count);
-
-inline FX_BOOL FXSYS_islower(int32_t ch)
-{
- return ch >= 'a' && ch <= 'z';
+FX_FLOAT FXSYS_tan(FX_FLOAT a);
+FX_FLOAT FXSYS_logb(FX_FLOAT b, FX_FLOAT x);
+FX_FLOAT FXSYS_strtof(const FX_CHAR* pcsStr,
+ int32_t iLength = -1,
+ int32_t* pUsedLen = NULL);
+FX_FLOAT FXSYS_wcstof(const FX_WCHAR* pwsStr,
+ int32_t iLength = -1,
+ int32_t* pUsedLen = NULL);
+FX_WCHAR* FXSYS_wcsncpy(FX_WCHAR* dstStr, const FX_WCHAR* srcStr, size_t count);
+int32_t FXSYS_wcsnicmp(const FX_WCHAR* s1, const FX_WCHAR* s2, size_t count);
+int32_t FXSYS_strnicmp(const FX_CHAR* s1, const FX_CHAR* s2, size_t count);
+
+inline FX_BOOL FXSYS_islower(int32_t ch) {
+ return ch >= 'a' && ch <= 'z';
}
-inline FX_BOOL FXSYS_isupper(int32_t ch)
-{
- return ch >= 'A' && ch <= 'Z';
+inline FX_BOOL FXSYS_isupper(int32_t ch) {
+ return ch >= 'A' && ch <= 'Z';
}
-inline int32_t FXSYS_tolower(int32_t ch)
-{
- return ch < 'A' || ch > 'Z' ? ch : (ch + 0x20);
+inline int32_t FXSYS_tolower(int32_t ch) {
+ return ch < 'A' || ch > 'Z' ? ch : (ch + 0x20);
}
-inline int32_t FXSYS_toupper(int32_t ch)
-{
- return ch < 'a' || ch > 'z' ? ch : (ch - 0x20);
+inline int32_t FXSYS_toupper(int32_t ch) {
+ return ch < 'a' || ch > 'z' ? ch : (ch - 0x20);
}
-FX_DWORD FX_HashCode_String_GetA(const FX_CHAR* pStr, int32_t iLength, FX_BOOL bIgnoreCase = FALSE);
-FX_DWORD FX_HashCode_String_GetW(const FX_WCHAR* pStr, int32_t iLength, FX_BOOL bIgnoreCase = FALSE);
+FX_DWORD FX_HashCode_String_GetA(const FX_CHAR* pStr,
+ int32_t iLength,
+ FX_BOOL bIgnoreCase = FALSE);
+FX_DWORD FX_HashCode_String_GetW(const FX_WCHAR* pStr,
+ int32_t iLength,
+ FX_BOOL bIgnoreCase = FALSE);
#ifdef __cplusplus
}
@@ -49,17 +53,17 @@ FX_DWORD FX_HashCode_String_GetW(const FX_WCHAR* pStr, int32_t iLength, FX_BOOL
extern "C" {
#endif
-void* FX_Random_MT_Start(FX_DWORD dwSeed);
+void* FX_Random_MT_Start(FX_DWORD dwSeed);
-FX_DWORD FX_Random_MT_Generate(void* pContext);
+FX_DWORD FX_Random_MT_Generate(void* pContext);
-void FX_Random_MT_Close(void* pContext);
+void FX_Random_MT_Close(void* pContext);
-void FX_Random_GenerateBase(FX_DWORD* pBuffer, int32_t iCount);
+void FX_Random_GenerateBase(FX_DWORD* pBuffer, int32_t iCount);
-void FX_Random_GenerateMT(FX_DWORD* pBuffer, int32_t iCount);
+void FX_Random_GenerateMT(FX_DWORD* pBuffer, int32_t iCount);
-void FX_Random_GenerateCrypto(FX_DWORD* pBuffer, int32_t iCount);
+void FX_Random_GenerateCrypto(FX_DWORD* pBuffer, int32_t iCount);
#ifdef __cplusplus
}
#endif
@@ -68,42 +72,42 @@ extern "C" {
#endif
typedef struct FX_GUID {
- FX_DWORD data1;
- FX_WORD data2;
- FX_WORD data3;
- uint8_t data4[8];
-} FX_GUID, * FX_LPGUID;
-typedef FX_GUID const * FX_LPCGUID;
-
-void FX_GUID_CreateV4(FX_LPGUID pGUID);
-
-void FX_GUID_ToString(FX_LPCGUID pGUID, CFX_ByteString &bsStr, FX_BOOL bSeparator = TRUE);
+ FX_DWORD data1;
+ FX_WORD data2;
+ FX_WORD data3;
+ uint8_t data4[8];
+} FX_GUID, *FX_LPGUID;
+typedef FX_GUID const* FX_LPCGUID;
+
+void FX_GUID_CreateV4(FX_LPGUID pGUID);
+
+void FX_GUID_ToString(FX_LPCGUID pGUID,
+ CFX_ByteString& bsStr,
+ FX_BOOL bSeparator = TRUE);
#ifdef __cplusplus
}
#endif
-template<class baseType>
-class CFX_SSortTemplate
-{
-public:
- void ShellSort(baseType *pArray, int32_t iCount)
- {
- FXSYS_assert(pArray != NULL && iCount > 0);
- int32_t i, j, gap;
- baseType v1, v2;
- gap = iCount >> 1;
- while (gap > 0) {
- for (i = gap; i < iCount; i ++) {
- j = i - gap;
- v1 = pArray[i];
- while (j > -1 && (v2 = pArray[j]) > v1) {
- pArray[j + gap] = v2;
- j -= gap;
- }
- pArray[j + gap] = v1;
- }
- gap >>= 1;
+template <class baseType>
+class CFX_SSortTemplate {
+ public:
+ void ShellSort(baseType* pArray, int32_t iCount) {
+ FXSYS_assert(pArray != NULL && iCount > 0);
+ int32_t i, j, gap;
+ baseType v1, v2;
+ gap = iCount >> 1;
+ while (gap > 0) {
+ for (i = gap; i < iCount; i++) {
+ j = i - gap;
+ v1 = pArray[i];
+ while (j > -1 && (v2 = pArray[j]) > v1) {
+ pArray[j + gap] = v2;
+ j -= gap;
}
+ pArray[j + gap] = v1;
+ }
+ gap >>= 1;
}
+ }
};
#endif // CORE_INCLUDE_FXCRT_FX_EXT_H_