[Geany-devel] [PATCH] Better-looking comments indenting

Frank Lanitz frank at xxxxx
Sun Jul 4 09:43:55 UTC 2010


On Mon, 21 Jun 2010 18:40:52 +0300
Tambet Arak <tambet.arak at gmail.com> wrote:

> Hi,
> 
> > I like the behavior introduced with this patch but I'm not sure whether
> > its ready for committing. Do you have some special reason why you are
> > introducing this:
> >
> > + sci_get_text_range(editor->sci, line_start, line_start + buf_len, sel);
> > + sel[buf_len] = '\0';
> 
> This is just copied from below in the same function. sel is a gchar
> array and therefore
> 
> sel = sci_get_contents_range(editor->sci, line_start, line_start + buf_len);
> 
> wouldn't work:
> 
> error: incompatible types when assigning to type ‘gchar[256]’ from
> type ‘gchar *’
> 
> It seems that C doesn't allow casting into an array type either.
> Changing sel to gchar* would mean updating the whole function, but I
> wouldn't want to undertake that as it's only my first patch to Geany.
> For the sake of consistency, I think it makes sense to keep
> sci_get_text_range for now. Similarily, appending '\0' happens below
> as well and it can't hurt in any case.

I see. Maybe we will need to change some more code in this context. l44
and l47 of your patch looks also a bit weird to me. I hope to find some more
motivation to have a deeper look onto this upcoming days.

Cheers, 
Frank 
-- 
Frank Lanitz <frank at frank.uvena.de>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20100704/a54cc7cb/attachment.pgp>


More information about the Devel mailing list