From 3c728657758e59ecb2c488580bf61b91bb1a1449 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 15 Sep 2015 19:23:32 -0700 Subject: Use sizeof T for the size of the object type --- OpenAL32/Include/alMain.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index bdc854fc..4c91336d 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -418,12 +418,12 @@ static void T##_Delete(void *ptr) { al_free(ptr); } } \ } while(0) -#define NEW_OBJ(_ptr, T) do { \ - _ptr = T##_New(sizeof(*_ptr)); \ - if(_ptr) \ +#define NEW_OBJ(_res, T) do { \ + _res = T##_New(sizeof(T)); \ + if(_res) \ { \ - memset(_ptr, 0, sizeof(*_ptr)); \ - T##_Construct(_ptr, EXTRACT_NEW_ARGS + memset(_res, 0, sizeof(T)); \ + T##_Construct(_res, EXTRACT_NEW_ARGS #ifdef __cplusplus -- cgit v1.2.3