Fix some sparse warnings
Sparse issues some "Using plain integer as NULL pointer" warnings. Each warning relates to the use of an '{0}' initialiser expression in the declaration of an 'struct object_info'. The first field of this structure has pointer type. Thus, in order to suppress these warnings, we replace the initialiser expression with '{NULL}'. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ramsay Jones committed
Jul 18, 2013 at 21:25 UTC
d099b7173dabdeeb1f339151ac2169b3a91bf631
2 files changed
+2
-2
sha1_file.c
+1
-1
@@ -2477,7 +2477,7 @@ int sha1_object_info_extended(const unsigned char *sha1, struct object_info *oi)
2477
int sha1_object_info(const unsigned char *sha1, unsigned long *sizep)
2478
{
2479
enum object_type type;
2480
- struct object_info oi = {0};
2480
+ struct object_info oi = {NULL};
2481
2482
oi.typep = &type;
2483
oi.sizep = sizep;
streaming.c
+1
-1
@@ -135,7 +135,7 @@ struct git_istream *open_istream(const unsigned char *sha1,
135
struct stream_filter *filter)
136
{
137
struct git_istream *st;
138
- struct object_info oi = {0};
138
+ struct object_info oi = {NULL};
139
const unsigned char *real = lookup_replace_object(sha1);
140
enum input_source src = istream_source(real, type, &oi);
141