[Gegl-developer] two small patches
Henrik Akesson
h.m.akesson at gmail.com
Wed Mar 25 11:22:11 PDT 2009
Now split (and no re-introduced commented code, sorry for that):
[gegl_buffer_rename.diff]
Patch from Henrik Akesson that renames pset/pget to
gegl_buffer_pixel_set and gegl_buffer_pixel_get in order to improve
readability of code and to conform to gegl coding standards.
* gegl/buffer/gegl-buffer-access.c
* gegl/buffer/gegl-buffer-private.h
[gegl_buffer_refactoring.diff]
Patch from Henrik Akesson that extracts duplicated code from
gegl_buffer_pixel_get and gegl_buffer_pixel_set into the function
gegl_buffer_in_abyss to improve readability of code and
maintainability.
* gegl/buffer/gegl-buffer-access.c
However for the get_rectangle_as_string functionality, I have to
reconsider given that the function returns a string that is used in
the GEGL_NOTE. You are right that g_string_free (string, FALSE)
doesn't free the actual character data, but it cannot as it is used in
the GEGL_NOTE function call. This means that the string has to be
freed later after the GEGL_NOTE call. In the end it just makes a
complicated code, so it's better not adding it.
Thanks,
Henrik
2009/3/24 Martin Nordholts <enselic at gmail.com>:
> Henrik Akesson wrote:
>> Two patches attached. I've made the below comments in a more suitable
>> ChangeLog format:
>>
>> [gegl_buffer.diff]
>>
>> Patch from Henrik Akesson:
>> - Extracted duplicated code from pset/pget into a separate function
>> gegl_buffer_in_abyss to improve readability of code and maintainability.
>> - Renamed pset/pget to gegl_buffer_pixel_set and gegl_buffer_pixel_get
>> in order to improve readability of code and to be conformant to gegl
>> coding standards.
>>
>
> Hi,
>
> Do you think you can split up that patch into two patches? One with the
> renames and one with the new utility function. It also added g_debug()
> statements that were commented away, please remove those. Thanks!
>
>> [gegl_utils.diff]
>>
>> Patch from Henrik Akesson that adds a gegl_rectangle_as string
>> function for retreiving a rectangle as a debug string. Log statements
>> has been changed to use this said function as well as using GEGL_NOTE
>> (see gegl-debug.h).
>
> That leaks memory because the data returned from g_string_free() needs
> to be freed if FALSE is passed to the free_segment parameter (you pass
> NULL (!)). Otherwise it is a nice change. Could you address the memory
> leaks please?
>
> BR,
> Martin
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gegl_buffer_rename.diff
Type: text/x-patch
Size: 3103 bytes
Desc: not available
Url : /lists/gegl-developer/attachments/20090325/8d0e4b7a/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gegl_buffer_refactoring.diff
Type: text/x-patch
Size: 1941 bytes
Desc: not available
Url : /lists/gegl-developer/attachments/20090325/8d0e4b7a/attachment-0001.bin
More information about the Gegl-developer
mailing list