[libvirt] [PATCH 5/6] Sanitize whitespace in driver.h
Eric Blake
eblake at redhat.com
Tue Apr 23 20:28:44 UTC 2013
On 04/23/2013 04:26 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
>
> 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 at redhat.com>
> ---
> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130423/f5d70780/attachment-0001.sig>
More information about the libvir-list
mailing list