[gst-devel] indent stuff

Johan Dahlin johan at electronic-group.com
Mon Mar 15 03:52:01 CET 2004


> function declarations in header files are unreadable. Example:

I've also noticed this and I've tried to get it to work with indent,
however it does not seem to be possible since the requirements of the
indentation of GObject like headers are just simply too much for gnu
indent to handle.
I'd love to be able to use an automated script, but I'm quite sure there
are no scripts available to handle this.

> 
> GstBuffer *gst_buffer_span (GstBuffer * buf1, guint32 offset, GstBuffer * buf2,
>     guint32 len);
> 
> I suggest we use -lp/--continue-at-parentheses for header files:
> 
> gboolean gst_element_implements_interface (GstElement * element,
>                                            GType iface_type);

This is not good enough, since what we want is:

GstElement * gst_element_foo       (GstElement *element)
void         gst_element_barbazboz (GstElement *element,
                                    GType       iface_type);
             ^                     ^            ^

On this three different places it should align correctly. Can Indent do
that?

> I actually want it for source files too, but Benjamin seems to disagree.
> I don't care that much about yes or no using -lp in source files, but
> consider it an absolute requirement for header files.

I don't want it all. It makes code unreadable. It's better to do all
work manually instead, and I'm ready to do that, but not on a day of
course.

> typedef struct _GstImplementsInterfaceClass
> {
>   GTypeInterface parent;
>                                                                                 
>   /* virtual functions */
>     gboolean (*supported) (GstImplementsInterface * iface, GType iface_type);
>                                                                                 
>   gpointer _gst_reserved[GST_PADDING];
> } GstImplementsInterfaceClass;

Ditto here, when having many virtual functions/signals it should also be
indented on three different places, to make it readable. See all gtk+
headers for examples.

-- 
Johan Dahlin





More information about the gstreamer-devel mailing list