gimp r25659 - in trunk: . plug-ins/gradient-flare
- From: neo svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r25659 - in trunk: . plug-ins/gradient-flare
- Date: Wed, 14 May 2008 07:41:55 +0100 (BST)
Author: neo
Date: Wed May 14 06:41:55 2008
New Revision: 25659
URL: http://svn.gnome.org/viewvc/gimp?rev=25659&view=rev
Log:
2008-05-14 Sven Neumann <sven gimp org>
* plug-ins/gradient-flare/gradient-flare.c
(calc_sample_one_gradient): use G_STRUCT_OFFSET() instead of a
hand-made macro which caused a compiler warning (spotted by
gymp,
bug #532853).
Modified:
trunk/ChangeLog
trunk/plug-ins/gradient-flare/gradient-flare.c
Modified: trunk/plug-ins/gradient-flare/gradient-flare.c
==============================================================================
--- trunk/plug-ins/gradient-flare/gradient-flare.c (original)
+++ trunk/plug-ins/gradient-flare/gradient-flare.c Wed May 14 06:41:55 2008
@@ -59,7 +59,6 @@
#endif
#define LUMINOSITY(PIX) (GIMP_RGB_LUMINANCE (PIX[0], PIX[1], PIX[2]) + 0.5)
-#define OFFSETOF(t,f) ((int) ((char*) &((t*) 0)->f))
#define RESPONSE_RESCAN 1
@@ -1763,21 +1762,67 @@
static int
calc_sample_one_gradient (void)
{
- static struct {
- guchar **values;
- gint name_offset;
- gint hue_offset;
- gint gray;
+ static struct
+ {
+ guchar **values;
+ gint name_offset;
+ gint hue_offset;
+ gint gray;
} table[] = {
- { &calc.glow_radial, OFFSETOF (GFlare, glow_radial), OFFSETOF (GFlare, glow_hue), FALSE },
- { &calc.glow_angular, OFFSETOF (GFlare, glow_angular), 0, FALSE },
- { &calc.glow_angular_size, OFFSETOF (GFlare, glow_angular_size), 0, TRUE },
- { &calc.rays_radial, OFFSETOF (GFlare, rays_radial), OFFSETOF (GFlare, rays_hue), FALSE },
- { &calc.rays_angular, OFFSETOF (GFlare, rays_angular), 0, FALSE },
- { &calc.rays_angular_size, OFFSETOF (GFlare, rays_angular_size), 0, TRUE },
- { &calc.sflare_radial, OFFSETOF (GFlare, sflare_radial), OFFSETOF (GFlare, sflare_hue), FALSE },
- { &calc.sflare_sizefac, OFFSETOF (GFlare, sflare_sizefac), 0, TRUE },
- { &calc.sflare_probability, OFFSETOF (GFlare, sflare_probability), 0, TRUE },
+ {
+ &calc.glow_radial,
+ G_STRUCT_OFFSET (GFlare, glow_radial),
+ G_STRUCT_OFFSET (GFlare, glow_hue),
+ FALSE
+ },
+ {
+ &calc.glow_angular,
+ G_STRUCT_OFFSET (GFlare, glow_angular),
+ 0,
+ FALSE
+ },
+ {
+ &calc.glow_angular_size,
+ G_STRUCT_OFFSET (GFlare, glow_angular_size),
+ 0,
+ TRUE
+ },
+ {
+ &calc.rays_radial,
+ G_STRUCT_OFFSET (GFlare, rays_radial),
+ G_STRUCT_OFFSET (GFlare, rays_hue),
+ FALSE
+ },
+ {
+ &calc.rays_angular,
+ G_STRUCT_OFFSET (GFlare, rays_angular),
+ 0,
+ FALSE
+ },
+ {
+ &calc.rays_angular_size,
+ G_STRUCT_OFFSET (GFlare, rays_angular_size),
+ 0,
+ TRUE
+ },
+ {
+ &calc.sflare_radial,
+ G_STRUCT_OFFSET (GFlare, sflare_radial),
+ G_STRUCT_OFFSET (GFlare, sflare_hue),
+ FALSE
+ },
+ {
+ &calc.sflare_sizefac,
+ G_STRUCT_OFFSET (GFlare, sflare_sizefac),
+ 0,
+ TRUE
+ },
+ {
+ &calc.sflare_probability,
+ G_STRUCT_OFFSET (GFlare, sflare_probability),
+ 0,
+ TRUE
+ }
};
GFlare *gflare = calc.gflare;
GradientName *grad_name;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]