diff options
author | Jim Meyering <meyering@redhat.com> | 2008-06-12 22:06:15 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2008-06-14 22:24:28 +0200 |
commit | 1463824d8e7f72c31f1d803d7cfe2b608ccafc5c (patch) | |
tree | 42b3f693d772028962ac11af24d4c8d937359cd8 /src/stty.c | |
parent | d42994df5d9deb7a5f6c43b5d171015535df8bcd (diff) | |
download | coreutils-1463824d8e7f72c31f1d803d7cfe2b608ccafc5c.tar.xz |
add "const" attribute, where possible
* maint.mk (sc_const_long_option): New rule. Enforce global change.
* src/base64.c (long_options): Use "const" where possible.
* src/cat.c (main): Likewise.
* src/chcon.c (long_options): Likewise.
* src/chgrp.c (long_options): Likewise.
* src/chmod.c (long_options): Likewise.
* src/chown.c (long_options): Likewise.
* src/comm.c (long_options, OUTPUT_DELIMITER_OPTION): Likewise.
* src/cp.c (long_opts): Likewise.
* src/csplit.c (longopts): Likewise.
* src/cut.c (longopts): Likewise.
* src/date.c (long_options): Likewise.
* src/dd.c (conversions, flags, statuses): Likewise.
* src/df.c (long_options): Likewise.
* src/dircolors.c (long_options): Likewise.
* src/du.c (long_options): Likewise.
* src/env.c (longopts): Likewise.
* src/expand.c (longopts): Likewise.
* src/fmt.c (long_options): Likewise.
* src/fold.c (longopts): Likewise.
* src/groups.c (longopts): Likewise.
* src/head.c (long_options): Likewise.
* src/id.c (longopts): Likewise.
* src/install.c (long_options): Likewise.
* src/join.c (longopts): Likewise.
* src/kill.c (long_options): Likewise.
* src/ln.c (long_options): Likewise.
* src/ls.c (long_time_format, long_options, sort_functions): Likewise.
* src/md5sum.c (long_options): Likewise.
* src/mkdir.c (longopts): Likewise.
* src/mkfifo.c (longopts): Likewise.
* src/mknod.c (longopts): Likewise.
* src/mktemp.c (longopts): Likewise.
* src/mv.c (long_options): Likewise.
* src/nice.c (longopts): Likewise.
* src/nl.c (longopts): Likewise.
* src/od.c (charname, long_options): Likewise.
* src/paste.c (longopts): Likewise.
* src/pathchk.c (longopts): Likewise.
* src/pinky.c (longopts): Likewise.
* src/pr.c (long_options): Likewise.
* src/ptx.c (long_options): Likewise.
* src/readlink.c (longopts): Likewise.
* src/rm.c (long_opts): Likewise.
* src/rmdir.c (longopts): Likewise.
* src/runcon.c (long_options): Likewise.
* src/seq.c (long_options): Likewise.
* src/shred.c (long_opts): Likewise.
* src/shuf.c (long_opts): Likewise.
* src/sort.c (monthtab, long_options): Likewise.
* src/split.c (longopts): Likewise.
* src/stat.c (long_options): Likewise.
* src/stty.c (mode_info, control_info, longopts, set_mode) Likewise.
(set_control_char, speeds): Likewise.
* src/su.c (longopts): Likewise.
* src/sum.c (longopts): Likewise.
* src/tac.c (longopts): Likewise.
* src/tail.c (long_options): Likewise.
* src/tee.c (long_options): Likewise.
* src/timeout.c (long_options): Likewise.
* src/touch.c (longopts): Likewise.
* src/tr.c (long_options): Likewise.
* src/truncate.c (longopts): Likewise.
* src/tty.c (longopts): Likewise.
* src/uname.c (uname_long_options, arch_long_options): Likewise.
* src/unexpand.c (longopts): Likewise.
* src/uniq.c (longopts): Likewise.
* src/wc.c (longopts): Likewise.
* src/who.c (longopts): Likewise.
Diffstat (limited to 'src/stty.c')
-rw-r--r-- | src/stty.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/stty.c b/src/stty.c index 004c3186c..548923da4 100644 --- a/src/stty.c +++ b/src/stty.c @@ -204,7 +204,7 @@ struct mode_info unsigned long mask; /* Other bits to turn off for this mode. */ }; -static struct mode_info mode_info[] = +static const struct mode_info const mode_info[] = { {"parenb", control, REV, PARENB, 0}, {"parodd", control, REV, PARODD, 0}, @@ -368,7 +368,7 @@ struct control_info /* Control characters. */ -static struct control_info control_info[] = +static const struct control_info const control_info[] = { {"intr", CINTR, VINTR}, {"quit", CQUIT, VQUIT}, @@ -418,7 +418,7 @@ static char const *visible (cc_t ch); static unsigned long int baud_to_value (speed_t speed); static bool recover_mode (char const *arg, struct termios *mode); static int screen_columns (void); -static bool set_mode (struct mode_info *info, bool reversed, +static bool set_mode (struct mode_info const *info, bool reversed, struct termios *mode); static unsigned long int integer_arg (const char *s, unsigned long int max); static speed_t string_to_baud (const char *arg); @@ -432,7 +432,7 @@ static void display_settings (enum output_type output_type, static void display_speed (struct termios *mode, bool fancy); static void display_window_size (bool fancy, char const *device_name); static void sane_mode (struct termios *mode); -static void set_control_char (struct control_info *info, +static void set_control_char (struct control_info const *info, const char *arg, struct termios *mode); static void set_speed (enum speed_setting type, const char *arg, @@ -445,7 +445,7 @@ static int max_col; /* Current position, to know when to wrap. */ static int current_col; -static struct option longopts[] = +static const struct option const longopts[] = { {"all", no_argument, NULL, 'a'}, {"save", no_argument, NULL, 'g'}, @@ -1061,7 +1061,7 @@ main (int argc, char **argv) return true. */ static bool -set_mode (struct mode_info *info, bool reversed, struct termios *mode) +set_mode (struct mode_info const *info, bool reversed, struct termios *mode) { tcflag_t *bitsp; @@ -1267,7 +1267,7 @@ set_mode (struct mode_info *info, bool reversed, struct termios *mode) } static void -set_control_char (struct control_info *info, const char *arg, +set_control_char (struct control_info const *info, const char *arg, struct termios *mode) { unsigned long int value; @@ -1716,7 +1716,7 @@ struct speed_map unsigned long int value; /* Numeric value. */ }; -static struct speed_map speeds[] = +static const struct speed_map const speeds[] = { {"0", B0, 0}, {"50", B50, 50}, |