@@ -77,10 +77,10 @@ enum {
77
77
78
78
/* column names */
79
79
struct colinfo {
80
- const char * name ; /* header */
81
- double whint ; /* width hint (N < 1 is in percent of termwidth) */
82
- int flags ; /* SCOLS_FL_* */
83
- const char * help ;
80
+ const char * const name ; /* header */
81
+ double whint ; /* width hint (N < 1 is in percent of termwidth) */
82
+ int flags ; /* SCOLS_FL_* */
83
+ const char * help ;
84
84
};
85
85
86
86
enum {
92
92
COL_UUID ,
93
93
COL_LABEL
94
94
};
95
- static struct colinfo infos [] = {
95
+ static const struct colinfo infos [] = {
96
96
[COL_PATH ] = { "NAME" , 0.20 , 0 , N_ ("device file or partition path" ) },
97
97
[COL_TYPE ] = { "TYPE" , 0.20 , SCOLS_FL_TRUNC , N_ ("type of the device" )},
98
98
[COL_SIZE ] = { "SIZE" , 0.20 , SCOLS_FL_RIGHT , N_ ("size of the swap area" )},
@@ -159,7 +159,7 @@ static inline int get_column_id(const struct swapon_ctl *ctl, int num)
159
159
return ctl -> columns [num ];
160
160
}
161
161
162
- static inline struct colinfo * get_column_info (const struct swapon_ctl * ctl , unsigned num )
162
+ static inline const struct colinfo * get_column_info (const struct swapon_ctl * ctl , unsigned num )
163
163
{
164
164
return & infos [get_column_id (ctl , num )];
165
165
}
@@ -299,7 +299,7 @@ static int show_table(struct swapon_ctl *ctl)
299
299
scols_table_enable_noheadings (table , ctl -> no_heading );
300
300
301
301
for (i = 0 ; i < ctl -> ncolumns ; i ++ ) {
302
- struct colinfo * col = get_column_info (ctl , i );
302
+ const struct colinfo * col = get_column_info (ctl , i );
303
303
304
304
if (!scols_table_new_column (table , col -> name , col -> whint , col -> flags ))
305
305
err (EXIT_FAILURE , _ ("failed to allocate output column" ));
0 commit comments