diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-06-10 11:09:44 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-06-10 11:09:44 -0700 |
commit | fbf266fc0ea4be2523cbb901a641aa33f0035662 (patch) | |
tree | d0e5eda4d3c220818903eca76bc2ca835a1851d0 /core/include/fxcrt/fx_system.h | |
parent | 3c949d5d2b0d680839766ea99c86b263230b263d (diff) | |
download | pdfium-fbf266fc0ea4be2523cbb901a641aa33f0035662.tar.xz |
Remove typdefs for pointer types in fx_system.h.
This involves fixing some multiple variable per line
declarations, as the textually-substituted "*" applies
only to the first one.
This involves moving some consts around following the
substitution.
This involves replacing some typedefs used as constructors
with better code.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1171733003
Diffstat (limited to 'core/include/fxcrt/fx_system.h')
-rw-r--r-- | core/include/fxcrt/fx_system.h | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/core/include/fxcrt/fx_system.h b/core/include/fxcrt/fx_system.h index 80d75908d4..ec6d6294b0 100644 --- a/core/include/fxcrt/fx_system.h +++ b/core/include/fxcrt/fx_system.h @@ -67,24 +67,13 @@ #ifdef __cplusplus extern "C" { #endif -typedef void* FX_LPVOID; // Deprecate, use with void*. -typedef const void* FX_LPCVOID; // Deprecate, use with const void*. typedef void* FX_POSITION; // Keep until fxcrt containers gone -typedef uint8_t* FX_LPBYTE; // Deprecate, use uint8_t*. -typedef const uint8_t* FX_LPCBYTE; // Deprecate, use const uint8_t*. typedef unsigned short FX_WORD; // Keep - "an efficient small type" -typedef FX_WORD* FX_LPWORD; // Deprecate, use FX_WORD*. -typedef const FX_WORD* FX_LPCWORD; // Deprecate, use const FX_WORD*. typedef unsigned int FX_DWORD; // Keep - "an efficient type" -typedef FX_DWORD* FX_LPDWORD; // Deprecate, use FX_DWORD*. typedef float FX_FLOAT; // Keep, allow upgrade to doubles. -typedef int FX_BOOL; // Sadly not always 0 or 1. +typedef int FX_BOOL; // Keep, sadly not always 0 or 1. typedef char FX_CHAR; // Keep, questionable signedness. -typedef FX_CHAR* FX_LPSTR; // Deprecate, use FX_CHAR*. -typedef const FX_CHAR* FX_LPCSTR; // Deprecate, use const FX_CHAR*. typedef wchar_t FX_WCHAR; // Keep, maybe bad platform wchars. -typedef FX_WCHAR* FX_LPWSTR; // Deprecate, use FX_WCHAR*. -typedef const FX_WCHAR* FX_LPCWSTR; // Deprecate, use const FX_WCHAR*. // PDFium string sizes are limited to 2^31-1, and the value is signed to // allow -1 as a placeholder for "unknown". @@ -158,7 +147,7 @@ void FXSYS_vsnprintf(char *str, size_t size, const char* fmt, va_list ap); #define FXSYS_wfopen _wfopen #endif #else -FXSYS_FILE* FXSYS_wfopen(FX_LPCWSTR filename, FX_LPCWSTR mode); +FXSYS_FILE* FXSYS_wfopen(const FX_WCHAR* filename, const FX_WCHAR* mode); #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ #ifdef __cplusplus @@ -249,18 +238,18 @@ wchar_t* FXSYS_wcsupr(wchar_t* str); #define FXSYS_abs abs #define FXDWORD_FROM_LSBFIRST(i) (i) #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) ((((FX_LPBYTE)(p))[3] << 24) | (((FX_LPBYTE)(p))[2] << 16) | (((FX_LPBYTE)(p))[1] << 8) | (((FX_LPBYTE)(p))[0])) -#define FXDWORD_GET_MSBFIRST(p) ((((FX_LPBYTE)(p))[0] << 24) | (((FX_LPBYTE)(p))[1] << 16) | (((FX_LPBYTE)(p))[2] << 8) | (((FX_LPBYTE)(p))[3])) +#define FXDWORD_GET_LSBFIRST(p) ((((uint8_t*)(p))[3] << 24) | (((uint8_t*)(p))[2] << 16) | (((uint8_t*)(p))[1] << 8) | (((uint8_t*)(p))[0])) +#define FXDWORD_GET_MSBFIRST(p) ((((uint8_t*)(p))[0] << 24) | (((uint8_t*)(p))[1] << 16) | (((uint8_t*)(p))[2] << 8) | (((uint8_t*)(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)) #define FXSYS_LOWORD(dword) ((FX_WORD)(dword)) -int32_t FXSYS_atoi(FX_LPCSTR str); -int32_t FXSYS_wtoi(FX_LPCWSTR str); -int64_t FXSYS_atoi64(FX_LPCSTR str); -int64_t FXSYS_wtoi64(FX_LPCWSTR str); -FX_LPCSTR FXSYS_i64toa(int64_t value, FX_LPSTR str, int radix); -FX_LPCWSTR FXSYS_i64tow(int64_t value, FX_LPWSTR str, int radix); +int32_t FXSYS_atoi(const FX_CHAR* str); +int32_t FXSYS_wtoi(const FX_WCHAR* str); +int64_t FXSYS_atoi64(const FX_CHAR* str); +int64_t FXSYS_wtoi64(const FX_WCHAR* str); +const FX_CHAR* FXSYS_i64toa(int64_t value, FX_CHAR* str, int radix); +const FX_WCHAR* FXSYS_i64tow(int64_t value, FX_WCHAR* str, int radix); int FXSYS_round(FX_FLOAT f); #define FXSYS_Mul(a, b) ((a) * (b)) #define FXSYS_Div(a, b) ((a) / (b)) |