[Geany-devel] [patch] Little code/warnings cleanup (was Re: [patch] "Constify" some arguments and fields)

Colomban Wendling lists.ban at xxxxx
Thu Apr 22 21:56:35 UTC 2010


>>> On quite the same topic, would a patch that fixes a lot of small
>>> problems like that in Geany's core be appreciated? It isn't hard to do
>>> but I think it would clean the code a bit.
>> Yes, but only if it's clear that const is really meant, not just to
>> silence compiler warnings.
> Of course. Casting away should only be done where the cast is completely
> wanted or at least carefully understood.
> I'll then do it unless somebody else go faster than me.
I've took a look and fixed some warnings around and other small stuff.
They are consts, a little uint vs. int when I'm sure it makes sense,
staticize a few local functions, and so on.

I've found 4 things that I haven't fixed/touched:
* build.c:174: This type of assignations aren't valid C90 (it's a C99
addition I think). Not sure it should be fixed or not since it gives a
little gain - being sure the affected element is the right one.
* document.c:473: The function document_stop_file_monitoring() has no
prototype and isn't static, but the name made me think it is perhaps
meant to be external for some reason and only misses its prototype?
* main.c:1212+: What's that malloc stuff for??? These functions aren't
even used...
* the stash_group_add_entry() and its widget_id. The thing is that when
it is a string it should be constant, but when it is a widget it
shouldn't be... perhaps it is fine as now.

There is 2 patches: one that modifies the Geany's core, and the other
that modifies that core plugins [1].

Regards,
Colomban

[1] there is a missing free() fix for the export plugin too.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-plugins-little-warning-cleanup.diff
Type: text/x-patch
Size: 2763 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20100422/a1eb5ffc/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-src-little-warning-cleanup.diff
Type: text/x-patch
Size: 13935 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20100422/a1eb5ffc/attachment-0001.bin>


More information about the Devel mailing list