Skip to content

Commit d099b71

Browse files
Ramsay Jonesgitster
authored andcommitted
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 <[email protected]> Acked-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 23c339c commit d099b71

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sha1_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2477,7 +2477,7 @@ int sha1_object_info_extended(const unsigned char *sha1, struct object_info *oi)
24772477
int sha1_object_info(const unsigned char *sha1, unsigned long *sizep)
24782478
{
24792479
enum object_type type;
2480-
struct object_info oi = {0};
2480+
struct object_info oi = {NULL};
24812481

24822482
oi.typep = &type;
24832483
oi.sizep = sizep;

streaming.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ struct git_istream *open_istream(const unsigned char *sha1,
135135
struct stream_filter *filter)
136136
{
137137
struct git_istream *st;
138-
struct object_info oi = {0};
138+
struct object_info oi = {NULL};
139139
const unsigned char *real = lookup_replace_object(sha1);
140140
enum input_source src = istream_source(real, type, &oi);
141141

0 commit comments

Comments
 (0)