schedsvc: Simplify and standardize the heap_xxx() declarations.
Francois Gouget
fgouget at free.fr
Wed Feb 8 10:56:06 CST 2017
Signed-off-by: Francois Gouget <fgouget at free.fr>
---
This integrates __WINE_ALLOC_SIZE on the same line as the main function
declaration which makes it easier to check if the attribute is present
via a simple grep. It also standardizes the function order to make it
easier to compare the variants.
dlls/schedsvc/schedsvc_private.h | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/dlls/schedsvc/schedsvc_private.h b/dlls/schedsvc/schedsvc_private.h
index 4138aa061cf..3abce07dcd6 100644
--- a/dlls/schedsvc/schedsvc_private.h
+++ b/dlls/schedsvc/schedsvc_private.h
@@ -23,22 +23,19 @@
void schedsvc_auto_start(void) DECLSPEC_HIDDEN;
-static void *heap_alloc_zero(SIZE_T size) __WINE_ALLOC_SIZE(1);
-static inline void *heap_alloc_zero(SIZE_T size)
+static inline void* __WINE_ALLOC_SIZE(1) heap_alloc(SIZE_T size)
{
- void *ptr = MIDL_user_allocate(size);
- if (ptr) memset(ptr, 0, size);
- return ptr;
+ return MIDL_user_allocate(size);
}
-static void *heap_alloc(SIZE_T size) __WINE_ALLOC_SIZE(1);
-static inline void *heap_alloc(SIZE_T size)
+static inline void* __WINE_ALLOC_SIZE(1) heap_alloc_zero(SIZE_T size)
{
- return MIDL_user_allocate(size);
+ void *ptr = MIDL_user_allocate(size);
+ if (ptr) memset(ptr, 0, size);
+ return ptr;
}
-static void *heap_realloc(void *ptr, SIZE_T size) __WINE_ALLOC_SIZE(2);
-static inline void *heap_realloc(void *ptr, SIZE_T size)
+static inline void* __WINE_ALLOC_SIZE(2) heap_realloc(void *ptr, SIZE_T size)
{
return HeapReAlloc(GetProcessHeap(), 0, ptr, size);
}
--
2.11.0
More information about the wine-patches
mailing list