[Spice-devel] Different styles

Frediano Ziglio fziglio at redhat.com
Wed May 25 12:31:45 UTC 2016


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)


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).

Frediano


More information about the Spice-devel mailing list