Commit 3d68f811 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

fixed (false) uninitialized variable warnings and cleaned up the code a

2005-10-07  Michael Natterer  <mitch@gimp.org>

	* tools/pdbgen/pdb/grid.pdb: fixed (false) uninitialized variable
	warnings and cleaned up the code a bit.

	* app/pdb/grid_cmds.c: regenerated.
parent 6b13c2b0
2005-10-07 Michael Natterer <mitch@gimp.org>
* tools/pdbgen/pdb/grid.pdb: fixed (false) uninitialized variable
warnings and cleaned up the code a bit.
* app/pdb/grid_cmds.c: regenerated.
2005-10-07 Sven Neumann <sven@gimp.org>
* app/dialogs/palette-import-dialog.c (palette_import_filename_changed)
......
......@@ -68,9 +68,8 @@ image_grid_get_spacing_invoker (Gimp *gimp,
gboolean success = TRUE;
Argument *return_args;
GimpImage *gimage;
gdouble xspacing;
gdouble yspacing;
GimpGrid *grid;
gdouble xspacing = 0;
gdouble yspacing = 0;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
......@@ -78,7 +77,8 @@ image_grid_get_spacing_invoker (Gimp *gimp,
if (success)
{
grid = gimp_image_get_grid (gimage);
GimpGrid *grid = gimp_image_get_grid (gimage);
if (grid)
{
xspacing = grid->xspacing;
......@@ -128,8 +128,8 @@ static ProcRecord image_grid_get_spacing_proc =
"gimp-image-grid-get-spacing",
"Gets the spacing of an image's grid.",
"This procedure retrieves the horizontal and vertical spacing of an image's grid. It takes the image as parameter.",
"Sylvain FORET",
"Sylvain FORET",
"Sylvain Foret",
"Sylvain Foret",
"2005",
NULL,
GIMP_INTERNAL,
......@@ -150,7 +150,6 @@ image_grid_set_spacing_invoker (Gimp *gimp,
GimpImage *gimage;
gdouble xspacing;
gdouble yspacing;
GimpGrid *grid;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
......@@ -162,14 +161,13 @@ image_grid_set_spacing_invoker (Gimp *gimp,
if (success)
{
grid = gimp_image_get_grid (gimage);
GimpGrid *grid = gimp_image_get_grid (gimage);
if (grid)
{
g_object_set (grid,
"xspacing", xspacing,
"yspacing", yspacing,
NULL);
}
g_object_set (grid,
"xspacing", xspacing,
"yspacing", yspacing,
NULL);
else
success = FALSE;
}
......@@ -202,8 +200,8 @@ static ProcRecord image_grid_set_spacing_proc =
"gimp-image-grid-set-spacing",
"Sets the spacing of an image's grid.",
"This procedure sets the horizontal and vertical spacing of an image's grid.",
"Sylvain FORET",
"Sylvain FORET",
"Sylvain Foret",
"Sylvain Foret",
"2005",
NULL,
GIMP_INTERNAL,
......@@ -223,9 +221,8 @@ image_grid_get_offset_invoker (Gimp *gimp,
gboolean success = TRUE;
Argument *return_args;
GimpImage *gimage;
gdouble xoffset;
gdouble yoffset;
GimpGrid *grid;
gdouble xoffset = 0;
gdouble yoffset = 0;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
......@@ -233,7 +230,8 @@ image_grid_get_offset_invoker (Gimp *gimp,
if (success)
{
grid = gimp_image_get_grid (gimage);
GimpGrid *grid = gimp_image_get_grid (gimage);
if (grid)
{
xoffset = grid->xoffset;
......@@ -283,8 +281,8 @@ static ProcRecord image_grid_get_offset_proc =
"gimp-image-grid-get-offset",
"Gets the offset of an image's grid.",
"This procedure retrieves the horizontal and vertical offset of an image's grid. It takes the image as parameter.",
"Sylvain FORET",
"Sylvain FORET",
"Sylvain Foret",
"Sylvain Foret",
"2005",
NULL,
GIMP_INTERNAL,
......@@ -305,7 +303,6 @@ image_grid_set_offset_invoker (Gimp *gimp,
GimpImage *gimage;
gdouble xoffset;
gdouble yoffset;
GimpGrid *grid;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
......@@ -317,14 +314,13 @@ image_grid_set_offset_invoker (Gimp *gimp,
if (success)
{
grid = gimp_image_get_grid (gimage);
GimpGrid *grid = gimp_image_get_grid (gimage);
if (grid)
{
g_object_set (grid,
"xoffset", xoffset,
"yoffset", yoffset,
NULL);
}
g_object_set (grid,
"xoffset", xoffset,
"yoffset", yoffset,
NULL);
else
success = FALSE;
}
......@@ -357,8 +353,8 @@ static ProcRecord image_grid_set_offset_proc =
"gimp-image-grid-set-offset",
"Sets the offset of an image's grid.",
"This procedure sets the horizontal and vertical offset of an image's grid.",
"Sylvain FORET",
"Sylvain FORET",
"Sylvain Foret",
"Sylvain Foret",
"2005",
NULL,
GIMP_INTERNAL,
......@@ -379,7 +375,6 @@ image_grid_get_foreground_color_invoker (Gimp *gimp,
Argument *return_args;
GimpImage *gimage;
GimpRGB fgcolor;
GimpGrid *grid;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
......@@ -387,11 +382,10 @@ image_grid_get_foreground_color_invoker (Gimp *gimp,
if (success)
{
grid = gimp_image_get_grid (gimage);
GimpGrid *grid = gimp_image_get_grid (gimage);
if (grid)
{
fgcolor = grid->fgcolor;
}
fgcolor = grid->fgcolor;
else
success = FALSE;
}
......@@ -428,8 +422,8 @@ static ProcRecord image_grid_get_foreground_color_proc =
"gimp-image-grid-get-foreground-color",
"Sets the foreground color of an image's grid.",
"This procedure gets the foreground color of an image's grid.",
"Sylvain FORET",
"Sylvain FORET",
"Sylvain Foret",
"Sylvain Foret",
"2005",
NULL,
GIMP_INTERNAL,
......@@ -449,7 +443,6 @@ image_grid_set_foreground_color_invoker (Gimp *gimp,
gboolean success = TRUE;
GimpImage *gimage;
GimpRGB fgcolor;
GimpGrid *grid;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
......@@ -459,7 +452,8 @@ image_grid_set_foreground_color_invoker (Gimp *gimp,
if (success)
{
grid = gimp_image_get_grid (gimage);
GimpGrid *grid = gimp_image_get_grid (gimage);
if (grid)
g_object_set (grid,
"fgcolor", &fgcolor,
......@@ -491,8 +485,8 @@ static ProcRecord image_grid_set_foreground_color_proc =
"gimp-image-grid-set-foreground-color",
"Gets the foreground color of an image's grid.",
"This procedure sets the foreground color of an image's grid.",
"Sylvain FORET",
"Sylvain FORET",
"Sylvain Foret",
"Sylvain Foret",
"2005",
NULL,
GIMP_INTERNAL,
......@@ -513,7 +507,6 @@ image_grid_get_background_color_invoker (Gimp *gimp,
Argument *return_args;
GimpImage *gimage;
GimpRGB bgcolor;
GimpGrid *grid;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
......@@ -521,11 +514,10 @@ image_grid_get_background_color_invoker (Gimp *gimp,
if (success)
{
grid = gimp_image_get_grid (gimage);
GimpGrid *grid = gimp_image_get_grid (gimage);
if (grid)
{
bgcolor = grid->bgcolor;
}
bgcolor = grid->bgcolor;
else
success = FALSE;
}
......@@ -562,8 +554,8 @@ static ProcRecord image_grid_get_background_color_proc =
"gimp-image-grid-get-background-color",
"Sets the background color of an image's grid.",
"This procedure gets the background color of an image's grid.",
"Sylvain FORET",
"Sylvain FORET",
"Sylvain Foret",
"Sylvain Foret",
"2005",
NULL,
GIMP_INTERNAL,
......@@ -583,7 +575,6 @@ image_grid_set_background_color_invoker (Gimp *gimp,
gboolean success = TRUE;
GimpImage *gimage;
GimpRGB bgcolor;
GimpGrid *grid;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
......@@ -593,7 +584,8 @@ image_grid_set_background_color_invoker (Gimp *gimp,
if (success)
{
grid = gimp_image_get_grid (gimage);
GimpGrid *grid = gimp_image_get_grid (gimage);
if (grid)
g_object_set (grid,
"bgcolor", &bgcolor,
......@@ -625,8 +617,8 @@ static ProcRecord image_grid_set_background_color_proc =
"gimp-image-grid-set-background-color",
"Gets the background color of an image's grid.",
"This procedure sets the background color of an image's grid.",
"Sylvain FORET",
"Sylvain FORET",
"Sylvain Foret",
"Sylvain Foret",
"2005",
NULL,
GIMP_INTERNAL,
......@@ -646,8 +638,7 @@ image_grid_get_style_invoker (Gimp *gimp,
gboolean success = TRUE;
Argument *return_args;
GimpImage *gimage;
gint32 style;
GimpGrid *grid;
gint32 style = 0;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
......@@ -655,7 +646,8 @@ image_grid_get_style_invoker (Gimp *gimp,
if (success)
{
grid = gimp_image_get_grid (gimage);
GimpGrid *grid = gimp_image_get_grid (gimage);
if (grid)
{
style = grid->style;
......@@ -696,8 +688,8 @@ static ProcRecord image_grid_get_style_proc =
"gimp-image-grid-get-style",
"Gets the style of an image's grid.",
"This procedure retrieves the style of an image's grid.",
"Sylvain FORET",
"Sylvain FORET",
"Sylvain Foret",
"Sylvain Foret",
"2005",
NULL,
GIMP_INTERNAL,
......@@ -717,7 +709,6 @@ image_grid_set_style_invoker (Gimp *gimp,
gboolean success = TRUE;
GimpImage *gimage;
gint32 style;
GimpGrid *grid;
gimage = gimp_image_get_by_ID (gimp, args[0].value.pdb_int);
if (! GIMP_IS_IMAGE (gimage))
......@@ -729,7 +720,8 @@ image_grid_set_style_invoker (Gimp *gimp,
if (success)
{
grid = gimp_image_get_grid (gimage);
GimpGrid *grid = gimp_image_get_grid (gimage);
if (grid)
g_object_set (grid,
"style", style,
......@@ -761,8 +753,8 @@ static ProcRecord image_grid_set_style_proc =
"gimp-image-grid-set-style",
"Sets the style unit of an image's grid.",
"This procedure sets the style of an image's grid. It takes the image and the new style as parameters.",
"Sylvain FORET",
"Sylvain FORET",
"Sylvain Foret",
"Sylvain Foret",
"2005",
NULL,
GIMP_INTERNAL,
......
......@@ -16,7 +16,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
sub pdb_misc {
$author = $copyright = 'Sylvain FORET';
$author = $copyright = 'Sylvain Foret';
$date = '2005';
$since = '2.4';
}
......@@ -42,21 +42,21 @@ HELP
);
@outargs = (
{ name => "x$type",
type => $bounded_type,
{ name => "x$type", type => $bounded_type,
void_ret => 1,
desc => "The image's grid horizontal $type" },
{ name => "y$type",
type => $bounded_type,
desc => "The image's grid horizontal $type",
init => 1 },
{ name => "y$type", type => $bounded_type,
void_ret => 1,
desc => "The image's grid vertical $type" }
desc => "The image's grid vertical $type",
init => 1 }
);
%invoke = (
vars => [ 'GimpGrid *grid' ],
code => <<CODE
{
grid = gimp_image_get_grid (gimage);
GimpGrid *grid = gimp_image_get_grid (gimage);
if (grid)
{
x$type = grid->x$type;
......@@ -95,17 +95,15 @@ HELP
);
%invoke = (
vars => [ 'GimpGrid *grid' ],
code => <<CODE
{
grid = gimp_image_get_grid (gimage);
GimpGrid *grid = gimp_image_get_grid (gimage);
if (grid)
{
g_object_set (grid,
"x$type", x$type,
"y$type", y$type,
NULL);
}
g_object_set (grid,
"x$type", x$type,
"y$type", y$type,
NULL);
else
success = FALSE;
}
......@@ -136,14 +134,12 @@ HELP
);
%invoke = (
vars => [ 'GimpGrid *grid' ],
code => <<CODE
{
grid = gimp_image_get_grid (gimage);
GimpGrid *grid = gimp_image_get_grid (gimage);
if (grid)
{
$arg = grid->$arg;
}
$arg = grid->$arg;
else
success = FALSE;
}
......@@ -171,10 +167,10 @@ HELP
);
%invoke = (
vars => [ 'GimpGrid *grid' ],
code => <<CODE
{
grid = gimp_image_get_grid (gimage);
GimpGrid *grid = gimp_image_get_grid (gimage);
if (grid)
g_object_set (grid,
"$arg", &$arg,
......@@ -237,14 +233,15 @@ HELP
@outargs = (
{ name => 'style',
type => 'enum GimpGridStyle',
desc => "The image's grid style" }
desc => "The image's grid style",
init => 1 }
);
%invoke = (
vars => [ 'GimpGrid *grid' ],
code => <<CODE
{
grid = gimp_image_get_grid (gimage);
GimpGrid *grid = gimp_image_get_grid (gimage);
if (grid)
{
style = grid->style;
......@@ -275,10 +272,10 @@ HELP
);
%invoke = (
vars => [ 'GimpGrid *grid' ],
code => <<CODE
{
grid = gimp_image_get_grid (gimage);
GimpGrid *grid = gimp_image_get_grid (gimage);
if (grid)
g_object_set (grid,
"style", style,
......@@ -292,24 +289,16 @@ CODE
# Required headers
@headers = qw("core/gimpimage-grid.h"
"core/gimpgrid.h"
"libgimpbase/gimpbaseenums.h"
);
@headers = qw("core/gimpimage-grid.h" "core/gimpgrid.h"
"libgimpbase/gimpbaseenums.h");
# Exported procedures
@procs = qw(image_grid_get_spacing
image_grid_set_spacing
image_grid_get_offset
image_grid_set_offset
image_grid_get_foreground_color
image_grid_set_foreground_color
image_grid_get_background_color
image_grid_set_background_color
image_grid_get_style
image_grid_set_style
);
@procs = qw(image_grid_get_spacing image_grid_set_spacing
image_grid_get_offset image_grid_set_offset
image_grid_get_foreground_color image_grid_set_foreground_color
image_grid_get_background_color image_grid_set_background_color
image_grid_get_style image_grid_set_style);
%exports = (app => [@procs], lib => [@procs]);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment