git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pretend_sha1_file(): Change return type from int to void
@ 2015-10-06 12:15 Tobias Klauser
  2015-10-06 13:16 ` Johannes Schindelin
  0 siblings, 1 reply; 12+ messages in thread
From: Tobias Klauser @ 2015-10-06 12:15 UTC (permalink / raw)
  To: Junio C Hamano, git

prented_sha1_file() always returns 0 and its only callsite in
builtin/blame.c doesn't use the return value, so change the return type
to void.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
 cache.h     | 2 +-
 sha1_file.c | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/cache.h b/cache.h
index 752031e..445853b 100644
--- a/cache.h
+++ b/cache.h
@@ -970,7 +970,7 @@ extern int sha1_object_info(const unsigned char *, unsigned long *);
 extern int hash_sha1_file(const void *buf, unsigned long len, const char *type, unsigned char *sha1);
 extern int write_sha1_file(const void *buf, unsigned long len, const char *type, unsigned char *return_sha1);
 extern int hash_sha1_file_literally(const void *buf, unsigned long len, const char *type, unsigned char *sha1, unsigned flags);
-extern int pretend_sha1_file(void *, unsigned long, enum object_type, unsigned char *);
+extern void pretend_sha1_file(void *, unsigned long, enum object_type, unsigned char *);
 extern int force_object_loose(const unsigned char *sha1, time_t mtime);
 extern int git_open_noatime(const char *name);
 extern void *map_sha1_file(const unsigned char *sha1, unsigned long *size);
diff --git a/sha1_file.c b/sha1_file.c
index d295a32..d76b723 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -2789,14 +2789,14 @@ static void *read_packed_sha1(const unsigned char *sha1,
 	return data;
 }
 
-int pretend_sha1_file(void *buf, unsigned long len, enum object_type type,
+void pretend_sha1_file(void *buf, unsigned long len, enum object_type type,
 		      unsigned char *sha1)
 {
 	struct cached_object *co;
 
 	hash_sha1_file(buf, len, typename(type), sha1);
 	if (has_sha1_file(sha1) || find_cached_object(sha1))
-		return 0;
+		return;
 	ALLOC_GROW(cached_objects, cached_object_nr + 1, cached_object_alloc);
 	co = &cached_objects[cached_object_nr++];
 	co->size = len;
@@ -2804,7 +2804,6 @@ int pretend_sha1_file(void *buf, unsigned long len, enum object_type type,
 	co->buf = xmalloc(len);
 	memcpy(co->buf, buf, len);
 	hashcpy(co->sha1, sha1);
-	return 0;
 }
 
 static void *read_object(const unsigned char *sha1, enum object_type *type,
-- 
2.6.0

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-10-08  7:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-06 12:15 [PATCH] pretend_sha1_file(): Change return type from int to void Tobias Klauser
2015-10-06 13:16 ` Johannes Schindelin
2015-10-06 13:51   ` Tobias Klauser
2015-10-06 14:30     ` Johannes Schindelin
2015-10-07  8:13       ` Tobias Klauser
2015-10-07 17:36       ` Junio C Hamano
2015-10-07 20:42         ` Stefan Beller
2015-10-07 21:14           ` Junio C Hamano
2015-10-07 21:24             ` Stefan Beller
2015-10-07 21:29               ` Junio C Hamano
2015-10-07 21:22       ` Junio C Hamano
2015-10-08  7:45         ` Tobias Klauser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).