Skip to content

Commit 09d74b3

Browse files
author
Linus Torvalds
committed
Some more sparse warning fixes
Proper function declarations and NULL pointer usage.
1 parent 6f97a89 commit 09d74b3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

diff-tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ static void call_diff_setup(void)
262262
diff_setup(reverse_diff);
263263
}
264264

265-
static int call_diff_flush()
265+
static int call_diff_flush(void)
266266
{
267267
if (detect_rename)
268268
diffcore_rename(detect_rename, diff_score_opt);

diff.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ struct diff_filespec *alloc_filespec(const char *path)
165165
spec->should_free = spec->should_munmap = 0;
166166
spec->xfrm_flags = 0;
167167
spec->size = 0;
168-
spec->data = 0;
168+
spec->data = NULL;
169169
spec->mode = 0;
170170
memset(spec->sha1, 0, 20);
171171
return spec;
@@ -296,7 +296,7 @@ void diff_free_filespec_data(struct diff_filespec *s)
296296
else if (s->should_munmap)
297297
munmap(s->data, s->size);
298298
s->should_free = s->should_munmap = 0;
299-
s->data = 0;
299+
s->data = NULL;
300300
}
301301

302302
static void prep_temp_blob(struct diff_tempfile *temp,
@@ -444,7 +444,7 @@ static void run_external_diff(const char *name,
444444
*arg++ = other;
445445
*arg++ = xfrm_msg;
446446
}
447-
*arg = 0;
447+
*arg = NULL;
448448
execvp(pgm, (char *const*) exec_arg);
449449
}
450450
else
@@ -501,7 +501,7 @@ struct diff_filepair *diff_queue(struct diff_queue_struct *queue,
501501
struct diff_filepair *dp = xmalloc(sizeof(*dp));
502502
dp->one = one;
503503
dp->two = two;
504-
dp->xfrm_msg = 0;
504+
dp->xfrm_msg = NULL;
505505
dp->orig_order = queue->nr;
506506
dp->xfrm_work = 0;
507507
diff_q(queue, dp);

0 commit comments

Comments
 (0)