svn commit: trunk/busybox/e2fsprogs

vda at busybox.net vda at busybox.net
Tue Dec 26 03:02:25 UTC 2006


Author: vda
Date: 2006-12-25 19:02:25 -0800 (Mon, 25 Dec 2006)
New Revision: 17079

Log:
trivial size reduction


Modified:
   trunk/busybox/e2fsprogs/e2fs_lib.c


Changeset:
Modified: trunk/busybox/e2fsprogs/e2fs_lib.c
===================================================================
--- trunk/busybox/e2fsprogs/e2fs_lib.c	2006-12-26 02:51:29 UTC (rev 17078)
+++ trunk/busybox/e2fsprogs/e2fs_lib.c	2006-12-26 03:02:25 UTC (rev 17079)
@@ -143,31 +143,31 @@
 /* Print file attributes on an ext2 file system */
 struct flags_name {
 	unsigned long	flag;
-	const char	*short_name;
+	char		short_name;
 	const char	*long_name;
 };
 
 static const struct flags_name flags_array[] = {
-	{ EXT2_SECRM_FL, "s", "Secure_Deletion" },
-	{ EXT2_UNRM_FL, "u" , "Undelete" },
-	{ EXT2_SYNC_FL, "S", "Synchronous_Updates" },
-	{ EXT2_DIRSYNC_FL, "D", "Synchronous_Directory_Updates" },
-	{ EXT2_IMMUTABLE_FL, "i", "Immutable" },
-	{ EXT2_APPEND_FL, "a", "Append_Only" },
-	{ EXT2_NODUMP_FL, "d", "No_Dump" },
-	{ EXT2_NOATIME_FL, "A", "No_Atime" },
-	{ EXT2_COMPR_FL, "c", "Compression_Requested" },
+	{ EXT2_SECRM_FL, 's', "Secure_Deletion" },
+	{ EXT2_UNRM_FL, 'u' , "Undelete" },
+	{ EXT2_SYNC_FL, 'S', "Synchronous_Updates" },
+	{ EXT2_DIRSYNC_FL, 'D', "Synchronous_Directory_Updates" },
+	{ EXT2_IMMUTABLE_FL, 'i', "Immutable" },
+	{ EXT2_APPEND_FL, 'a', "Append_Only" },
+	{ EXT2_NODUMP_FL, 'd', "No_Dump" },
+	{ EXT2_NOATIME_FL, 'A', "No_Atime" },
+	{ EXT2_COMPR_FL, 'c', "Compression_Requested" },
 #ifdef ENABLE_COMPRESSION
-	{ EXT2_COMPRBLK_FL, "B", "Compressed_File" },
-	{ EXT2_DIRTY_FL, "Z", "Compressed_Dirty_File" },
-	{ EXT2_NOCOMPR_FL, "X", "Compression_Raw_Access" },
-	{ EXT2_ECOMPR_FL, "E", "Compression_Error" },
+	{ EXT2_COMPRBLK_FL, 'B', "Compressed_File" },
+	{ EXT2_DIRTY_FL, 'Z', "Compressed_Dirty_File" },
+	{ EXT2_NOCOMPR_FL, 'X', "Compression_Raw_Access" },
+	{ EXT2_ECOMPR_FL, 'E', "Compression_Error" },
 #endif
-	{ EXT3_JOURNAL_DATA_FL, "j", "Journaled_Data" },
-	{ EXT2_INDEX_FL, "I", "Indexed_direcctory" },
-	{ EXT2_NOTAIL_FL, "t", "No_Tailmerging" },
-	{ EXT2_TOPDIR_FL, "T", "Top_of_Directory_Hierarchies" },
-	{ 0, NULL, NULL }
+	{ EXT3_JOURNAL_DATA_FL, 'j', "Journaled_Data" },
+	{ EXT2_INDEX_FL, 'I', "Indexed_directory" },
+	{ EXT2_NOTAIL_FL, 't', "No_Tailmerging" },
+	{ EXT2_TOPDIR_FL, 'T', "Top_of_Directory_Hierarchies" },
+	{ 0, '\0', NULL }
 };
 
 void print_flags(FILE *f, unsigned long flags, unsigned options)
@@ -176,7 +176,7 @@
 
 	if (options & PFOPT_LONG) {
 		int first = 1;
-		for (fp = flags_array; fp->flag != 0; fp++) {
+		for (fp = flags_array; fp->short_name; fp++) {
 			if (flags & fp->flag) {
 				if (!first)
 					fputs(", ", f);
@@ -187,11 +187,11 @@
 		if (first)
 			fputs("---", f);
 	} else {
-		for (fp = flags_array; fp->flag != 0; fp++) {
-			const char *p = "-";
+		for (fp = flags_array; fp->short_name; fp++) {
+			char c = '-';
 			if (flags & fp->flag)
-				p = fp->short_name;
-			fputs(p, f);
+				c = fp->short_name;
+			fputc(c, f);
 		}
 	}
 }




More information about the busybox-cvs mailing list