[PATCH] remove "#if 0" directives from archival/ directory

Robert P. J. Day rpjday at mindspring.com
Sat Mar 25 22:23:12 UTC 2006


diff -pru busybox.orig/archival/dpkg.c busybox/archival/dpkg.c
--- busybox.orig/archival/dpkg.c	2006-03-25 17:07:01.000000000 -0500
+++ busybox/archival/dpkg.c	2006-03-25 17:21:15.000000000 -0500
@@ -741,79 +741,6 @@ static void index_status_file(const char
 	return;
 }

-#if 0 /* this code is no longer used */
-char *get_depends_field(common_node_t *package, const int depends_type)
-{
-	char *depends = NULL;
-	char *old_sep = (char *)xcalloc(1, 3);
-	char *new_sep = (char *)xcalloc(1, 3);
-	int line_size = 0;
-	int depends_size;
-
-	int i;
-
-	for (i = 0; i < package->num_of_edges; i++) {
-		if ((package->edge[i]->type == EDGE_OR_PRE_DEPENDS) ||
-			(package->edge[i]->type == EDGE_OR_DEPENDS)) {
-		}
-
-		if ((package->edge[i]->type == depends_type) ||
-			(package->edge[i]->type == depends_type + 1)) {
-			/* Check if its the first time through */
-
-			depends_size = 8 + strlen(name_hashtable[package->edge[i]->name])
-				+ strlen(name_hashtable[package->edge[i]->version]);
-			line_size += depends_size;
-			depends = (char *) xrealloc(depends, line_size + 1);
-
-			/* Check to see if this dependency is the type we are looking for
-			 * +1 to check for 'extra' types, e.g. ored dependecies */
-			strcpy(old_sep, new_sep);
-			if (package->edge[i]->type == depends_type) {
-				strcpy(new_sep, ", ");
-			}
-			else if (package->edge[i]->type == depends_type + 1) {
-				strcpy(new_sep, "| ");
-			}
-
-			if (depends_size == line_size) {
-				strcpy(depends, "");
-			} else {
-				if ((strcmp(old_sep, "| ") == 0) && (strcmp(new_sep, "| ") == 0)) {
-					strcat(depends, " | ");
-				} else {
-					strcat(depends, ", ");
-				}
-			}
-
-			strcat(depends, name_hashtable[package->edge[i]->name]);
-			if (strcmp(name_hashtable[package->edge[i]->version], "NULL") != 0) {
-				if (package->edge[i]->operator == VER_EQUAL) {
-					strcat(depends, " (= ");
-				}
-				else if (package->edge[i]->operator == VER_LESS) {
-					strcat(depends, " (<< ");
-				}
-				else if (package->edge[i]->operator == VER_LESS_EQUAL) {
-					strcat(depends, " (<= ");
-				}
-				else if (package->edge[i]->operator == VER_MORE) {
-					strcat(depends, " (>> ");
-				}
-				else if (package->edge[i]->operator == VER_MORE_EQUAL) {
-					strcat(depends, " (>= ");
-				} else {
-					strcat(depends, " (");
-				}
-				strcat(depends, name_hashtable[package->edge[i]->version]);
-				strcat(depends, ")");
-			}
-		}
-	}
-	return(depends);
-}
-#endif
-
 static void write_buffer_no_status(FILE *new_status_file, const char *control_buffer)
 {
 	char *name;
diff -pru busybox.orig/archival/gunzip.c busybox/archival/gunzip.c
--- busybox.orig/archival/gunzip.c	2006-03-25 17:07:01.000000000 -0500
+++ busybox/archival/gunzip.c	2006-03-25 17:20:49.000000000 -0500
@@ -40,26 +40,6 @@
  * See the file algorithm.doc for the compression algorithms and file formats.
  */

-#if 0
-static char *license_msg[] = {
-	"   Copyright (C) 1992-1993 Jean-loup Gailly",
-	"   This program is free software; you can redistribute it and/or modify",
-	"   it under the terms of the GNU General Public License as published by",
-	"   the Free Software Foundation; either version 2, or (at your option)",
-	"   any later version.",
-	"",
-	"   This program is distributed in the hope that it will be useful,",
-	"   but WITHOUT ANY WARRANTY; without even the implied warranty of",
-	"   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the",
-	"   GNU General Public License for more details.",
-	"",
-	"   You should have received a copy of the GNU General Public License",
-	"   along with this program; if not, write to the Free Software",
-	"   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.",
-	0
-};
-#endif
-
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
diff -pru busybox.orig/archival/gzip.c busybox/archival/gzip.c
--- busybox.orig/archival/gzip.c	2006-03-25 17:07:01.000000000 -0500
+++ busybox/archival/gzip.c	2006-03-25 17:20:33.000000000 -0500
@@ -154,15 +154,6 @@ typedef int file_t;		/* Do not use stdio
 #define put_byte(c) {outbuf[outcnt++]=(uch)(c); if (outcnt==OUTBUFSIZ)\
    flush_outbuf();}

-
-/* Output a 32 bit value to the bit stream, lsb first */
-#if 0
-#define put_long(n) { \
-    put_short((n) & 0xffff); \
-    put_short(((ulg)(n)) >> 16); \
-}
-#endif
-
 #define seekable()    0	/* force sequential output */
 #define translate_eol 0	/* no option -a yet */

diff -pru busybox.orig/archival/libunarchive/decompress_unzip.c busybox/archival/libunarchive/decompress_unzip.c
--- busybox.orig/archival/libunarchive/decompress_unzip.c	2006-03-25 17:07:01.000000000 -0500
+++ busybox/archival/libunarchive/decompress_unzip.c	2006-03-25 17:19:50.000000000 -0500
@@ -47,26 +47,6 @@
  * See the file algorithm.doc for the compression algorithms and file formats.
  */

-#if 0
-static char *license_msg[] = {
-	"   Copyright (C) 1992-1993 Jean-loup Gailly",
-	"   This program is free software; you can redistribute it and/or modify",
-	"   it under the terms of the GNU General Public License as published by",
-	"   the Free Software Foundation; either version 2, or (at your option)",
-	"   any later version.",
-	"",
-	"   This program is distributed in the hope that it will be useful,",
-	"   but WITHOUT ANY WARRANTY; without even the implied warranty of",
-	"   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the",
-	"   GNU General Public License for more details.",
-	"",
-	"   You should have received a copy of the GNU General Public License",
-	"   along with this program; if not, write to the Free Software",
-	"   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.",
-	0
-};
-#endif
-
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <signal.h>


Signed off by: Robert P. J. Day <rpjday at mindspring.com>



More information about the busybox mailing list