From: Zbigniew Jędrzejewski-Szmek Date: Wed, 20 Nov 2024 13:14:52 +0000 (+0100) Subject: Drop pointless bitfields X-Git-Tag: v2.42-start~137^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=63d7937180fcce4ea7fc1d2855872e464f06e779;p=thirdparty%2Futil-linux.git Drop pointless bitfields Bitfields have their uses, but the uses here didn't make any sense. Code generated to read or write bitfields is more complicated (and slower) because, well, the bits need to be manipulated with special instructions. So bitfields should be used when we have a structure that is repeated hundreds or thousands of times in memory and those saving are higher than the cost of having more complicated code. This can happen for example in the kernel code. But the code here has structures that are instantiated once or or at most few times. In addition, a bitfield often does not save any memory because of alignment requirements. In the majority of cases modified here, the bitfield was the last field in a structure, so no memory savings were made. $ size build*/{mkswap,more,ul,col,rtcwake,lsmem,lscpu,eject,dmesg,uuidd,taskset,login} text data bss dec hex filename 132014 1988 88 134090 20bca build/mkswap 129342 1852 88 131282 200d2 build2/mkswap 55161 1480 128 56769 ddc1 build/more 54265 1480 128 55873 da41 build2/more 14364 868 112 15344 3bf0 build/ul 14316 868 112 15296 3bc0 build2/ul 28547 1000 112 29659 73db build/col 28435 1000 112 29547 736b build2/col 46914 1960 112 48986 bf5a build/rtcwake 46834 1960 112 48906 bf0a build2/rtcwake 63419 1744 176 65339 ff3b build/lsmem 63403 1744 176 65323 ff2b build2/lsmem 159885 2864 464 163213 27d8d build/lscpu 159757 2864 464 163085 27d0d build2/lscpu 90041 1704 88 91833 166b9 build/eject 89737 1704 88 91529 16589 build2/eject 82150 5152 1032 88334 1590e build/dmesg 81846 5152 1032 88030 157de build2/dmesg 37601 1368 80 39049 9889 build/uuidd 37585 1368 80 39033 9879 build2/uuidd 58906 1336 56 60298 eb8a build/taskset 58890 1336 56 60282 eb7a build2/taskset 84761 2128 152 87041 15401 build/login 84672 2128 152 86952 153a8 build2/login (To be clear: those small savings are not particularly important. The motivation for this patch is to eradicate the antipattern of making things more complicated without any benefit.) --- diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c index 948957c5e..4018f4d3d 100644 --- a/disk-utils/cfdisk.c +++ b/disk-utils/cfdisk.c @@ -247,10 +247,10 @@ struct cfdisk { struct libmnt_table *fstab; struct libmnt_cache *mntcache; #endif - unsigned int wrong_order :1, /* PT not in right order */ - zero_start :1, /* ignore existing partition table */ - device_is_used : 1, /* don't use re-read ioctl */ - show_extra :1; /* show extra partinfo */ + bool wrong_order, /* PT not in right order */ + zero_start, /* ignore existing partition table */ + device_is_used, /* don't use re-read ioctl */ + show_extra; /* show extra partinfo */ }; diff --git a/disk-utils/fsck.c b/disk-utils/fsck.c index 5c0905872..beccb1750 100644 --- a/disk-utils/fsck.c +++ b/disk-utils/fsck.c @@ -99,9 +99,9 @@ struct fsck_fs_data { const char *device; dev_t disk; - unsigned int stacked:1, - done:1, - eval_device:1; + bool stacked, + done, + eval_device; }; /* diff --git a/disk-utils/mkfs.minix.c b/disk-utils/mkfs.minix.c index f6f2f4896..328dc8887 100644 --- a/disk-utils/mkfs.minix.c +++ b/disk-utils/mkfs.minix.c @@ -58,6 +58,7 @@ * */ +#include #include #include #include @@ -117,8 +118,7 @@ struct fs_control { size_t fs_dirsize; /* maximum size of directory */ unsigned long fs_inodes; /* number of inodes */ int fs_magic; /* file system magic number */ - unsigned int - check_blocks:1; /* check for bad blocks */ + bool check_blocks; /* check for bad blocks */ }; static char root_block[MINIX_BLOCK_SIZE]; diff --git a/disk-utils/mkswap.c b/disk-utils/mkswap.c index ca1f07b86..b1f3a3285 100644 --- a/disk-utils/mkswap.c +++ b/disk-utils/mkswap.c @@ -15,6 +15,7 @@ * Copyright (C) 2007-2014 Karel Zak */ +#include #include #include #include @@ -94,11 +95,11 @@ struct mkswap_control { enum ENDIANNESS endianness; - unsigned int check:1, /* --check */ - verbose:1, /* --verbose */ - quiet:1, /* --quiet */ - force:1, /* --force */ - file:1; /* --file */ + bool check, /* --check */ + verbose, /* --verbose */ + quiet, /* --quiet */ + force, /* --force */ + file; /* --file */ }; static uint32_t cpu32_to_endianness(uint32_t v, enum ENDIANNESS e) diff --git a/include/loopdev.h b/include/loopdev.h index d10bf7f37..e5ec1c98a 100644 --- a/include/loopdev.h +++ b/include/loopdev.h @@ -5,6 +5,7 @@ #ifndef UTIL_LINUX_LOOPDEV_H #define UTIL_LINUX_LOOPDEV_H +#include #include "sysfs.h" /* @@ -95,8 +96,8 @@ struct loopdev_iter { int ct_perm; /* count permission problems */ int ct_succ; /* count number of detected devices */ - unsigned int done:1; /* scanning done */ - unsigned int default_check:1;/* check first LOOPDEV_NLOOPS */ + bool done; /* scanning done */ + bool default_check; /* check first LOOPDEV_NLOOPS */ int flags; /* LOOPITER_FL_* flags */ }; @@ -117,11 +118,11 @@ struct loopdev_cxt { uint64_t blocksize; /* used by loopcxt_setup_device() */ int flags; /* LOOPDEV_FL_* flags */ - unsigned int has_info:1; /* .info contains data */ - unsigned int extra_check:1; /* unusual stuff for iterator */ - unsigned int info_failed:1; /* LOOP_GET_STATUS ioctl failed */ - unsigned int control_ok:1; /* /dev/loop-control success */ - unsigned int is_lost:1; /* device in /sys, but missing in /dev */ + bool has_info; /* .info contains data */ + bool extra_check; /* unusual stuff for iterator */ + bool info_failed; /* LOOP_GET_STATUS ioctl failed */ + bool control_ok; /* /dev/loop-control success */ + bool is_lost; /* device in /sys, but missing in /dev */ struct path_cxt *sysfs; /* pointer to /sys/dev/block// */ struct loop_config config; /* for GET/SET ioctl */ diff --git a/include/pty-session.h b/include/pty-session.h index 734a7f689..af54197b3 100644 --- a/include/pty-session.h +++ b/include/pty-session.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -86,11 +87,11 @@ struct ul_pty { struct ul_pty_child_buffer *next; char buf[BUFSIZ]; size_t size, cursor; - unsigned int final_input:1; /* drain child before writing */ + bool final_input; /* drain child before writing */ } *child_buffer_head, *child_buffer_tail, *free_buffers; - unsigned int isterm:1, /* is stdin terminal? */ - slave_echo:1; /* keep ECHO on pty slave */ + bool isterm, /* is stdin terminal? */ + slave_echo; /* keep ECHO on pty slave */ }; void ul_pty_init_debug(int mask); diff --git a/lib/pager.c b/lib/pager.c index 15a5e2736..20002acda 100644 --- a/lib/pager.c +++ b/lib/pager.c @@ -11,6 +11,7 @@ */ #include +#include #include #include #include @@ -44,7 +45,7 @@ struct child_process { struct sigaction orig_sigquit; struct sigaction orig_sigpipe; - unsigned no_stdin:1; + bool no_stdin; void (*preexec_cb)(void); }; static struct child_process pager_process; diff --git a/libfdisk/src/fdiskP.h b/libfdisk/src/fdiskP.h index c97272656..1f44996af 100644 --- a/libfdisk/src/fdiskP.h +++ b/libfdisk/src/fdiskP.h @@ -11,6 +11,7 @@ #define _LIBFDISK_PRIVATE_H #include +#include #include #include #include @@ -300,8 +301,8 @@ struct fdisk_label { struct fdisk_geometry geom_min; /* minimal geometry */ struct fdisk_geometry geom_max; /* maximal geometry */ - unsigned int changed:1, /* label has been modified */ - disabled:1; /* this driver is disabled at all */ + bool changed, /* label has been modified */ + disabled; /* this driver is disabled at all */ const struct fdisk_field *fields; /* all possible fields */ size_t nfields; @@ -351,9 +352,9 @@ struct fdisk_ask { uint64_t base; /* for relative results */ uint64_t unit; /* unit for offsets */ const char *range; /* by library generated list */ - unsigned int relative :1, - inchars :1, - wrap_negative :1; + bool relative, + inchars, + wrap_negative; } num; /* FDISK_ASKTYPE_{WARN,WARNX,..} */ struct ask_print { diff --git a/libmount/src/lock.c b/libmount/src/lock.c index b336a3b5d..28ff8b788 100644 --- a/libmount/src/lock.c +++ b/libmount/src/lock.c @@ -40,8 +40,8 @@ struct libmnt_lock { char *lockfile; /* path to lock file (e.g. /etc/mtab~) */ int lockfile_fd; /* lock file descriptor */ - unsigned int locked :1, /* do we own the lock? */ - sigblock :1; /* block signals when locked */ + bool locked, /* do we own the lock? */ + sigblock; /* block signals when locked */ sigset_t oldsigmask; }; diff --git a/libsmartcols/src/filter-param.c b/libsmartcols/src/filter-param.c index 636d4e5ee..4a67cbfaf 100644 --- a/libsmartcols/src/filter-param.c +++ b/libsmartcols/src/filter-param.c @@ -24,8 +24,8 @@ struct filter_param { char *holder_name; regex_t *re; - unsigned int fetched :1, /* holder requested */ - empty : 1; + bool fetched, /* holder requested */ + empty; }; static int cast_param(int type, struct filter_param *n); diff --git a/libsmartcols/src/smartcolsP.h b/libsmartcols/src/smartcolsP.h index 23fc824c2..444661ee6 100644 --- a/libsmartcols/src/smartcolsP.h +++ b/libsmartcols/src/smartcolsP.h @@ -265,22 +265,22 @@ struct libscols_table { struct libscols_column *cur_column; /* currently used column */ /* flags */ - unsigned int ascii :1, /* don't use unicode */ - colors_wanted :1, /* enable colors */ - is_term :1, /* isatty() */ - padding_debug :1, /* output visible padding chars */ - is_dummy_print :1, /* printing used for width calculation only */ - is_shellvar :1, /* shell compatible column names */ - maxout :1, /* maximize output */ - minout :1, /* minimize output (mutually exclusive to maxout) */ - header_repeat :1, /* print header after libscols_table->termheight */ - header_printed :1, /* header already printed */ - priv_symbols :1, /* default private symbols */ - walk_last_done :1, /* last tree root walked */ - no_headings :1, /* don't print header */ - no_encode :1, /* don't care about control and non-printable chars */ - no_linesep :1, /* don't print line separator */ - no_wrap :1; /* never wrap lines */ + bool ascii , /* don't use unicode */ + colors_wanted , /* enable colors */ + is_term , /* isatty() */ + padding_debug , /* output visible padding chars */ + is_dummy_print, /* printing used for width calculation only */ + is_shellvar , /* shell compatible column names */ + maxout , /* maximize output */ + minout , /* minimize output (mutually exclusive to maxout) */ + header_repeat , /* print header after libscols_table->termheight */ + header_printed, /* header already printed */ + priv_symbols , /* default private symbols */ + walk_last_done, /* last tree root walked */ + no_headings , /* don't print header */ + no_encode , /* don't care about control and non-printable chars */ + no_linesep , /* don't print line separator */ + no_wrap ; /* never wrap lines */ }; #define IS_ITER_FORWARD(_i) ((_i)->direction == SCOLS_ITER_FORWARD) diff --git a/login-utils/chfn.c b/login-utils/chfn.c index 752d59821..b82492e9b 100644 --- a/login-utils/chfn.c +++ b/login-utils/chfn.c @@ -72,13 +72,12 @@ struct chfn_control { * NULL in fields that haven't been changed. * In the end, "newf" is folded into "oldf". */ struct finfo oldf, newf; - unsigned int - allow_fullname:1, /* The login.defs restriction */ - allow_room:1, /* see: man login.defs(5) */ - allow_work:1, /* and look for CHFN_RESTRICT */ - allow_home:1, /* keyword for these four. */ - changed:1, /* is change requested */ - interactive:1; /* whether to prompt for fields or not */ + bool allow_fullname, /* The login.defs restriction */ + allow_room, /* see: man login.defs(5) */ + allow_work, /* and look for CHFN_RESTRICT */ + allow_home, /* keyword for these four. */ + changed, /* is change requested */ + interactive; /* whether to prompt for fields or not */ }; /* we do not accept gecos field sizes longer than MAX_FIELD_SIZE */ diff --git a/login-utils/last.c b/login-utils/last.c index 0f92fef35..bdd375063 100644 --- a/login-utils/last.c +++ b/login-utils/last.c @@ -77,12 +77,12 @@ #define UCHUNKSIZE 16384 /* How much we read at once. */ struct last_control { - unsigned int lastb :1, /* Is this command 'lastb' */ - extended :1, /* Lots of info */ - showhost :1, /* Show hostname */ - altlist :1, /* Hostname at the end */ - usedns :1, /* Use DNS to lookup the hostname */ - useip :1; /* Print IP address in number format */ + bool lastb, /* Is this command 'lastb' */ + extended, /* Lots of info */ + showhost, /* Show hostname */ + altlist, /* Hostname at the end */ + usedns, /* Use DNS to lookup the hostname */ + useip; /* Print IP address in number format */ unsigned int name_len; /* Number of login name characters to print */ unsigned int domain_len; /* Number of domain name characters to print */ diff --git a/login-utils/login.c b/login-utils/login.c index a31292772..1d7dd3a67 100644 --- a/login-utils/login.c +++ b/login-utils/login.c @@ -132,11 +132,11 @@ struct login_context { pid_t pid; - unsigned int quiet:1, /* hush file exists */ - remote:1, /* login -h */ - nohost:1, /* login -H */ - noauth:1, /* login -f */ - keep_env:1; /* login -p */ + bool quiet, /* hush file exists */ + remote, /* login -h */ + nohost, /* login -H */ + noauth, /* login -f */ + keep_env; /* login -p */ }; static pid_t child_pid = 0; diff --git a/login-utils/su-common.c b/login-utils/su-common.c index feb4645fa..8a77cf2a8 100644 --- a/login-utils/su-common.c +++ b/login-utils/su-common.c @@ -150,18 +150,18 @@ struct su_context { #ifdef USE_PTY struct ul_pty *pty; /* pseudo terminal handler (for --pty) */ #endif - unsigned int runuser :1, /* flase=su, true=runuser */ - runuser_uopt :1, /* runuser -u specified */ - isterm :1, /* is stdin terminal? */ - fast_startup :1, /* pass the `-f' option to the subshell. */ - simulate_login :1, /* simulate a login instead of just starting a shell. */ - change_environment :1, /* change some environment vars to indicate the user su'd to.*/ - same_session :1, /* don't call setsid() with a command. */ - suppress_pam_info:1, /* don't print PAM info messages (Last login, etc.). */ - pam_has_session :1, /* PAM session opened */ - pam_has_cred :1, /* PAM cred established */ - force_pty :1, /* create pseudo-terminal */ - restricted :1; /* false for root user */ + bool runuser, /* flase=su, true=runuser */ + runuser_uopt, /* runuser -u specified */ + isterm, /* is stdin terminal? */ + fast_startup, /* pass the `-f' option to the subshell. */ + simulate_login, /* simulate a login instead of just starting a shell. */ + change_environment, /* change some environment vars to indicate the user su'd to.*/ + same_session, /* don't call setsid() with a command. */ + suppress_pam_info, /* don't print PAM info messages (Last login, etc.). */ + pam_has_session, /* PAM session opened */ + pam_has_cred, /* PAM cred established */ + force_pty, /* create pseudo-terminal */ + restricted; /* false for root user */ }; diff --git a/lsfd-cmd/lsfd.h b/lsfd-cmd/lsfd.h index a34a756c7..e25aec4d6 100644 --- a/lsfd-cmd/lsfd.h +++ b/lsfd-cmd/lsfd.h @@ -207,10 +207,10 @@ struct file { unsigned int sys_flags; unsigned int mnt_id; - uint8_t locked_read:1, - locked_write:1, - multiplexed:1, - is_error:1; + bool locked_read, + locked_write, + multiplexed, + is_error; }; #define is_opened_file(_f) ((_f)->association >= 0) diff --git a/misc-utils/blkid.c b/misc-utils/blkid.c index aaffe1916..d5fe4f1fa 100644 --- a/misc-utils/blkid.c +++ b/misc-utils/blkid.c @@ -9,6 +9,7 @@ * %End-Header% */ +#include #include #include #include @@ -56,15 +57,14 @@ struct blkid_control { uintmax_t size; char *show[128]; struct ul_jsonwrt *json_fmt; - unsigned int - eval:1, - gc:1, - lookup:1, - lowprobe:1, - lowprobe_superblocks:1, - lowprobe_topology:1, - no_part_details:1, - raw_chars:1; + bool eval, + gc, + lookup, + lowprobe, + lowprobe_superblocks, + lowprobe_topology, + no_part_details, + raw_chars; }; static void __attribute__((__noreturn__)) usage(void) diff --git a/misc-utils/cal.c b/misc-utils/cal.c index 1af95124c..0acf042ff 100644 --- a/misc-utils/cal.c +++ b/misc-utils/cal.c @@ -214,22 +214,22 @@ struct cal_control { const char *abbr_month[MONTHS_IN_YEAR]; /* abbreviated month names */ const char *weekdays[DAYS_IN_WEEK]; /* day names */ - int reform_year; /* Gregorian reform year */ - int colormode; /* day and week number highlight */ - int num_months; /* number of requested months */ - int span_months; /* span the date */ - int months_in_row; /* number of months horizontally in print out */ - int weekstart; /* day the week starts, often Sun or Mon */ - int weektype; /* WEEK_TYPE_{NONE,ISO,US} */ - size_t day_width; /* day width in characters in printout */ - size_t week_width; /* 7 * day_width + possible week num */ - size_t month_width; /* width of a month (vertical mode) */ - int gutter_width; /* spaces in between horizontal month outputs */ - struct cal_request req; /* the times user is interested */ - unsigned int julian:1, /* julian output */ - header_year:1, /* print year number */ - header_hint:1, /* does month name + year need two lines to fit */ - vertical:1; /* display the output in vertical */ + int reform_year; /* Gregorian reform year */ + int colormode; /* day and week number highlight */ + int num_months; /* number of requested months */ + int span_months; /* span the date */ + int months_in_row; /* number of months horizontally in print out */ + int weekstart; /* day the week starts, often Sun or Mon */ + int weektype; /* WEEK_TYPE_{NONE,ISO,US} */ + size_t day_width; /* day width in characters in printout */ + size_t week_width; /* 7 * day_width + possible week num */ + size_t month_width; /* width of a month (vertical mode) */ + int gutter_width; /* spaces in between horizontal month outputs */ + struct cal_request req; /* the times user is interested */ + bool julian, /* julian output */ + header_year, /* print year number */ + header_hint, /* does month name + year need two lines to fit */ + vertical; /* display the output in vertical */ }; struct cal_month { diff --git a/misc-utils/getopt.c b/misc-utils/getopt.c index c57dd8737..ae35baaf8 100644 --- a/misc-utils/getopt.c +++ b/misc-utils/getopt.c @@ -57,6 +57,7 @@ #define CLOSE_EXIT_CODE XALLOC_EXIT_CODE #define TEST_EXIT_CODE 4 +#include #include #include #include @@ -88,11 +89,10 @@ struct getopt_control { struct option *long_options; /* long options */ int long_options_length; /* length of options array */ int long_options_nr; /* number of used elements in array */ - unsigned int - compatible:1, /* compatibility mode for 'difficult' programs */ - quiet_errors:1, /* print errors */ - quiet_output:1, /* print output */ - quote:1; /* quote output */ + bool compatible, /* compatibility mode for 'difficult' programs */ + quiet_errors, /* print errors */ + quiet_output, /* print output */ + quote; /* quote output */ }; enum { REALLOC_INCREMENT = 8 }; diff --git a/misc-utils/hardlink.c b/misc-utils/hardlink.c index d17bcd4f0..6ac4a3306 100644 --- a/misc-utils/hardlink.c +++ b/misc-utils/hardlink.c @@ -184,20 +184,20 @@ static struct options { const char *method; signed int verbosity; - unsigned int respect_mode:1; - unsigned int respect_owner:1; - unsigned int respect_name:1; - unsigned int respect_dir:1; - unsigned int respect_time:1; - unsigned int respect_xattrs:1; - unsigned int maximise:1; - unsigned int minimise:1; - unsigned int keep_oldest:1; - unsigned int prio_trees:1; - unsigned int dry_run:1; - unsigned int list_duplicates:1; + bool respect_mode; + bool respect_owner; + bool respect_name; + bool respect_dir; + bool respect_time; + bool respect_xattrs; + bool maximise; + bool minimise; + bool keep_oldest; + bool prio_trees; + bool dry_run; + bool list_duplicates; + bool within_mount; char line_delim; - unsigned int within_mount:1; uintmax_t min_size; uintmax_t max_size; size_t io_size; diff --git a/misc-utils/kill.c b/misc-utils/kill.c index a5f78d2af..a911df6b7 100644 --- a/misc-utils/kill.c +++ b/misc-utils/kill.c @@ -92,16 +92,15 @@ struct kill_control { #ifdef UL_HAVE_PIDFD struct list_head follow_ups; #endif - unsigned int - check_all:1, - do_kill:1, - do_pid:1, - require_handler:1, - use_sigval:1, + bool check_all, + do_kill, + do_pid, + require_handler, + use_sigval, #ifdef UL_HAVE_PIDFD - timeout:1, + timeout, #endif - verbose:1; + verbose; }; static void print_signal_name(int signum, bool newline) diff --git a/misc-utils/lsblk.h b/misc-utils/lsblk.h index 044fcab72..b2b9b40dc 100644 --- a/misc-utils/lsblk.h +++ b/misc-utils/lsblk.h @@ -6,6 +6,7 @@ #ifndef UTIL_LINUX_LSBLK_H #define UTIL_LINUX_LSBLK_H +#include #include #include #include @@ -63,20 +64,20 @@ struct lsblk { int properties_by[__LSBLK_NMETHODS]; - unsigned int all_devices:1; /* print all devices, including empty */ - unsigned int bytes:1; /* print SIZE in bytes */ - unsigned int inverse:1; /* print inverse dependencies */ - unsigned int merge:1; /* merge sub-trees */ - unsigned int nodeps:1; /* don't print slaves/holders */ - unsigned int scsi:1; /* print only device with HCTL (SCSI) */ - unsigned int nvme:1; /* print NVMe device only */ - unsigned int virtio:1; /* print virtio device only */ - unsigned int paths:1; /* print devnames with "/dev" prefix */ - unsigned int sort_hidden:1; /* sort column not between output columns */ - unsigned int rawdata : 1; /* has rawdata in cell userdata */ - unsigned int dedup_hidden :1; /* deduplication column not between output columns */ - unsigned int force_tree_order:1;/* sort lines by parent->tree relation */ - unsigned int noempty:1; /* hide empty devices */ + bool all_devices; /* print all devices, including empty */ + bool bytes; /* print SIZE in bytes */ + bool inverse; /* print inverse dependencies */ + bool merge; /* merge sub-trees */ + bool nodeps; /* don't print slaves/holders */ + bool scsi; /* print only device with HCTL (SCSI) */ + bool nvme; /* print NVMe device only */ + bool virtio; /* print virtio device only */ + bool paths; /* print devnames with "/dev" prefix */ + bool sort_hidden; /* sort column not between output columns */ + bool rawdata; /* has rawdata in cell userdata */ + bool dedup_hidden; /* deduplication column not between output columns */ + bool force_tree_order; /* sort lines by parent->tree relation */ + bool noempty; /* hide empty devices */ }; extern struct lsblk *lsblk; /* global handler */ diff --git a/misc-utils/lslocks.c b/misc-utils/lslocks.c index d0d05088c..bbf5d38e4 100644 --- a/misc-utils/lslocks.c +++ b/misc-utils/lslocks.c @@ -116,8 +116,8 @@ struct lock { off_t end; ino_t inode; dev_t dev; - unsigned int mandatory :1, - blocked :1; + bool mandatory, + blocked; uint64_t size; int fd; int id; diff --git a/misc-utils/mcookie.c b/misc-utils/mcookie.c index 99df4f4a6..c837fb39c 100644 --- a/misc-utils/mcookie.c +++ b/misc-utils/mcookie.c @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -50,7 +51,7 @@ struct mcookie_control { size_t nfiles; uint64_t maxsz; - unsigned int verbose:1; + bool verbose; }; /* The basic function to hash a file */ diff --git a/misc-utils/uuidd.c b/misc-utils/uuidd.c index f3f2f42e2..79992e309 100644 --- a/misc-utils/uuidd.c +++ b/misc-utils/uuidd.c @@ -85,9 +85,9 @@ struct uuidd_options_t { const char *socket_path; uuidd_prot_num_t num; uuidd_prot_op_t do_type; - unsigned int do_kill:1, - no_pid:1, - s_flag:1; + bool do_kill, + no_pid, + s_flag; }; static void __attribute__((__noreturn__)) usage(void) diff --git a/misc-utils/uuidparse.c b/misc-utils/uuidparse.c index 133603811..7ad1e2e03 100644 --- a/misc-utils/uuidparse.c +++ b/misc-utils/uuidparse.c @@ -83,10 +83,9 @@ static int columns[ARRAY_SIZE(infos) * 2]; static size_t ncolumns; struct control { - unsigned int - json:1, - no_headings:1, - raw:1; + bool json, + no_headings, + raw; }; static void __attribute__((__noreturn__)) usage(void) diff --git a/schedutils/taskset.c b/schedutils/taskset.c index 98c8da17e..8408f86da 100644 --- a/schedutils/taskset.c +++ b/schedutils/taskset.c @@ -18,6 +18,7 @@ * Copyright (C) 2010 Karel Zak */ +#include #include #include #include @@ -45,8 +46,8 @@ struct taskset { size_t setsize; char *buf; /* buffer for conversion from mask to string */ size_t buflen; - unsigned int use_list:1, /* use list rather than masks */ - get_only:1; /* print the mask, but not modify */ + bool use_list, /* use list rather than masks */ + get_only; /* print the mask, but not modify */ }; static void __attribute__((__noreturn__)) usage(void) diff --git a/schedutils/uclampset.c b/schedutils/uclampset.c index 5968de93d..4b37557a1 100644 --- a/schedutils/uclampset.c +++ b/schedutils/uclampset.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -38,12 +39,12 @@ struct uclampset { unsigned int util_max; pid_t pid; - unsigned int all_tasks:1, /* all threads of the PID */ - system:1, - util_min_set:1, /* indicates -m option was passed */ - util_max_set:1, /* indicates -M option was passed */ - reset_on_fork:1, - verbose:1; + bool all_tasks, /* all threads of the PID */ + system, + util_min_set, /* indicates -m option was passed */ + util_max_set, /* indicates -M option was passed */ + reset_on_fork, + verbose; char *cmd; }; diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c index e73cddf5e..a8369799f 100644 --- a/sys-utils/dmesg.c +++ b/sys-utils/dmesg.c @@ -233,20 +233,20 @@ struct dmesg_control { struct ul_jsonwrt jfmt; /* -J formatting */ - unsigned int follow:1, /* wait for new messages */ - end:1, /* seek to the of buffer */ - raw:1, /* raw mode */ - noesc:1, /* no escape */ - fltr_lev:1, /* filter out by levels[] */ - fltr_fac:1, /* filter out by facilities[] */ - decode:1, /* use "facility: level: " prefix */ - pager:1, /* pipe output into a pager */ - color:1, /* colorize messages */ - json:1, /* JSON output */ - force_prefix:1; /* force timestamp and decode prefix + bool follow, /* wait for new messages */ + end, /* seek to the of buffer */ + raw, /* raw mode */ + noesc, /* no escape */ + fltr_lev, /* filter out by levels[] */ + fltr_fac, /* filter out by facilities[] */ + decode, /* use "facility: level: " prefix */ + pager, /* pipe output into a pager */ + color, /* colorize messages */ + json, /* JSON output */ + force_prefix; /* force timestamp and decode prefix on each line */ int indent; /* due to timestamps if newline */ - size_t caller_id_size; /* PRINTK_CALLERID max field size */ + size_t caller_id_size; /* PRINTK_CALLERID max field size */ }; struct dmesg_record { diff --git a/sys-utils/eject.c b/sys-utils/eject.c index 12b115600..310d6c3df 100644 --- a/sys-utils/eject.c +++ b/sys-utils/eject.c @@ -75,27 +75,27 @@ struct eject_control { struct libmnt_table *mtab; char *device; /* device or mount point to be ejected */ int fd; /* file descriptor for device */ - unsigned int /* command flags and arguments */ - a_option:1, - c_option:1, - d_option:1, - F_option:1, - f_option:1, - i_option:1, - M_option:1, - m_option:1, - n_option:1, - p_option:1, - q_option:1, - r_option:1, - s_option:1, - T_option:1, - t_option:1, - v_option:1, - X_option:1, - x_option:1, - a_arg:1, - i_arg:1; + bool /* command flags and arguments */ + a_option, + c_option, + d_option, + F_option, + f_option, + i_option, + M_option, + m_option, + n_option, + p_option, + q_option, + r_option, + s_option, + T_option, + t_option, + v_option, + X_option, + x_option, + a_arg, + i_arg; unsigned int force_exclusive; /* use O_EXCL */ diff --git a/sys-utils/hwclock.h b/sys-utils/hwclock.h index 21b7efa3d..2522d6c7d 100644 --- a/sys-utils/hwclock.h +++ b/sys-utils/hwclock.h @@ -9,6 +9,7 @@ #ifndef HWCLOCK_CLOCK_H #define HWCLOCK_CLOCK_H +#include #include #include #include @@ -41,30 +42,29 @@ struct hwclock_control { #endif char *param_get_option; char *param_set_option; - unsigned int - hwaudit_on:1, - adjust:1, - show:1, - hctosys:1, - utc:1, - systohc:1, + bool hwaudit_on, + adjust, + show, + hctosys, + utc, + systohc, #if defined(__linux__) && defined(__alpha__) - getepoch:1, - setepoch:1, + getepoch, + setepoch, #endif - noadjfile:1, - local_opt:1, - directisa:1, - testing:1, - systz:1, - predict:1, - get:1, - set:1, - update:1, - universal:1, /* will store hw_clock_is_utc() return value */ - vl_read:1, - vl_clear:1, - verbose:1; + noadjfile, + local_opt, + directisa, + testing, + systz, + predict, + get, + set, + update, + universal, /* will store hw_clock_is_utc() return value */ + vl_read, + vl_clear, + verbose; }; struct clock_ops { diff --git a/sys-utils/irq-common.h b/sys-utils/irq-common.h index a23a51a96..02b72d752 100644 --- a/sys-utils/irq-common.h +++ b/sys-utils/irq-common.h @@ -12,6 +12,8 @@ #ifndef UTIL_LINUX_H_IRQ_COMMON #define UTIL_LINUX_H_IRQ_COMMON +#include + #include "c.h" #include "nls.h" #include "cpuset.h" @@ -58,10 +60,9 @@ struct irq_output { irq_cmp_t *sort_cmp_func; - unsigned int - json:1, /* JSON output */ - pairs:1, /* export, NAME="value" aoutput */ - no_headings:1; /* don't print header */ + bool json, /* JSON output */ + pairs, /* export, NAME="value" aoutput */ + no_headings; /* don't print header */ }; int irq_column_name_to_id(char const *const name, size_t const namesz); diff --git a/sys-utils/irqtop.c b/sys-utils/irqtop.c index 0a732a1c3..8fbedb16a 100644 --- a/sys-utils/irqtop.c +++ b/sys-utils/irqtop.c @@ -71,10 +71,10 @@ enum irqtop_cpustat_mode { /* top control struct */ struct irqtop_ctl { - WINDOW *win; - int cols; - int rows; - char *hostname; + WINDOW *win; + int cols; + int rows; + char *hostname; struct itimerspec timer; struct irq_stat *prev_stat; @@ -83,8 +83,8 @@ struct irqtop_ctl { cpu_set_t *cpuset; enum irqtop_cpustat_mode cpustat_mode; - unsigned int request_exit:1; - unsigned int softirq:1; + bool request_exit, + softirq; }; /* user's input parser */ diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c index 455bbf4e9..17eaea9f4 100644 --- a/sys-utils/lscpu.c +++ b/sys-utils/lscpu.c @@ -127,7 +127,7 @@ struct lscpu_coldesc { const char *help; int flags; - unsigned int is_abbr:1; /* name is abbreviation */ + bool is_abbr; /* name is abbreviation */ int json_type; }; diff --git a/sys-utils/lscpu.h b/sys-utils/lscpu.h index a79206e93..4d394a81d 100644 --- a/sys-utils/lscpu.h +++ b/sys-utils/lscpu.h @@ -12,6 +12,8 @@ #ifndef LSCPU_H #define LSCPU_H +#include + #include "c.h" #include "nls.h" #include "cpuset.h" @@ -160,8 +162,8 @@ struct lscpu_cpu { struct lscpu_arch { char *name; /* uname() .machine */ - unsigned int bit32:1, - bit64:1; + bool bit32, + bit64; }; struct lscpu_vulnerability { diff --git a/sys-utils/lsmem.c b/sys-utils/lsmem.c index 9ea80cb85..c9851e98c 100644 --- a/sys-utils/lsmem.c +++ b/sys-utils/lsmem.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -53,7 +54,7 @@ struct memory_block { int node; int nr_zones; int zones[MAX_NR_ZONES]; - unsigned int removable:1; + bool removable; }; struct lsmem { diff --git a/sys-utils/mountpoint.c b/sys-utils/mountpoint.c index 8f0b0d5f4..6294a4c07 100644 --- a/sys-utils/mountpoint.c +++ b/sys-utils/mountpoint.c @@ -14,6 +14,7 @@ * This is libmount based reimplementation of the mountpoint(1) * from sysvinit project. */ +#include #include #include #include @@ -37,11 +38,10 @@ struct mountpoint_control { char *path; dev_t dev; struct stat st; - unsigned int - dev_devno:1, - fs_devno:1, - nofollow:1, - quiet:1; + bool dev_devno, + fs_devno, + nofollow, + quiet; }; static int dir_to_device(struct mountpoint_control *ctl) diff --git a/sys-utils/rfkill.c b/sys-utils/rfkill.c index fcb249208..860e86425 100644 --- a/sys-utils/rfkill.c +++ b/sys-utils/rfkill.c @@ -142,10 +142,9 @@ static size_t ncolumns; struct control { struct libscols_table *tb; - unsigned int - json:1, - no_headings:1, - raw:1; + bool json, + no_headings, + raw; }; static int column_name_to_id(const char *name, size_t namesz) diff --git a/sys-utils/rtcwake.c b/sys-utils/rtcwake.c index aeabead70..d384feb64 100644 --- a/sys-utils/rtcwake.c +++ b/sys-utils/rtcwake.c @@ -96,8 +96,8 @@ struct rtcwake_control { enum clock_modes clock_mode; /* hwclock timezone */ time_t sys_time; /* system time */ time_t rtc_time; /* hardware time */ - unsigned int verbose:1, /* verbose messaging */ - dryrun:1; /* do not set alarm, suspend system, etc */ + bool verbose, /* verbose messaging */ + dryrun; /* do not set alarm, suspend system, etc */ }; static void __attribute__((__noreturn__)) usage(void) diff --git a/sys-utils/setpriv.c b/sys-utils/setpriv.c index 5899552d6..19b8c80aa 100644 --- a/sys-utils/setpriv.c +++ b/sys-utils/setpriv.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -75,20 +76,19 @@ enum cap_type { */ struct privctx { - unsigned int - nnp:1, /* no_new_privs */ - have_ruid:1, /* real uid */ - have_euid:1, /* effective uid */ - have_rgid:1, /* real gid */ - have_egid:1, /* effective gid */ - have_passwd:1, /* passwd entry */ - have_groups:1, /* add groups */ - keep_groups:1, /* keep groups */ - clear_groups:1, /* remove groups */ - init_groups:1, /* initialize groups */ - reset_env:1, /* reset environment */ - have_securebits:1, /* remove groups */ - have_ptracer:1; /* modify ptracer */ + bool nnp, /* no_new_privs */ + have_ruid, /* real uid */ + have_euid, /* effective uid */ + have_rgid, /* real gid */ + have_egid, /* effective gid */ + have_passwd, /* passwd entry */ + have_groups, /* add groups */ + keep_groups, /* keep groups */ + clear_groups, /* remove groups */ + init_groups, /* initialize groups */ + reset_env, /* reset environment */ + have_securebits, /* remove groups */ + have_ptracer; /* modify ptracer */ /* uids and gids */ uid_t ruid, euid; diff --git a/sys-utils/swapon.c b/sys-utils/swapon.c index ce499c10d..419155d67 100644 --- a/sys-utils/swapon.c +++ b/sys-utils/swapon.c @@ -12,6 +12,7 @@ * the code. Karel Zak rewrote the code under GPL-2.0-or-later. */ #include +#include #include #include #include @@ -138,14 +139,13 @@ struct swapon_ctl { struct swap_prop props; /* global settings for all devices */ - unsigned int - all:1, /* turn on all swap devices */ - bytes:1, /* display --show in bytes */ - fix_page_size:1, /* reinitialize page size */ - no_heading:1, /* toggle --show headers */ - raw:1, /* toggle --show alignment */ - show:1, /* display --show information */ - verbose:1; /* be chatty */ + bool all, /* turn on all swap devices */ + bytes, /* display --show in bytes */ + fix_page_size, /* reinitialize page size */ + no_heading, /* toggle --show headers */ + raw, /* toggle --show alignment */ + show, /* display --show information */ + verbose; /* be chatty */ }; static int column_name_to_id(const char *name, size_t namesz) diff --git a/term-utils/script.c b/term-utils/script.c index 3457ac817..59b640256 100644 --- a/term-utils/script.c +++ b/term-utils/script.c @@ -140,13 +140,12 @@ struct script_control { pid_t child; /* child pid */ int childstatus; /* child process exit value */ - unsigned int - append:1, /* append output */ - rc_wanted:1, /* return child exit value */ - flush:1, /* flush after each write */ - quiet:1, /* suppress most output */ - force:1, /* write output to links */ - isterm:1; /* is child process running as terminal */ + bool append, /* append output */ + rc_wanted, /* return child exit value */ + flush, /* flush after each write */ + quiet, /* suppress most output */ + force, /* write output to links */ + isterm; /* is child process running as terminal */ }; static ssize_t log_info(struct script_control *ctl, const char *name, const char *msgfmt, ...) diff --git a/term-utils/setterm.c b/term-utils/setterm.c index a41a5c98e..d9f9b4502 100644 --- a/term-utils/setterm.c +++ b/term-utils/setterm.c @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -173,22 +174,22 @@ struct setterm_control { int opt_rt_len; /* regular tab length */ int opt_tb_array[TABS_MAX + 1]; /* array for tab list */ /* colors */ - unsigned int opt_fo_color:4, opt_ba_color:4, opt_ul_color:4, opt_hb_color:4; + uint8_t opt_fo_color, opt_ba_color, opt_ul_color, opt_hb_color; /* boolean options */ - unsigned int opt_cu_on:1, opt_li_on:1, opt_bo_on:1, opt_hb_on:1, - opt_bl_on:1, opt_re_on:1, opt_un_on:1, opt_rep_on:1, - opt_appck_on:1, opt_invsc_on:1, opt_msg_on:1, opt_cl_all:1, - vcterm:1; + bool opt_cu_on, opt_li_on, opt_bo_on, opt_hb_on, + opt_bl_on, opt_re_on, opt_un_on, opt_rep_on, + opt_appck_on, opt_invsc_on, opt_msg_on, opt_cl_all, + vcterm; /* Option flags. Set when an option is invoked. */ - uint64_t opt_term:1, opt_reset:1, opt_resize:1, opt_initialize:1, opt_cursor:1, - opt_linewrap:1, opt_default:1, opt_foreground:1, - opt_background:1, opt_bold:1, opt_blink:1, opt_reverse:1, - opt_underline:1, opt_store:1, opt_clear:1, opt_blank:1, - opt_snap:1, opt_snapfile:1, opt_append:1, opt_ulcolor:1, - opt_hbcolor:1, opt_halfbright:1, opt_repeat:1, opt_tabs:1, - opt_clrtabs:1, opt_regtabs:1, opt_appcursorkeys:1, - opt_inversescreen:1, opt_msg:1, opt_msglevel:1, opt_powersave:1, - opt_powerdown:1, opt_blength:1, opt_bfreq:1; + bool opt_term, opt_reset, opt_resize, opt_initialize, opt_cursor, + opt_linewrap, opt_default, opt_foreground, + opt_background, opt_bold, opt_blink, opt_reverse, + opt_underline, opt_store, opt_clear, opt_blank, + opt_snap, opt_snapfile, opt_append, opt_ulcolor, + opt_hbcolor, opt_halfbright, opt_repeat, opt_tabs, + opt_clrtabs, opt_regtabs, opt_appcursorkeys, + opt_inversescreen, opt_msg, opt_msglevel, opt_powersave, + opt_powerdown, opt_blength, opt_bfreq; }; static int parse_color(const char *arg) diff --git a/text-utils/col.c b/text-utils/col.c index f9bc3be40..37654eae5 100644 --- a/text-utils/col.c +++ b/text-utils/col.c @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include @@ -105,7 +106,7 @@ struct col_char { wchar_t c_char; /* character in question */ int c_width; /* character width */ - uint8_t c_set:1; /* character set (currently only 2) */ + uint8_t c_set; /* character set (currently only 2) */ }; struct col_line { @@ -116,7 +117,7 @@ struct col_line { size_t l_line_len; /* strlen(l_line) */ size_t l_max_col; /* max column in the line */ - uint8_t l_needs_sort:1; /* set if chars went in out of order */ + bool l_needs_sort; /* set if chars went in out of order */ }; #ifdef COL_DEALLOCATE_ON_EXIT @@ -139,12 +140,11 @@ struct col_ctl { struct col_alloc *alloc_root; /* first of line allocations */ struct col_alloc *alloc_head; /* latest line allocation */ #endif - unsigned int - last_set:1, /* char_set of last char printed */ - compress_spaces:1, /* if doing space -> tab conversion */ - fine:1, /* if `fine' resolution (half lines) */ - no_backspaces:1, /* if not to output any backspaces */ - pass_unknown_seqs:1; /* whether to pass unknown control sequences */ + bool last_set, /* char_set of last char printed */ + compress_spaces, /* if doing space -> tab conversion */ + fine, /* if `fine' resolution (half lines) */ + no_backspaces, /* if not to output any backspaces */ + pass_unknown_seqs; /* whether to pass unknown control sequences */ }; struct col_lines { @@ -158,9 +158,8 @@ struct col_lines { size_t nflushd_lines; size_t this_line; - unsigned int - cur_set:1, - warned:1; + bool cur_set, + warned; }; static void __attribute__((__noreturn__)) usage(void) diff --git a/text-utils/colcrt.c b/text-utils/colcrt.c index 4a1214cc8..2e5c4e56e 100644 --- a/text-utils/colcrt.c +++ b/text-utils/colcrt.c @@ -41,6 +41,7 @@ * modified to work correctly in multi-byte locales */ +#include #include #include #include @@ -67,13 +68,13 @@ enum { OUTPUT_COLS = 132 }; struct colcrt_control { - FILE *f; - wchar_t line[OUTPUT_COLS + 1]; - wchar_t line_under[OUTPUT_COLS + 1]; - unsigned int print_nl:1, - need_line_under:1, - no_underlining:1, - half_lines:1; + FILE *f; + wchar_t line[OUTPUT_COLS + 1]; + wchar_t line_under[OUTPUT_COLS + 1]; + bool print_nl, + need_line_under, + no_underlining, + half_lines; }; static void __attribute__((__noreturn__)) usage(void) diff --git a/text-utils/column.c b/text-utils/column.c index f5ae83d72..a0a94867f 100644 --- a/text-utils/column.c +++ b/text-utils/column.c @@ -36,11 +36,12 @@ #include #include +#include +#include #include -#include #include #include -#include +#include #include #include "nls.h" @@ -96,14 +97,14 @@ struct column_control { size_t maxncols; /* maximal number of input columns */ size_t mincolsep; /* minimal spaces between columns */ - unsigned int greedy :1, - json :1, - header_repeat :1, - hide_unnamed :1, - maxout : 1, - keep_empty_lines :1, /* --keep-empty-lines */ - tab_noheadings :1, - use_spaces :1; + bool greedy, + json, + header_repeat, + hide_unnamed, + maxout : 1, + keep_empty_lines, /* --keep-empty-lines */ + tab_noheadings, + use_spaces; }; typedef enum { diff --git a/text-utils/more.c b/text-utils/more.c index 99e7cf5d0..e39fe724c 100644 --- a/text-utils/more.c +++ b/text-utils/more.c @@ -201,38 +201,38 @@ struct more_control { magic_t magic; /* libmagic database entries */ #endif unsigned int - ignore_stdin:1, /* POLLHUP; peer closed pipe */ - bad_stdout:1, /* true if overwriting does not turn off standout */ - catch_suspend:1, /* we should catch the SIGTSTP signal */ - clear_line_ends:1, /* do not scroll, paint each screen from the top */ - clear_first:1, /* is first character in file \f */ - dumb_tty:1, /* is terminal type known */ - eat_newline:1, /* is newline ignored after 80 cols */ - erase_input_ok:1, /* is erase input supported */ - erase_previous_ok:1, /* is erase previous supported */ - exit_on_eof:1, /* exit on EOF */ - first_file:1, /* is the input file the first in list */ - fold_long_lines:1, /* fold long lines */ - hard_tabs:1, /* print spaces instead of '\t' */ - hard_tty:1, /* is this hard copy terminal (a printer or such) */ - leading_colon:1, /* key command has leading ':' character */ - is_eof:1, /* EOF detected */ - is_paused:1, /* is output paused */ - no_quit_dialog:1, /* suppress quit dialog */ - no_scroll:1, /* do not scroll, clear the screen and then display text */ - no_tty_in:1, /* is input in interactive mode */ - no_tty_out:1, /* is output in interactive mode */ - no_tty_err:1, /* is stderr terminal */ - print_banner:1, /* print file name banner */ - reading_num:1, /* are we reading leading_number */ - report_errors:1, /* is an error reported */ - search_at_start:1, /* search pattern defined at start up */ - search_called:1, /* previous more command was a search */ - squeeze_spaces:1, /* suppress white space */ - stdout_glitch:1, /* terminal has standout mode glitch */ - stop_after_formfeed:1, /* stop after form feeds */ - suppress_bell:1, /* suppress bell */ - wrap_margin:1; /* set if automargins */ + ignore_stdin, /* POLLHUP; peer closed pipe */ + bad_stdout, /* true if overwriting does not turn off standout */ + catch_suspend, /* we should catch the SIGTSTP signal */ + clear_line_ends, /* do not scroll, paint each screen from the top */ + clear_first, /* is first character in file \f */ + dumb_tty, /* is terminal type known */ + eat_newline, /* is newline ignored after 80 cols */ + erase_input_ok, /* is erase input supported */ + erase_previous_ok, /* is erase previous supported */ + exit_on_eof, /* exit on EOF */ + first_file, /* is the input file the first in list */ + fold_long_lines, /* fold long lines */ + hard_tabs, /* print spaces instead of '\t' */ + hard_tty, /* is this hard copy terminal (a printer or such) */ + leading_colon, /* key command has leading ':' character */ + is_eof, /* EOF detected */ + is_paused, /* is output paused */ + no_quit_dialog, /* suppress quit dialog */ + no_scroll, /* do not scroll, clear the screen and then display text */ + no_tty_in, /* is input in interactive mode */ + no_tty_out, /* is output in interactive mode */ + no_tty_err, /* is stderr terminal */ + print_banner, /* print file name banner */ + reading_num, /* are we reading leading_number */ + report_errors, /* is an error reported */ + search_at_start, /* search pattern defined at start up */ + search_called, /* previous more command was a search */ + squeeze_spaces, /* suppress white space */ + stdout_glitch, /* terminal has standout mode glitch */ + stop_after_formfeed, /* stop after form feeds */ + suppress_bell, /* suppress bell */ + wrap_margin; /* set if automargins */ }; static void __attribute__((__noreturn__)) usage(void) diff --git a/text-utils/ul.c b/text-utils/ul.c index 62bfcd7bf..8fa6428cd 100644 --- a/text-utils/ul.c +++ b/text-utils/ul.c @@ -40,6 +40,7 @@ * modified to work correctly in multi-byte locales */ +#include #include #include /* for getopt(), isatty() */ #include /* for memset(), strcpy() */ @@ -110,10 +111,9 @@ struct ul_ctl { int current_mode; size_t buflen; struct ul_char *buf; - unsigned int - indicated_opt:1, - must_use_uc:1, - must_overstrike:1; + bool indicated_opt, + must_use_uc, + must_overstrike; }; static void __attribute__((__noreturn__)) usage(void)