Re: [PATCH v4 02/13] column: add API to print items in columns

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Nguyễn Thái Ngọc Duy  <pclouds@xxxxxxxxx> writes:

> +#define MODE(mode) ((mode) & COL_MODE)
> + ...
> +void print_columns(const struct string_list *list, int mode,
> +		   struct column_options *opts)
> +{
> +	const char *indent = "", *nl = "\n";
> +	int padding = 1, width = term_columns();
> +
> +	if (!list->nr)
> +		return;
> +	if (opts) {
> +		if (opts->indent)
> +			indent = opts->indent;
> +		if (opts->nl)
> +			nl = opts->nl;
> +		if (opts->width)
> +			width = opts->width;
> +		padding = opts->padding;
> +	}
> +	if (width <= 1 || !(mode & COL_ENABLED)) {

Unless there is a compelling reason not to, make a flag word used as
collection of bitfields an unsigned, i.e. not "int mode".

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]