Maurits Rijk <[EMAIL PROTECTED]> writes:

> I just had a look at the code of some of the plug-ins and I noticed that
> there is often lot's of room for improvement:
> 1) some constructions are plain clumsy, for example somewhere I saw:
>       for (k = 0; k < bytes; k++) destline++;
> instead of simply: 
>       destline += bytes;

Easily fixable.  But why did the code get into that state to begin with?

> 2) a lot of functionality has been added since the last update of some
> of the plug-ins. Result: duplicate functionality

This basically boils down to "the GIMP's user interface is a mess".  I
don't know how much fixing and polishing you want to do during the
freeze.  If you remove functionality from some plug-ins, you may have
to modify scripts and trigger some other chain reactions that the
freeze may not be happy with.

> 3) sometimes it's just lack of C knowledge:
>       if (p)
>          free(p);
> can be simply replaced by just: 
>       free(p);

If p is a null pointer then "free (p)" may (and should!) crash.  You
are incorrect here.

> 4) some plugins have obvious memory leaks.
> So my question: is it worth the effort to carefully go through all the
> code (not only plug-ins) and clean things up?

Yes.  You can use tools like memprof to do this.

> 1) source code becomes smaller. Not a big deal with Gb harddisks, but
> nice for future maintenance.
> 2) object code becomes smaller. My initial estimate that for example
> most plug-ins can be easily reduced with 10 a 20 % without much effort.
> 3) during the process we might find further bugs.

(3) is the important one.  The first priority is to achieve
correctness.  Performance in terms of speed or memory is secondary.

> Disadvantages:
> 1) this will cost time/effort (I am willing to make my contribution).

Not an issue.

> 2) we might break things that work

This can be fixed by, you know, testing things after you change them :-)

> 3) we don't spend time on other fun things liking adding functionality.

The GIMP does not need more functionality at this point; it needs to
be checked for correctness.


Reply via email to