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>
diff --git a/core/fxcrt/fx_memory.h b/core/fxcrt/fx_memory.h
index a18d74b..fdf64db 100644
--- a/core/fxcrt/fx_memory.h
+++ b/core/fxcrt/fx_memory.h
@@ -89,15 +89,18 @@
}
// 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