diff --git a/ChangeLog b/ChangeLog index 38d2b791b6..33e4ce59b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2008-03-28 Mukund Sivaraman + + Fixes for some Sparse reported issues in app/ + + * app/core/gimpdrawable-operation.c: Added prototype for + gegl_node_add_child(). + + * app/core/gimpcurve.c: Remove C99 code + + * app/tools/gimpcurvestool.c + * app/tools/gimpperspectiveclonetool.c + * app/vectors/gimpstroke.c: Mark functions as static. + + * app/base/siox.c: state is a pointer. + + * app/plug-in/gimppluginprocframe.c: values is a pointer. + + * app/plug-in/plug-in-rc.c: plug_in_rc_parse() returns a pointer. + + * app/plug-in/gimpinterpreterdb.c: Check program[0] for '\0' + instead of the pointer program itself. + 2008-03-28 Mukund Sivaraman * plug-ins/common/png.c: Fixed a bug where a pointer to a gint diff --git a/app/base/siox.c b/app/base/siox.c index e0001df4f8..4b9740bc13 100644 --- a/app/base/siox.c +++ b/app/base/siox.c @@ -1294,7 +1294,7 @@ siox_drb (SioxState *state, gpointer pr; gint row, col; - g_return_if_fail (state != 0); + g_return_if_fail (state != NULL); g_return_if_fail (mask != NULL && tile_manager_bpp (mask) == 1); pixel_region_init (&srcPR, state->pixels, diff --git a/app/core/gimpcurve.c b/app/core/gimpcurve.c index 377fc7d3ca..34188c5fc3 100644 --- a/app/core/gimpcurve.c +++ b/app/core/gimpcurve.c @@ -713,13 +713,15 @@ static void gimp_curve_calculate (GimpCurve *curve) { gint i; - gint points[curve->n_points]; + gint *points; gint num_pts; gint p1, p2, p3, p4; if (GIMP_DATA (curve)->freeze_count > 0) return; + points = g_newa (gint, curve->n_points); + switch (curve->curve_type) { case GIMP_CURVE_SMOOTH: diff --git a/app/core/gimpdrawable-operation.c b/app/core/gimpdrawable-operation.c index ab2a763078..06680870a2 100644 --- a/app/core/gimpdrawable-operation.c +++ b/app/core/gimpdrawable-operation.c @@ -32,6 +32,11 @@ #include "gimpprogress.h" +#warning FIXME: gegl_node_add_child() is not public API + +extern GeglNode * gegl_node_add_child (GeglNode *self, + GeglNode *child); + void gimp_drawable_apply_operation (GimpDrawable *drawable, GeglNode *operation, @@ -69,6 +74,8 @@ gimp_drawable_apply_operation (GimpDrawable *drawable, "linear", linear, NULL); +#warning FIXME: gegl_node_add_child() is not public API + gegl_node_add_child (gegl, operation); gegl_node_link_many (input, operation, output, NULL); diff --git a/app/plug-in/gimpinterpreterdb.c b/app/plug-in/gimpinterpreterdb.c index a1b9c5f84b..a28c66a157 100644 --- a/app/plug-in/gimpinterpreterdb.c +++ b/app/plug-in/gimpinterpreterdb.c @@ -297,7 +297,8 @@ gimp_interpreter_db_add_binfmt_misc (GimpInterpreterDB *db, type = tokens[1]; program = tokens[5]; - if (name[0] == '\0' || program == '\0' || type[0] == '\0' || type[1] != '\0') + if ((name[0] == '\0') || (program[0] == '\0') || + (type[0] == '\0') || (type[1] != '\0')) goto bail; switch (type[0]) diff --git a/app/plug-in/gimppluginprocframe.c b/app/plug-in/gimppluginprocframe.c index 7639485668..728e82db64 100644 --- a/app/plug-in/gimppluginprocframe.c +++ b/app/plug-in/gimppluginprocframe.c @@ -181,7 +181,7 @@ gimp_plug_in_proc_frame_get_return_vals (GimpPlugInProcFrame *proc_frame) /* Free the old arguments. */ g_free (proc_frame->return_vals->values); - proc_frame->return_vals->values = 0; + proc_frame->return_vals->values = NULL; proc_frame->return_vals->n_values = 0; g_value_array_free (proc_frame->return_vals); } diff --git a/app/plug-in/plug-in-rc.c b/app/plug-in/plug-in-rc.c index f213187263..9f92d1ce8c 100644 --- a/app/plug-in/plug-in-rc.c +++ b/app/plug-in/plug-in-rc.c @@ -102,9 +102,9 @@ plug_in_rc_parse (Gimp *gimp, gint version = GIMP_PROTOCOL_VERSION; GTokenType token; - g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE); - g_return_val_if_fail (filename != NULL, FALSE); - g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); + g_return_val_if_fail (filename != NULL, NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); scanner = gimp_scanner_new_file (filename, error); diff --git a/app/tools/gimpcurvestool.c b/app/tools/gimpcurvestool.c index ed5388fc2b..fb5446a88e 100644 --- a/app/tools/gimpcurvestool.c +++ b/app/tools/gimpcurvestool.c @@ -284,7 +284,7 @@ gimp_curves_tool_button_release (GimpTool *tool, release_type, display); } -gboolean +static gboolean gimp_curves_tool_key_press (GimpTool *tool, GdkEventKey *kevent, GimpDisplay *display) diff --git a/app/tools/gimpperspectiveclonetool.c b/app/tools/gimpperspectiveclonetool.c index 130d4da0e8..4037fd9bad 100644 --- a/app/tools/gimpperspectiveclonetool.c +++ b/app/tools/gimpperspectiveclonetool.c @@ -429,7 +429,7 @@ gimp_perspective_clone_tool_prepare (GimpPerspectiveCloneTool *clone_tool, clone_tool->trans_info[Y3] = clone_tool->y2; } -void +static void gimp_perspective_clone_tool_recalc (GimpPerspectiveCloneTool *clone_tool, GimpDisplay *display) { diff --git a/app/vectors/gimpstroke.c b/app/vectors/gimpstroke.c index f636a2adde..826c5b4950 100644 --- a/app/vectors/gimpstroke.c +++ b/app/vectors/gimpstroke.c @@ -636,7 +636,7 @@ gimp_stroke_point_is_movable (GimpStroke *stroke, } -gboolean +static gboolean gimp_stroke_real_point_is_movable (GimpStroke *stroke, GimpAnchor *predec, gdouble position) @@ -660,7 +660,7 @@ gimp_stroke_point_move_relative (GimpStroke *stroke, } -void +static void gimp_stroke_real_point_move_relative (GimpStroke *stroke, GimpAnchor *predec, gdouble position, @@ -685,7 +685,7 @@ gimp_stroke_point_move_absolute (GimpStroke *stroke, feature); } -void +static void gimp_stroke_real_point_move_absolute (GimpStroke *stroke, GimpAnchor *predec, gdouble position, @@ -780,7 +780,7 @@ gimp_stroke_anchor_is_insertable (GimpStroke *stroke, position); } -gboolean +static gboolean gimp_stroke_real_anchor_is_insertable (GimpStroke *stroke, GimpAnchor *predec, gdouble position) @@ -802,7 +802,7 @@ gimp_stroke_anchor_insert (GimpStroke *stroke, predec, position); } -GimpAnchor * +static GimpAnchor * gimp_stroke_real_anchor_insert (GimpStroke *stroke, GimpAnchor *predec, gdouble position) @@ -982,7 +982,7 @@ gimp_stroke_duplicate (const GimpStroke *stroke) return GIMP_STROKE_GET_CLASS (stroke)->duplicate (stroke); } -GimpStroke * +static GimpStroke * gimp_stroke_real_duplicate (const GimpStroke *stroke) { GimpStroke *new_stroke;