[Spice-devel] Different styles

Christophe Fergeau cfergeau at redhat.com
Wed May 25 13:29:42 UTC 2016


On Wed, May 25, 2016 at 08:31:45AM -0400, Frediano Ziglio wrote:
> Hi,
>   I was reading the style document and I found some different styles in the code
> 
> The structures for GObject differs from the rest of the code, they are
> 
> struct DispatcherClass
> {
>     GObjectClass parent_class;
> };
> 
> instead of
> 
> struct DispatcherClass {
>     GObjectClass parent_class;
> };
> 
> (all other structure follow this schema)

I guess it's just that noone paid attention to the difference, I'd just
fix it.

> 
> 
> There is a chapter "Vertical indentation" which state that there is no
> vertical indentation quoting even some example of functions however
> there are some code, like
> 
> void red_qxl_on_ic_change(QXLInstance *qxl, SpiceImageCompression ic);
> void red_qxl_on_sv_change(QXLInstance *qxl, int sv);
> void red_qxl_set_mouse_mode(QXLInstance *qxl, uint32_t mode);
> void red_qxl_attach_worker(QXLInstance *qxl);
> 
> that follow these specification while others
> 
> void                       display_channel_draw                      (DisplayChannel *display,
>                                                                       const SpiceRect *area,
>                                                                       int surface_id);
> void                       display_channel_draw_until                (DisplayChannel *display,
>                                                                       const SpiceRect *area,
>                                                                       int surface_id,
>                                                                       Drawable *last);
> void                       display_channel_update                    (DisplayChannel *display,
>                                                                       uint32_t surface_id,
>                                                                       const QXLRect *area,
> 
> that clearly use vertical indentation.
> 
> I personally find that vertical indentation tend to cause long lines and
> it's hard to maintain when new declarations are added (like requiring
> new indentation) but the main argument is that I'd like to follow same
> rules or define exceptions with rules (like structure declarations for
> GObject have bracket on first column).

Yup, I'd avoid vertical indentation too. I don't think it's very
important to fix the existing instances until we touch that part of the
code though.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160525/c22d6443/attachment.sig>


More information about the Spice-devel mailing list