summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_memory.h
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2017-07-06 15:42:08 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-07-07 15:06:33 +0000
commit740319850255d4fabf6e3cf4d37ca77857760b8b (patch)
treea3119a2e84628fc149afb3fe060526ef24a10887 /core/fxcrt/fx_memory.h
parent2b44441b1b01a809b6f14d44d64db9a52808cba9 (diff)
downloadpdfium-740319850255d4fabf6e3cf4d37ca77857760b8b.tar.xz
Convert c-style casts in fx_memory.h into static_casts
Change-Id: I53da7a36ce8503abd99f2525e8a5b394ee547b47 Reviewed-on: https://pdfium-review.googlesource.com/7353 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fxcrt/fx_memory.h')
-rw-r--r--core/fxcrt/fx_memory.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/core/fxcrt/fx_memory.h b/core/fxcrt/fx_memory.h
index a18d74bb23..fdf64db190 100644
--- a/core/fxcrt/fx_memory.h
+++ b/core/fxcrt/fx_memory.h
@@ -89,15 +89,18 @@ inline void* FX_ReallocOrDie(void* ptr,
}
// These never return nullptr.
-#define FX_Alloc(type, size) (type*)FX_AllocOrDie(size, sizeof(type))
-#define FX_Alloc2D(type, w, h) (type*)FX_AllocOrDie2D(w, h, sizeof(type))
+#define FX_Alloc(type, size) \
+ static_cast<type*>(FX_AllocOrDie(size, sizeof(type)))
+#define FX_Alloc2D(type, w, h) \
+ static_cast<type*>(FX_AllocOrDie2D(w, h, sizeof(type)))
#define FX_Realloc(type, ptr, size) \
- (type*)FX_ReallocOrDie(ptr, size, sizeof(type))
+ static_cast<type*>(FX_ReallocOrDie(ptr, size, sizeof(type)))
// May return nullptr.
-#define FX_TryAlloc(type, size) (type*)FX_SafeAlloc(size, sizeof(type))
+#define FX_TryAlloc(type, size) \
+ static_cast<type*>(FX_SafeAlloc(size, sizeof(type)))
#define FX_TryRealloc(type, ptr, size) \
- (type*)FX_SafeRealloc(ptr, size, sizeof(type))
+ static_cast<type*>(FX_SafeRealloc(ptr, size, sizeof(type)))
inline void FX_Free(void* ptr) {
// TODO(palmer): Removing this check exposes crashes when PDFium callers