From 241c957d899fe829bf5754e8589e357ce9496783 Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Sat, 27 Apr 2013 19:45:02 +0100 Subject: compat/nedmalloc: Fix some sparse warnings Sparse issues many "Using plain integer as NULL pointer" warnings while checking nedmalloc.c (at least 98 such warnings before giving up due to "too many warnings"). In addition, sparse issues some "non-ANSI function declaration" type warnings for the symbols 'win32_getcurrentthreadid', 'malloc_stats' and 'malloc_footprint'. In order to suppress the NULL pointer warnings, rather than replace all uses of '0' as a null pointer representation with NULL, we add -Wno-non-pointer-null to SPARSE_FLAGS while checking nedmalloc.c. In order to suppress the "non-ANSI function declaration" warnings, we simply include the missing 'empty parameter list' prototype (void) in the function declarations. Signed-off-by: Ramsay Jones Signed-off-by: Junio C Hamano --- compat/nedmalloc/malloc.c.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compat/nedmalloc/malloc.c.h') diff --git a/compat/nedmalloc/malloc.c.h b/compat/nedmalloc/malloc.c.h index 1401a67274..fdcca82ba7 100644 --- a/compat/nedmalloc/malloc.c.h +++ b/compat/nedmalloc/malloc.c.h @@ -1802,7 +1802,7 @@ struct win32_mlock_t static MLOCK_T malloc_global_mutex = { 0, 0, 0}; -static FORCEINLINE long win32_getcurrentthreadid() { +static FORCEINLINE long win32_getcurrentthreadid(void) { #ifdef _MSC_VER #if defined(_M_IX86) long *threadstruct=(long *)__readfsdword(0x18); -- cgit v1.3