From b29f23f7e7c791e7d8786de93d630a12e4250c71 Mon Sep 17 00:00:00 2001 From: Rahul Chaudhry Date: Wed, 9 Nov 2016 13:17:01 -0800 Subject: Use static_cast to cast pointers returned by malloc/calloc/realloc/mmap. static_cast is preferable to reinterpret_cast when casting from void* pointers returned by malloc/calloc/realloc/mmap calls. Discovered while looking at compiler warnings (b/26936282). Test: WITH_TIDY=1 WITH_STATIC_ANALYZER=1 mma Change-Id: Iaffd537784aa857108f6981fdfd82d0496eb5592 Merged-In: I151642d5a60c94f312d0611576ad0143c249ba3d --- minadbd/minadbd_services.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'minadbd') diff --git a/minadbd/minadbd_services.cpp b/minadbd/minadbd_services.cpp index 003b51913..426d982eb 100644 --- a/minadbd/minadbd_services.cpp +++ b/minadbd/minadbd_services.cpp @@ -66,7 +66,7 @@ static int create_service_thread(void (*func)(int, void *), void *cookie) { return -1; } - stinfo* sti = reinterpret_cast(malloc(sizeof(stinfo))); + stinfo* sti = static_cast(malloc(sizeof(stinfo))); if(sti == 0) fatal("cannot allocate stinfo"); sti->func = func; sti->cookie = cookie; -- cgit v1.2.3