From 407b8c0b7001b60f79181d62eb57e810f75e0e27 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Tue, 26 Dec 2006 03:02:25 +0000 Subject: [PATCH] trivial size reduction --- e2fsprogs/e2fs_lib.c | 48 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/e2fsprogs/e2fs_lib.c b/e2fsprogs/e2fs_lib.c index cdf97352a..ea5c8026c 100644 --- a/e2fsprogs/e2fs_lib.c +++ b/e2fsprogs/e2fs_lib.c @@ -143,31 +143,31 @@ int fgetsetflags(const char *name, unsigned long *get_flags, unsigned long set_f /* 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 @@ void print_flags(FILE *f, unsigned long flags, unsigned options) 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 @@ void print_flags(FILE *f, unsigned long flags, unsigned options) 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); } } }