From 1e4cd68c0041d4c6aaa0562a4528a030944d37ee Mon Sep 17 00:00:00 2001 From: Stephen Boyd Date: Sun, 3 Apr 2011 00:06:54 -0700 Subject: sparse: Fix errors and silence warnings * load_file() returns a void pointer but is using 0 for the return value * builtin/receive-pack.c forgot to include builtin.h * packet_trace_prefix can be marked static * ll_merge takes a pointer for its last argument, not an int * crc32 expects a pointer as the second argument but Z_NULL is defined to be 0 (see 38f4d13 sparse fix: Using plain integer as NULL pointer, 2006-11-18 for more info) Signed-off-by: Stephen Boyd Signed-off-by: Junio C Hamano --- builtin/grep.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'builtin/grep.c') diff --git a/builtin/grep.c b/builtin/grep.c index 891e5eab3..10a1f6531 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -414,10 +414,10 @@ static void *load_file(const char *filename, size_t *sz) err_ret: if (errno != ENOENT) error(_("'%s': %s"), filename, strerror(errno)); - return 0; + return NULL; } if (!S_ISREG(st.st_mode)) - return 0; + return NULL; *sz = xsize_t(st.st_size); i = open(filename, O_RDONLY); if (i < 0) @@ -427,7 +427,7 @@ static void *load_file(const char *filename, size_t *sz) error(_("'%s': short read %s"), filename, strerror(errno)); close(i); free(data); - return 0; + return NULL; } close(i); data[*sz] = 0; -- cgit v1.2.1