Skip to contentSkip to conversation

refs.c: Fix a sparse warning

PATCH In review Ramsay Jones 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 2/6 refs.c: Fix a sparse warning

Sparse issues an "Using plain integer as NULL pointer" warning against a call to update_ref_lock() which passes '0' to the 'int *type_p' parameter. In order to suppress the warning, we simply change the argument to 'NULL'.

---
 refs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
refs.c +1 -1
index ad5d66c..3710748 100644
@@ -3235,7 +3235,7 @@ int update_ref(const char *action, const char *refname,
 	       int flags, enum action_on_err onerr)
 {
 	struct ref_lock *lock;
-	lock = update_ref_lock(refname, oldval, flags, 0, onerr);
+	lock = update_ref_lock(refname, oldval, flags, NULL, onerr);
 	if (!lock)
 		return 1;
 	return update_ref_write(action, refname, sha1, lock, onerr);
Signature · 1 line
1.8.4