diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2007-01-17 19:44:24 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2007-01-17 19:44:24 +0000 |
commit | 21fc740023b8cdaad68cbae1899dc9fc95f025b6 (patch) | |
tree | d8fd4066a98329c44e14d9a9c3cd93d68dd7b375 | |
parent | 4fa566d4adcf56d74f3ddc271fd19be61510c568 (diff) | |
download | busybox-w32-21fc740023b8cdaad68cbae1899dc9fc95f025b6.tar.gz busybox-w32-21fc740023b8cdaad68cbae1899dc9fc95f025b6.tar.bz2 busybox-w32-21fc740023b8cdaad68cbae1899dc9fc95f025b6.zip |
- constify some read-only members and remove superfluous casts
(cleanup)
-rw-r--r-- | coreutils/stty.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/coreutils/stty.c b/coreutils/stty.c index fe71f3d8a..60e485585 100644 --- a/coreutils/stty.c +++ b/coreutils/stty.c | |||
@@ -158,12 +158,12 @@ static const char stty_dec [] = "dec"; | |||
158 | 158 | ||
159 | /* Each mode */ | 159 | /* Each mode */ |
160 | struct mode_info { | 160 | struct mode_info { |
161 | const char *name; /* Name given on command line */ | 161 | const char * const name; /* Name given on command line */ |
162 | char type; /* Which structure element to change */ | 162 | const unsigned char type; /* Which structure element to change */ |
163 | char flags; /* Setting and display options */ | 163 | const unsigned char flags; /* Setting and display options */ |
164 | /* were using short here, but ppc32 was unhappy: */ | 164 | /* were using short here, but ppc32 was unhappy: */ |
165 | tcflag_t mask; /* Other bits to turn off for this mode */ | 165 | const tcflag_t mask; /* Other bits to turn off for this mode */ |
166 | tcflag_t bits; /* Bits to set for this mode */ | 166 | const tcflag_t bits; /* Bits to set for this mode */ |
167 | }; | 167 | }; |
168 | 168 | ||
169 | /* We can optimize it further by using name[8] instead of char *name */ | 169 | /* We can optimize it further by using name[8] instead of char *name */ |
@@ -324,9 +324,9 @@ enum { | |||
324 | 324 | ||
325 | /* Control character settings */ | 325 | /* Control character settings */ |
326 | struct control_info { | 326 | struct control_info { |
327 | const char *name; /* Name given on command line */ | 327 | const char * const name; /* Name given on command line */ |
328 | unsigned char saneval; /* Value to set for 'stty sane' */ | 328 | const unsigned char saneval; /* Value to set for 'stty sane' */ |
329 | unsigned char offset; /* Offset in c_cc */ | 329 | const unsigned char offset; /* Offset in c_cc */ |
330 | }; | 330 | }; |
331 | 331 | ||
332 | /* Control characters */ | 332 | /* Control characters */ |
@@ -967,10 +967,9 @@ static void display_changed(const struct termios *mode) | |||
967 | wrapf("%s = %s;", control_info[i].name, | 967 | wrapf("%s = %s;", control_info[i].name, |
968 | visible(mode->c_cc[control_info[i].offset])); | 968 | visible(mode->c_cc[control_info[i].offset])); |
969 | } | 969 | } |
970 | if ((mode->c_lflag & ICANON) == 0) { | 970 | if ((mode->c_lflag & ICANON) == 0) |
971 | wrapf("min = %d; time = %d;", (int) mode->c_cc[VMIN], | 971 | wrapf("min = %d; time = %d;", mode->c_cc[VMIN], mode->c_cc[VTIME]); |
972 | (int) mode->c_cc[VTIME]); | 972 | |
973 | } | ||
974 | if (current_col) wrapf("\n"); | 973 | if (current_col) wrapf("\n"); |
975 | 974 | ||
976 | for (i = 0; i < NUM_mode_info; ++i) { | 975 | for (i = 0; i < NUM_mode_info; ++i) { |