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

Lex Trotman 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:
>
>> 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.


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?

Cheers
Lex

>
> Cheers,
> Frank
> --
> Frank Lanitz <frank at frank.uvena.de>
>
> _______________________________________________
> Geany-devel mailing list
> Geany-devel at uvena.de
> http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
>
>



More information about the Devel mailing list