fix -Wconversion warning at struct chmod_but
patch will fix these warnings:
chmod.c:245:41: warning: implicit conversion changes signedness: 'unsigned int' to 'int' [-Wsign-conversion]
chmod.c:266:41: warning: implicit conversion changes signedness: 'unsigned int' to 'int' [-Wsign-conversion]
chmod.c:321:49: warning: implicit conversion changes signedness: 'unsigned int' to 'int' [-Wsign-conversion]
chmod.c:352:72: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
chmod.c:357:72: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
chmod.c:367:42: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
chmod.c:371:42: warning: implicit conversion changes signedness: 'int' to 'button_flags_t' [-Wsign-conversion]
patch against a5cd0093c5330ae6118cbf2830cf288dd4a68ed0
compile test with gcc 4.6/4.9/5.2 and clang 3.7
Signed-off-by: Andreas Mohr <and@gmx.li>
a
|
b
|
|
94 | 94 | /* *INDENT-ON* */ |
95 | 95 | }; |
96 | 96 | |
97 | | static const unsigned int check_perm_num = G_N_ELEMENTS (check_perm); |
| 97 | static const int check_perm_num = G_N_ELEMENTS (check_perm); |
98 | 98 | static int check_perm_len = 0; |
99 | 99 | |
100 | 100 | static const char *file_info_labels[] = { |
… |
… |
|
104 | 104 | N_("Group name:") |
105 | 105 | }; |
106 | 106 | |
107 | | static const unsigned int file_info_labels_num = G_N_ELEMENTS (file_info_labels); |
| 107 | static const int file_info_labels_num = G_N_ELEMENTS (file_info_labels); |
108 | 108 | static int file_info_labels_len = 0; |
109 | 109 | |
110 | 110 | static struct |
111 | 111 | { |
112 | 112 | int ret_cmd; |
113 | | int flags; |
| 113 | button_flags_t flags; |
114 | 114 | int y; /* vertical position relatively to dialog bottom boundary */ |
115 | 115 | int len; |
116 | 116 | const char *text; |
… |
… |
|
126 | 126 | /* *INDENT-ON* */ |
127 | 127 | }; |
128 | 128 | |
129 | | static const unsigned int chmod_but_num = G_N_ELEMENTS (chmod_but); |
| 129 | static const int chmod_but_num = G_N_ELEMENTS (chmod_but); |
130 | 130 | |
131 | 131 | /* --------------------------------------------------------------------------------------------- */ |
132 | 132 | /*** file scope functions ************************************************************************/ |
… |
… |
|
136 | 136 | chmod_i18n (void) |
137 | 137 | { |
138 | 138 | static gboolean i18n = FALSE; |
139 | | unsigned int i; |
140 | | int len; |
| 139 | int i, len; |
141 | 140 | |
142 | 141 | if (i18n) |
143 | 142 | return; |
… |
… |
|
224 | 223 | case MSG_ACTION: |
225 | 224 | { |
226 | 225 | /* handle checkboxes */ |
227 | | unsigned int i; |
| 226 | int i; |
228 | 227 | |
229 | 228 | /* close dialog due to SIGINT (ctrl-g) */ |
230 | 229 | if (sender == NULL && parm == CK_Cancel) |
… |
… |
|
253 | 252 | case MSG_KEY: |
254 | 253 | if (parm == 'T' || parm == 't' || parm == KEY_IC) |
255 | 254 | { |
256 | | unsigned int i; |
| 255 | int i; |
257 | 256 | unsigned long id; |
258 | 257 | |
259 | 258 | id = dlg_get_current_widget_id (h); |
… |
… |
|
287 | 286 | { |
288 | 287 | WDialog *ch_dlg; |
289 | 288 | int lines, cols; |
290 | | int y; |
| 289 | int i, y; |
291 | 290 | int perm_gb_len; |
292 | 291 | int file_gb_len; |
293 | | unsigned int i; |
294 | 292 | const char *c_fname, *c_fown, *c_fgrp; |
295 | 293 | char buffer[BUF_TINY]; |
296 | 294 | |
… |
… |
|
460 | 458 | WDialog *ch_dlg; |
461 | 459 | struct stat sf_stat; |
462 | 460 | char *fname; |
463 | | int result; |
464 | | unsigned int i; |
| 461 | int i, result; |
465 | 462 | |
466 | 463 | do_refresh (); |
467 | 464 | |