threads / discuss / 362

void return diff-cache.c

Subject: void return diff-cache.c

## tl;dr

One message between Apr 28, 2005 and Apr 28, 2005.

replies: 0people: 1as markdown or json

Dan Weber· Apr 28, 2005, 01:22 UTC · lore

While compiling cogito, I got a compiler warning about returning -1 in a void function. Attached is the patch.

Dan
Can not return -1 in a void function, but we can return there

--- commit b34f64adc18ae04fe299257871a102307683d36b tree 29f7b7d146b689f7a724e94f8daddceab219942d parent 1e02ed14dc046dc47aafe93ef36587c99670a498 author Dan Weber <dan@mirrorlynx.com> 1114651105 -0400 committer Dan Weber <dan@mirrorlynx.com> 1114651105 -0400

Index: diff-cache.c
===================================================================
--- 3144235bc3b64961e133bc8e3a6b9c756923907a/diff-cache.c  (mode:100644 sha1:30804d2775d4a65a7892ae2bf0b35715812e939b)
+++ 29f7b7d146b689f7a724e94f8daddceab219942d/diff-cache.c  (mode:100644 sha1:e365f713fa28526f8a883f03a0173755987eadea)
@@ -45,7 +45,7 @@
 
 	/* New file in the index: it might actually be different in the working copy */
 	if (get_stat_data(new, &sha1, &mode) < 0)
-		return -1;
+		return;
 
 	show_file("+", new, sha1, mode);
 }

← back to recent threads