Re: [PATCH 5/6] Sanitize whitespace in driver.h

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

 



On 04/23/2013 04:26 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
> 
> The driver.h file has no consistent indentation usage across
> all the typedefs. Attempts to vertically align struct field
> members have also been inconsistently applied. Sanitize the
> whitespace used for typedefs & remove all vertical alignment
> from structs
> 
> Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> ---
>  src/driver.h | 2561 +++++++++++++++++++++++++++++++---------------------------
>  1 file changed, 1376 insertions(+), 1185 deletions(-)

I assume the increase in lines is due to added line wrapping.

>  typedef int
> -        (*virDrvConnectClose)   (virConnectPtr conn);
> +(*virDrvConnectClose)(virConnectPtr conn);
> +
>  typedef int

Ah, also due to blanks between typedefs.  Works for me.

> +
> +typedef struct _virDriver virDriver;
> +typedef virDriver *virDriverPtr;

And you sank this typedef down closer to its use, rather than in the
random middle of other typedefs.

>  
>  /**
>   * _virDriver:
> @@ -954,249 +1042,266 @@ typedef int
>   *  - close
>   */
>  struct _virDriver {
> -    int                                 no;    /* the number virDrvNo */
> -    const char                          *name; /* the name of the driver */
> -    virDrvConnectOpen                         connectOpen;
> -    virDrvConnectClose                        connectClose;

> +    int no; /* the number virDrvNo */
> +    const char *name; /* the name of the driver */
> +    virDrvConnectOpen connectOpen;
> +    virDrvConnectClose connectClose;

The old style was slightly more legible (easy to see where the field
name begins); but then again, since patch 4/5 renamed all the fields to
be obvious counterparts to the typedef name, we no longer need to see
the field name to know if it is predictable (pre-patch, it was the
existence of unpredictable names that made legibility important).

I like the result; ACK.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]