From: Jim Meyering Date: Tue, 25 Jul 2006 15:13:56 +0000 (+0000) Subject: * src/ls.c: Declare stat_failed to be "bool", not "int" everywhere. X-Git-Tag: v6.0~101 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a321dfb09d5bdf5a5b2bd91db42d0ea51b29972e;p=thirdparty%2Fcoreutils.git * src/ls.c: Declare stat_failed to be "bool", not "int" everywhere. --- diff --git a/ChangeLog b/ChangeLog index efa9008d53..f5fda0a639 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2006-07-25 Jim Meyering + * src/ls.c: Declare stat_failed to be "bool", not "int" everywhere. + * src/ls.c [enum filetype] (command_line): Remove member. Not needed. Replace all occurrences of "type == command_line" with the equivalent, "command_line_arg". diff --git a/src/ls.c b/src/ls.c index 30aad77d34..457256d5b0 100644 --- a/src/ls.c +++ b/src/ls.c @@ -172,7 +172,7 @@ struct fileinfo char *name; struct stat stat; - int stat_failed; + bool stat_failed; /* For symbolic link, name of the file linked to, otherwise zero. */ char *linkname; @@ -228,7 +228,7 @@ static uintmax_t gobble_file (char const *name, enum filetype type, ino_t inode, bool command_line_arg, char const *dirname); static void print_color_indicator (const char *name, mode_t mode, int linkok, - int stat_failed); + bool stat_failed); static void put_indicator (const struct bin_str *ind); static void add_ignore_pattern (const char *pattern); static void attach (char *dest, const char *dirname, const char *name); @@ -249,7 +249,7 @@ static int format_group_width (gid_t g); static void print_long_format (const struct fileinfo *f); static void print_many_per_line (void); static void print_name_with_quoting (const char *p, mode_t mode, - int linkok, int stat_failed, + int linkok, bool stat_failed, struct obstack *stack); static void prep_non_filename_text (void); static void print_type_indicator (mode_t mode); @@ -3288,7 +3288,7 @@ format_user_or_group (char const *name, unsigned long int id, int width) WIDTH. */ static void -format_user (uid_t u, int width, int stat_failed) +format_user (uid_t u, int width, bool stat_failed) { format_user_or_group (stat_failed ? "?" : (numeric_ids ? NULL : getuser (u)), u, width); @@ -3297,7 +3297,7 @@ format_user (uid_t u, int width, int stat_failed) /* Likewise, for groups. */ static void -format_group (gid_t g, int width, int stat_failed) +format_group (gid_t g, int width, bool stat_failed) { format_user_or_group (stat_failed ? "?" : (numeric_ids ? NULL : getgroup (g)), g, width); @@ -3721,7 +3721,7 @@ quote_name (FILE *out, const char *name, struct quoting_options const *options, static void print_name_with_quoting (const char *p, mode_t mode, int linkok, - int stat_failed, struct obstack *stack) + bool stat_failed, struct obstack *stack) { if (print_with_color) print_color_indicator (p, mode, linkok, stat_failed); @@ -3815,7 +3815,7 @@ print_type_indicator (mode_t mode) static void print_color_indicator (const char *name, mode_t mode, int linkok, - int stat_failed) + bool stat_failed) { int type = C_FILE; struct color_ext_type *ext; /* Color extension */