[PATCH 13/28] builtin-unpack-objects.c cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Makes resolve_delta, added_object, unpack_non_delta_entry, and 
unpack_delta_entry void.

		David

Signed-off-by: David Rientjes <rientjes@xxxxxxxxxx>
---
 builtin-unpack-objects.c |   23 ++++++++++-------------
 1 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/builtin-unpack-objects.c b/builtin-unpack-objects.c
index 63f4b8e..e65f80e 100644
--- a/builtin-unpack-objects.c
+++ b/builtin-unpack-objects.c
@@ -112,9 +112,9 @@ static void write_object(void *buf, unsi
 	added_object(sha1, type, buf, size);
 }
 
-static int resolve_delta(const char *type,
-	void *base, unsigned long base_size,
-	void *delta, unsigned long delta_size)
+static void resolve_delta(const char *type,
+			  void *base, unsigned long base_size,
+			  void *delta, unsigned long delta_size)
 {
 	void *result;
 	unsigned long result_size;
@@ -127,10 +127,10 @@ static int resolve_delta(const char *typ
 	free(delta);
 	write_object(result, result_size, type);
 	free(result);
-	return 0;
 }
 
-static void added_object(unsigned char *sha1, const char *type, void *data, unsigned long size)
+static void added_object(unsigned char *sha1, const char *type, void *data,
+			 unsigned long size)
 {
 	struct delta_info **p = &delta_list;
 	struct delta_info *info;
@@ -147,7 +147,7 @@ static void added_object(unsigned char *
 	}
 }
 
-static int unpack_non_delta_entry(enum object_type kind, unsigned long size)
+static void unpack_non_delta_entry(enum object_type kind, unsigned long size)
 {
 	void *buf = get_data(size);
 	const char *type;
@@ -162,16 +162,14 @@ static int unpack_non_delta_entry(enum o
 	if (!dry_run)
 		write_object(buf, size, type);
 	free(buf);
-	return 0;
 }
 
-static int unpack_delta_entry(unsigned long delta_size)
+static void unpack_delta_entry(unsigned long delta_size)
 {
 	void *delta_data, *base;
 	unsigned long base_size;
 	char type[20];
 	unsigned char base_sha1[20];
-	int result;
 
 	memcpy(base_sha1, fill(20), 20);
 	use(20);
@@ -179,19 +177,18 @@ static int unpack_delta_entry(unsigned l
 	delta_data = get_data(delta_size);
 	if (dry_run) {
 		free(delta_data);
-		return 0;
+		return;
 	}
 
 	if (!has_sha1_file(base_sha1)) {
 		add_delta_to_list(base_sha1, delta_data, delta_size);
-		return 0;
+		return;
 	}
 	base = read_sha1_file(base_sha1, type, &base_size);
 	if (!base)
 		die("failed to read delta-pack base object %s", sha1_to_hex(base_sha1));
-	result = resolve_delta(type, base, base_size, delta_data, delta_size);
+	resolve_delta(type, base, base_size, delta_data, delta_size);
 	free(base);
-	return result;
 }
 
 static void unpack_one(unsigned nr, unsigned total)
-- 
1.4.2.g89bb-dirty

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]