PERFORCE change 145817 for review

Anselm Strauss strauss at FreeBSD.org
Thu Jul 24 15:30:28 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=145817

Change 145817 by strauss at strauss_marvelman on 2008/07/24 15:30:14

	Eliminated redundant type conversions (hope so ...)

Affected files ...

.. //depot/projects/soc2008/strauss_libarchive/libarchive/archive_write_set_format_zip.c#16 edit

Differences ...

==== //depot/projects/soc2008/strauss_libarchive/libarchive/archive_write_set_format_zip.c#16 (text+ko) ====

@@ -161,8 +161,8 @@
 	const char *path;
 	int ret;
 	
-	zip = (struct zip *) a->format_data;
-	d = (struct zip_data_descriptor *) &zip->data_descriptor;
+	zip = a->format_data;
+	d = &zip->data_descriptor;
 	path = archive_entry_pathname(entry);
 	
 	/* Append archive entry to the central directory data.
@@ -230,8 +230,8 @@
 	/* Write the data descripter after file data has been written. */
 	
 	int ret;
-	struct zip *zip = (struct zip *) a->format_data;
-	struct zip_data_descriptor *d = (struct zip_data_descriptor *) &zip->data_descriptor;
+	struct zip *zip = a->format_data;
+	struct zip_data_descriptor *d = &zip->data_descriptor;
 	
 	ret = (a->compressor.write)(a, d, sizeof(*d));
 	if (ret != ARCHIVE_OK)
@@ -253,8 +253,8 @@
 	int entries;
 	int ret;
 	
-	zip = (struct zip *) a->format_data;
-	l = (struct zip_file_header_link *) zip->central_directory;
+	zip = a->format_data;
+	l = zip->central_directory;
 	
 	/*
 	 * Formatting central directory file header fields that are fixed for all entries.
@@ -316,8 +316,8 @@
 	struct zip *zip;
 	struct zip_file_header_link *l;
 	
-	zip = (struct zip *)a->format_data;
-	l = (struct zip_file_header_link *) zip->central_directory;
+	zip = a->format_data;
+	l = zip->central_directory;
 	while (l != NULL) {
 		l = l->next;
 		free(l);


More information about the p4-projects mailing list