[Geany-devel] [PATCH] Better-looking comments indenting
elextr at xxxxx
Sun Jul 4 10:30:01 UTC 2010
On 4 July 2010 19:43, Frank Lanitz <frank at frank.uvena.de> wrote:
> On Mon, 21 Jun 2010 18:40:52 +0300
> Tambet Arak <tambet.arak at gmail.com> wrote:
>> > 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’ 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.
As it seems to be trying to get the line, can't it just use
sci_get_line which is length safe and null terminated?
> Frank Lanitz <frank at frank.uvena.de>
> Geany-devel mailing list
> Geany-devel at uvena.de
More information about the Devel