From f1424e7a0dd7149d0a5836c1ac593067ad463172 Mon Sep 17 00:00:00 2001
From: Andreas Mohr <and@gmx.li>
Date: Wed, 3 Jan 2018 22:46:59 +0000
Subject: [PATCH] (utilunix.c): Cleanup implicit-fallthrough warnings
Found by GCC 7.2.0
Signed-off-by: Andreas Mohr <and@gmx.li>
---
src/filemanager/info.c | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/src/filemanager/info.c b/src/filemanager/info.c
index fab943822..1bfc7e593 100644
a
|
b
|
info_show_info (WInfo * info) |
153 | 153 | /* Note: all cases are fall-throughs */ |
154 | 154 | |
155 | 155 | default: |
156 | | |
| 156 | MC_FALLTHROUGH; |
157 | 157 | case 16: |
158 | 158 | widget_move (w, 16, 3); |
159 | 159 | if ((myfs_stats.nfree == 0 && myfs_stats.nodes == 0) || |
… |
… |
info_show_info (WInfo * info) |
169 | 169 | myfs_stats.nfree, myfs_stats.nodes, |
170 | 170 | myfs_stats.nodes == 0 ? 0 : |
171 | 171 | (int) (100 * (long double) myfs_stats.nfree / myfs_stats.nodes)); |
172 | | |
| 172 | MC_FALLTHROUGH; |
173 | 173 | case 15: |
174 | 174 | widget_move (w, 15, 3); |
175 | 175 | if (myfs_stats.avail == 0 && myfs_stats.total == 0) |
… |
… |
info_show_info (WInfo * info) |
184 | 184 | myfs_stats.total == 0 ? 0 : |
185 | 185 | (int) (100 * (long double) myfs_stats.avail / myfs_stats.total)); |
186 | 186 | } |
187 | | |
| 187 | MC_FALLTHROUGH; |
188 | 188 | case 14: |
189 | 189 | widget_move (w, 14, 3); |
190 | 190 | tty_printf (_("Type: %s"), |
191 | 191 | myfs_stats.typename ? myfs_stats.typename : _("non-local vfs")); |
192 | 192 | if (myfs_stats.type != 0xffff && myfs_stats.type != -1) |
193 | 193 | tty_printf (" (%Xh)", (unsigned int) myfs_stats.type); |
194 | | |
| 194 | MC_FALLTHROUGH; |
195 | 195 | case 13: |
196 | 196 | widget_move (w, 13, 3); |
197 | 197 | str_printf (buff, _("Device: %s"), |
198 | 198 | str_trunc (myfs_stats.device, w->cols - i18n_adjust)); |
199 | 199 | tty_print_string (buff->str); |
200 | 200 | g_string_set_size (buff, 0); |
| 201 | MC_FALLTHROUGH; |
201 | 202 | case 12: |
202 | 203 | widget_move (w, 12, 3); |
203 | 204 | str_printf (buff, _("Filesystem: %s"), |
204 | 205 | str_trunc (myfs_stats.mpoint, w->cols - i18n_adjust)); |
205 | 206 | tty_print_string (buff->str); |
206 | 207 | g_string_set_size (buff, 0); |
| 208 | MC_FALLTHROUGH; |
207 | 209 | case 11: |
208 | 210 | widget_move (w, 11, 3); |
209 | 211 | str_printf (buff, _("Accessed: %s"), file_date (st.st_atime)); |
210 | 212 | tty_print_string (buff->str); |
211 | 213 | g_string_set_size (buff, 0); |
| 214 | MC_FALLTHROUGH; |
212 | 215 | case 10: |
213 | 216 | widget_move (w, 10, 3); |
214 | 217 | str_printf (buff, _("Modified: %s"), file_date (st.st_mtime)); |
215 | 218 | tty_print_string (buff->str); |
216 | 219 | g_string_set_size (buff, 0); |
| 220 | MC_FALLTHROUGH; |
217 | 221 | case 9: |
218 | 222 | widget_move (w, 9, 3); |
219 | 223 | /* The field st_ctime is changed by writing or by setting inode |
… |
… |
info_show_info (WInfo * info) |
222 | 226 | str_printf (buff, _("Changed: %s"), file_date (st.st_ctime)); |
223 | 227 | tty_print_string (buff->str); |
224 | 228 | g_string_set_size (buff, 0); |
225 | | |
| 229 | MC_FALLTHROUGH; |
226 | 230 | case 8: |
227 | 231 | widget_move (w, 8, 3); |
228 | 232 | #ifdef HAVE_STRUCT_STAT_ST_RDEV |
… |
… |
info_show_info (WInfo * info) |
240 | 244 | (unsigned long) st.st_blocks), (unsigned long) st.st_blocks); |
241 | 245 | #endif |
242 | 246 | } |
243 | | |
| 247 | MC_FALLTHROUGH; |
244 | 248 | case 7: |
245 | 249 | widget_move (w, 7, 3); |
246 | 250 | tty_printf (_("Owner: %s/%s"), get_owner (st.st_uid), get_group (st.st_gid)); |
247 | | |
| 251 | MC_FALLTHROUGH; |
248 | 252 | case 6: |
249 | 253 | widget_move (w, 6, 3); |
250 | 254 | tty_printf (_("Links: %d"), (int) st.st_nlink); |
251 | | |
| 255 | MC_FALLTHROUGH; |
252 | 256 | case 5: |
253 | 257 | widget_move (w, 5, 3); |
254 | 258 | tty_printf (_("Mode: %s (%04o)"), |
255 | 259 | string_perm (st.st_mode), (unsigned) st.st_mode & 07777); |
256 | | |
| 260 | MC_FALLTHROUGH; |
257 | 261 | case 4: |
258 | 262 | widget_move (w, 4, 3); |
259 | 263 | tty_printf (_("Location: %Xh:%Xh"), (unsigned int) st.st_dev, (unsigned int) st.st_ino); |
260 | | |
| 264 | MC_FALLTHROUGH; |
261 | 265 | case 3: |
262 | 266 | { |
263 | 267 | const char *fname; |
… |
… |
info_show_info (WInfo * info) |
267 | 271 | str_printf (buff, file_label, str_trunc (fname, w->cols - i18n_adjust)); |
268 | 272 | tty_print_string (buff->str); |
269 | 273 | } |
270 | | |
| 274 | MC_FALLTHROUGH; |
271 | 275 | case 2: |
| 276 | MC_FALLTHROUGH; |
272 | 277 | case 1: |
| 278 | MC_FALLTHROUGH; |
273 | 279 | case 0: |
274 | 280 | ; |
275 | 281 | } /* switch */ |