Fix a bunch of warnings from Sparse:

2004-11-13  Manish Singh  <yosh@gimp.org>

        Fix a bunch of warnings from Sparse:

        * app/actions/dockable-commands.c
        * app/actions/layers-actions.c
        * app/actions/view-commands.c
        * app/base/pixel-surround.c
        * app/config/gimpconfig-utils.c
        * app/config/gimpscanner.c
        * app/core/gimpbrushgenerated.c
        * app/core/gimpcontainer.c
        * app/core/gimpimage.c
        * app/dialogs/palette-import-dialog.c
        * app/file/gimprecentlist.c
        * app/plug-in/plug-in-params.c
        * app/text/gimptext-compat.c
        * app/text/gimptext-parasite.c
        * app/vectors/gimpbezierstroke.c
        * app/vectors/gimpstroke.c
        * app/widgets/gimpcellrendereraccel.c
        * app/widgets/gimpselectiondata.c
        * app/xcf/xcf.c
        * libgimp/gimp.c
        * libgimpthumb/gimpthumb-utils.c
        * libgimpthumb/gimpthumbnail.c
        * modules/cdisplay_proof.c
        * plug-ins/Lighting/lighting_ui.c
        * plug-ins/common/csource.c
        * plug-ins/common/glasstile.c
        * plug-ins/common/nova.c
        * plug-ins/common/pcx.c
        * plug-ins/common/pnm.c
        * plug-ins/common/randomize.c
        * plug-ins/common/screenshot.c
        * plug-ins/common/sel_gauss.c
        * plug-ins/common/spheredesigner.c
        * plug-ins/common/wind.c
        * plug-ins/gfig/gfig-dialog.c
        * plug-ins/gfig/gfig-dobject.c
        * plug-ins/gimpressionist/gimpressionist.c
        * plug-ins/ifscompose/ifscompose.c
        * plug-ins/print/gimp_main_window.c
        * plug-ins/print/print.c: Cleanup integer vs. pointer confusion.

        * app/base/temp-buf.c
        * app/dialogs/about-dialog.c
        * plug-ins/common/bumpmap.c
        * plug-ins/common/jigsaw.c
        * plug-ins/gfig/gfig-dobject.c: Cosmetic cleanups.

        * app/config/gimpconfig-deserialize.c
        * app/config/gimpconfig-path.c
        * app/config/gimpconfigwriter.c
        * app/core/gimpgradient.c
        * app/tools/gimpdrawtool.c
        * plug-ins/common/nlfilt.c
        * plug-ins/common/unsharp.c
        * plug-ins/common/zealouscrop.c: Define inline functions before they
        are used.

        * app/core/gimpdrawable-blend.c: PixelRegion definition was changed
        some time ago, but the initialization here didn't change. Fix it.

        * app/plug-in/plug-in-rc.c (plug_in_extra_deserialize): No need to
        assign token twice in a row.

        * libgimpbase/gimpdatafiles.c (gimp_datafiles_read_directories): No
        need to initialize file_data, since the code fills out all the fields.

        * plug-ins/common/CML_explorer.c
        * plug-ins/common/vpropagate.c: Declare function pointers fully.

        * plug-ins/common/grid.c (pix_composite): G_INLINE_FUNC isn't needed,
        we assume we can use the "inline" keyword always.

        * plug-ins/common/psd_save.c
        * plug-ins/common/vinvert.c
        * plug-ins/gfig/gfig-arc.c
        * plug-ins/gfig/gfig-bezier.c
        * plug-ins/gfig/gfig-circle.c
        * plug-ins/gfig/gfig-dialog.c
        * plug-ins/gfig/gfig-dobject.c
        * plug-ins/gfig/gfig-ellipse.c
        * plug-ins/gfig/gfig-line.c
        * plug-ins/gfig/gfig-poly.c
        * plug-ins/gfig/gfig-spiral.c
        * plug-ins/gfig/gfig-star.c
        * plug-ins/gfig/gfig.c
        * plug-ins/gimpressionist/orientmap.c
        * plug-ins/gimpressionist/placement.c
        * plug-ins/gimpressionist/sizemap.c
        * plug-ins/imagemap/imap_grid.c
        * plug-ins/imagemap/imap_main.c
        * plug-ins/imagemap/imap_preferences.c
        * plug-ins/imagemap/imap_settings.c
        * plug-ins/maze/maze.c
        * plug-ins/sel2path/curve.c
        * plug-ins/sel2path/fit.c
        * plug-ins/sel2path/pxl-outline.c
        * plug-ins/sel2path/spline.c
        * plug-ins/xjt/xjt.c: Functions with no args should be declared
        with (void).

        * plug-ins/common/retinex.c (MSRCR): Initialize max_preview to quiet
        the compiler.
This commit is contained in:
Manish Singh 2004-11-14 02:50:33 +00:00 committed by Manish Singh
parent ec9ee41fe7
commit 5d01581069
91 changed files with 884 additions and 795 deletions

107
ChangeLog
View file

@ -1,3 +1,110 @@
2004-11-13 Manish Singh <yosh@gimp.org>
Fix a bunch of warnings from Sparse:
* app/actions/dockable-commands.c
* app/actions/layers-actions.c
* app/actions/view-commands.c
* app/base/pixel-surround.c
* app/config/gimpconfig-utils.c
* app/config/gimpscanner.c
* app/core/gimpbrushgenerated.c
* app/core/gimpcontainer.c
* app/core/gimpimage.c
* app/dialogs/palette-import-dialog.c
* app/file/gimprecentlist.c
* app/plug-in/plug-in-params.c
* app/text/gimptext-compat.c
* app/text/gimptext-parasite.c
* app/vectors/gimpbezierstroke.c
* app/vectors/gimpstroke.c
* app/widgets/gimpcellrendereraccel.c
* app/widgets/gimpselectiondata.c
* app/xcf/xcf.c
* libgimp/gimp.c
* libgimpthumb/gimpthumb-utils.c
* libgimpthumb/gimpthumbnail.c
* modules/cdisplay_proof.c
* plug-ins/Lighting/lighting_ui.c
* plug-ins/common/csource.c
* plug-ins/common/glasstile.c
* plug-ins/common/nova.c
* plug-ins/common/pcx.c
* plug-ins/common/pnm.c
* plug-ins/common/randomize.c
* plug-ins/common/screenshot.c
* plug-ins/common/sel_gauss.c
* plug-ins/common/spheredesigner.c
* plug-ins/common/wind.c
* plug-ins/gfig/gfig-dialog.c
* plug-ins/gfig/gfig-dobject.c
* plug-ins/gimpressionist/gimpressionist.c
* plug-ins/ifscompose/ifscompose.c
* plug-ins/print/gimp_main_window.c
* plug-ins/print/print.c: Cleanup integer vs. pointer confusion.
* app/base/temp-buf.c
* app/dialogs/about-dialog.c
* plug-ins/common/bumpmap.c
* plug-ins/common/jigsaw.c
* plug-ins/gfig/gfig-dobject.c: Cosmetic cleanups.
* app/config/gimpconfig-deserialize.c
* app/config/gimpconfig-path.c
* app/config/gimpconfigwriter.c
* app/core/gimpgradient.c
* app/tools/gimpdrawtool.c
* plug-ins/common/nlfilt.c
* plug-ins/common/unsharp.c
* plug-ins/common/zealouscrop.c: Define inline functions before they
are used.
* app/core/gimpdrawable-blend.c: PixelRegion definition was changed
some time ago, but the initialization here didn't change. Fix it.
* app/plug-in/plug-in-rc.c (plug_in_extra_deserialize): No need to
assign token twice in a row.
* libgimpbase/gimpdatafiles.c (gimp_datafiles_read_directories): No
need to initialize file_data, since the code fills out all the fields.
* plug-ins/common/CML_explorer.c
* plug-ins/common/vpropagate.c: Declare function pointers fully.
* plug-ins/common/grid.c (pix_composite): G_INLINE_FUNC isn't needed,
we assume we can use the "inline" keyword always.
* plug-ins/common/psd_save.c
* plug-ins/common/vinvert.c
* plug-ins/gfig/gfig-arc.c
* plug-ins/gfig/gfig-bezier.c
* plug-ins/gfig/gfig-circle.c
* plug-ins/gfig/gfig-dialog.c
* plug-ins/gfig/gfig-dobject.c
* plug-ins/gfig/gfig-ellipse.c
* plug-ins/gfig/gfig-line.c
* plug-ins/gfig/gfig-poly.c
* plug-ins/gfig/gfig-spiral.c
* plug-ins/gfig/gfig-star.c
* plug-ins/gfig/gfig.c
* plug-ins/gimpressionist/orientmap.c
* plug-ins/gimpressionist/placement.c
* plug-ins/gimpressionist/sizemap.c
* plug-ins/imagemap/imap_grid.c
* plug-ins/imagemap/imap_main.c
* plug-ins/imagemap/imap_preferences.c
* plug-ins/imagemap/imap_settings.c
* plug-ins/maze/maze.c
* plug-ins/sel2path/curve.c
* plug-ins/sel2path/fit.c
* plug-ins/sel2path/pxl-outline.c
* plug-ins/sel2path/spline.c
* plug-ins/xjt/xjt.c: Functions with no args should be declared
with (void).
* plug-ins/common/retinex.c (MSRCR): Initialize max_preview to quiet
the compiler.
2004-11-14 Sven Neumann <sven@gimp.org>
* themes/Default/images/Makefile.am

View file

@ -334,7 +334,7 @@ dockable_change_screen_cmd_callback (GtkAction *action,
dialog = gimp_query_int_box ("Move Dock to Screen",
dock,
NULL, 0,
NULL, NULL,
"Enter destination screen",
cur_screen, 0, num_screens - 1,
G_OBJECT (dock), "destroy",

View file

@ -385,7 +385,7 @@ layers_actions_update (GimpActionGroup *group,
{
GimpImage *gimage = action_data_get_image (data);
GimpLayer *layer = NULL;
GimpLayerMask *mask = FALSE; /* layer mask */
GimpLayerMask *mask = NULL; /* layer mask */
gboolean fs = FALSE; /* floating sel */
gboolean ac = FALSE; /* active channel */
gboolean sel = FALSE;

View file

@ -669,7 +669,7 @@ view_change_screen_cmd_callback (GtkAction *action,
dialog = gimp_query_int_box ("Move Display to Screen",
gdisp->shell,
NULL, 0,
NULL, NULL,
"Enter destination screen",
cur_screen, 0, num_screens - 1,
G_OBJECT (gdisp->shell), "destroy",

View file

@ -81,7 +81,7 @@ pixel_surround_lock (PixelSurround *ps,
if (ps->tile)
{
tile_release (ps->tile, FALSE);
ps->tile = 0;
ps->tile = NULL;
}
/* copy pixels, one by one */
@ -132,7 +132,7 @@ pixel_surround_release (PixelSurround *ps)
if (ps->tile)
{
tile_release (ps->tile, FALSE);
ps->tile = 0;
ps->tile = NULL;
}
}
@ -142,7 +142,7 @@ pixel_surround_clear (PixelSurround *ps)
if (ps->buff)
{
g_free (ps->buff);
ps->buff = 0;
ps->buff = NULL;
ps->buff_size = 0;
}
}

View file

@ -434,8 +434,8 @@ temp_buf_copy_area (TempBuf *src,
gint dest_y)
{
TempBuf *new;
PixelRegion srcPR = { 0 };
PixelRegion destPR = { 0 };
PixelRegion srcPR = { 0, };
PixelRegion destPR = { 0, };
guchar empty[MAX_CHANNELS] = { 0, 0, 0, 0 };
gint x1, y1, x2, y2;

View file

@ -89,6 +89,19 @@ static GTokenType gimp_config_deserialize_any (GValue *value,
static inline gboolean scanner_string_utf8_valid (GScanner *scanner,
const gchar *token_name);
static inline gboolean
scanner_string_utf8_valid (GScanner *scanner,
const gchar *token_name)
{
if (g_utf8_validate (scanner->value.v_string, -1, NULL))
return TRUE;
g_scanner_error (scanner,
_("value for token %s is not a valid UTF-8 string"),
token_name);
return FALSE;
}
/**
* gimp_config_deserialize_properties:
@ -777,17 +790,3 @@ gimp_config_deserialize_any (GValue *value,
return G_TOKEN_RIGHT_PAREN;
}
static inline gboolean
scanner_string_utf8_valid (GScanner *scanner,
const gchar *token_name)
{
if (g_utf8_validate (scanner->value.v_string, -1, NULL))
return TRUE;
g_scanner_error (scanner,
_("value for token %s is not a valid UTF-8 string"),
token_name);
return FALSE;
}

View file

@ -39,6 +39,29 @@ static gchar * gimp_config_path_expand_only (const gchar *path,
GError **error);
static inline gchar * extract_token (const gchar **str);
static inline gchar *
extract_token (const gchar **str)
{
const gchar *p;
gchar *token;
if (strncmp (*str, "${", 2))
return NULL;
p = *str + 2;
while (*p && (*p != '}'))
p = g_utf8_next_char (p);
if (!p)
return NULL;
token = g_strndup (*str + 2, g_utf8_pointer_to_offset (*str + 2, p));
*str = p + 1; /* after the closing bracket */
return token;
}
/**
* gimp_config_path_expand:
@ -230,27 +253,3 @@ gimp_config_path_expand_only (const gchar *path,
return expanded;
}
static inline gchar *
extract_token (const gchar **str)
{
const gchar *p;
gchar *token;
if (strncmp (*str, "${", 2))
return NULL;
p = *str + 2;
while (*p && (*p != '}'))
p = g_utf8_next_char (p);
if (!p)
return NULL;
token = g_strndup (*str + 2, g_utf8_pointer_to_offset (*str + 2, p));
*str = p + 1; /* after the closing bracket */
return token;
}

View file

@ -266,8 +266,8 @@ gimp_config_diff (GimpConfig *a,
{
GList *diff;
g_return_val_if_fail (GIMP_IS_CONFIG (a), FALSE);
g_return_val_if_fail (GIMP_IS_CONFIG (b), FALSE);
g_return_val_if_fail (GIMP_IS_CONFIG (a), NULL);
g_return_val_if_fail (GIMP_IS_CONFIG (b), NULL);
if (G_TYPE_FROM_INSTANCE (a) == G_TYPE_FROM_INSTANCE (b))
diff = gimp_config_diff_same (a, b, flags);

View file

@ -67,6 +67,29 @@ static inline void gimp_config_writer_newline (GimpConfigWriter *writer);
static gboolean gimp_config_writer_close_file (GimpConfigWriter *writer,
GError **error);
static inline void
gimp_config_writer_flush (GimpConfigWriter *writer)
{
if (write (writer->fd, writer->buffer->str, writer->buffer->len) < 0)
g_set_error (&writer->error, GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_WRITE,
g_strerror (errno));
g_string_truncate (writer->buffer, 0);
}
static inline void
gimp_config_writer_newline (GimpConfigWriter *writer)
{
gint i;
g_string_append_c (writer->buffer, '\n');
if (writer->comment)
g_string_append_len (writer->buffer, "# ", 2);
for (i = 0; i < writer->depth; i++)
g_string_append_len (writer->buffer, " ", 4);
}
/**
* gimp_config_writer_new_file:
@ -565,31 +588,6 @@ gimp_config_writer_comment (GimpConfigWriter *writer,
#undef LINE_LENGTH
}
static inline void
gimp_config_writer_flush (GimpConfigWriter *writer)
{
if (write (writer->fd, writer->buffer->str, writer->buffer->len) < 0)
g_set_error (&writer->error, GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_WRITE,
g_strerror (errno));
g_string_truncate (writer->buffer, 0);
}
static inline void
gimp_config_writer_newline (GimpConfigWriter *writer)
{
gint i;
g_string_append_c (writer->buffer, '\n');
if (writer->comment)
g_string_append_len (writer->buffer, "# ", 2);
for (i = 0; i < writer->depth; i++)
g_string_append_len (writer->buffer, " ", 4);
}
static gboolean
gimp_config_writer_close_file (GimpConfigWriter *writer,
GError **error)

View file

@ -439,7 +439,8 @@ gimp_scanner_parse_matrix2 (GScanner *scanner,
old_scope_id = g_scanner_set_scope (scanner, scope_id);
if (! g_scanner_scope_lookup_symbol (scanner, scope_id, "matrix"))
g_scanner_scope_add_symbol (scanner, scope_id, "matrix", 0);
g_scanner_scope_add_symbol (scanner, scope_id,
"matrix", GINT_TO_POINTER (0));
token = G_TOKEN_LEFT_PAREN;

View file

@ -428,7 +428,7 @@ gimp_brush_generated_dirty (GimpData *data)
gbrush->mask = temp_buf_new (width * 2 + 1,
height * 2 + 1,
1, width, height, 0);
1, width, height, NULL);
centerp = temp_buf_data (gbrush->mask) + height * gbrush->mask->width + width;

View file

@ -428,7 +428,7 @@ gimp_brush_generated_dirty (GimpData *data)
gbrush->mask = temp_buf_new (width * 2 + 1,
height * 2 + 1,
1, width, height, 0);
1, width, height, NULL);
centerp = temp_buf_data (gbrush->mask) + height * gbrush->mask->width + width;

View file

@ -428,7 +428,7 @@ gimp_brush_generated_dirty (GimpData *data)
gbrush->mask = temp_buf_new (width * 2 + 1,
height * 2 + 1,
1, width, height, 0);
1, width, height, NULL);
centerp = temp_buf_data (gbrush->mask) + height * gbrush->mask->width + width;

View file

@ -492,7 +492,7 @@ gimp_container_deserialize (GimpConfig *config,
if (! GIMP_CONFIG_GET_INTERFACE (child)->deserialize (GIMP_CONFIG (child),
scanner,
nest_level + 1,
FALSE))
NULL))
{
if (add_child)
g_object_unref (child);

View file

@ -157,10 +157,13 @@ static PixelRegion distR =
{
NULL, /* data */
NULL, /* tiles */
NULL, /* curtile */
0, 0, /* offx, offy */
0, /* rowstride */
0, 0, /* w, h */
0, 0, /* x, y */
0, 0, /* w, h */
4, /* bytes */
FALSE, /* dirty */
0 /* process count */
};

View file

@ -79,6 +79,67 @@ static inline gdouble gimp_gradient_calc_sphere_decreasing_factor (gdouble mid
static GimpDataClass *parent_class = NULL;
static inline gdouble
gimp_gradient_calc_linear_factor (gdouble middle,
gdouble pos)
{
if (pos <= middle)
{
if (middle < EPSILON)
return 0.0;
else
return 0.5 * pos / middle;
}
else
{
pos -= middle;
middle = 1.0 - middle;
if (middle < EPSILON)
return 1.0;
else
return 0.5 + 0.5 * pos / middle;
}
}
static inline gdouble
gimp_gradient_calc_curved_factor (gdouble middle,
gdouble pos)
{
if (middle < EPSILON)
middle = EPSILON;
return pow (pos, log (0.5) / log (middle));
}
static inline gdouble
gimp_gradient_calc_sine_factor (gdouble middle,
gdouble pos)
{
pos = gimp_gradient_calc_linear_factor (middle, pos);
return (sin ((-G_PI / 2.0) + G_PI * pos) + 1.0) / 2.0;
}
static inline gdouble
gimp_gradient_calc_sphere_increasing_factor (gdouble middle,
gdouble pos)
{
pos = gimp_gradient_calc_linear_factor (middle, pos) - 1.0;
return sqrt (1.0 - pos * pos); /* Works for convex increasing and concave decreasing */
}
static inline gdouble
gimp_gradient_calc_sphere_decreasing_factor (gdouble middle,
gdouble pos)
{
pos = gimp_gradient_calc_linear_factor (middle, pos);
return 1.0 - sqrt(1.0 - pos * pos); /* Works for convex decreasing and concave increasing */
}
GType
gimp_gradient_get_type (void)
@ -510,67 +571,6 @@ gimp_gradient_get_segment_at (GimpGradient *gradient,
return NULL;
}
static inline gdouble
gimp_gradient_calc_linear_factor (gdouble middle,
gdouble pos)
{
if (pos <= middle)
{
if (middle < EPSILON)
return 0.0;
else
return 0.5 * pos / middle;
}
else
{
pos -= middle;
middle = 1.0 - middle;
if (middle < EPSILON)
return 1.0;
else
return 0.5 + 0.5 * pos / middle;
}
}
static inline gdouble
gimp_gradient_calc_curved_factor (gdouble middle,
gdouble pos)
{
if (middle < EPSILON)
middle = EPSILON;
return pow (pos, log (0.5) / log (middle));
}
static inline gdouble
gimp_gradient_calc_sine_factor (gdouble middle,
gdouble pos)
{
pos = gimp_gradient_calc_linear_factor (middle, pos);
return (sin ((-G_PI / 2.0) + G_PI * pos) + 1.0) / 2.0;
}
static inline gdouble
gimp_gradient_calc_sphere_increasing_factor (gdouble middle,
gdouble pos)
{
pos = gimp_gradient_calc_linear_factor (middle, pos) - 1.0;
return sqrt (1.0 - pos * pos); /* Works for convex increasing and concave decreasing */
}
static inline gdouble
gimp_gradient_calc_sphere_decreasing_factor (gdouble middle,
gdouble pos)
{
pos = gimp_gradient_calc_linear_factor (middle, pos);
return 1.0 - sqrt(1.0 - pos * pos); /* Works for convex decreasing and concave increasing */
}
/* gradient segment functions */
GimpGradientSegment *

View file

@ -1457,7 +1457,7 @@ gimp_image_is_empty (const GimpImage *gimage)
GimpLayer *
gimp_image_floating_sel (const GimpImage *gimage)
{
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
return gimage->floating_sel;
}

View file

@ -108,7 +108,7 @@ PangoColor grad1ent[] =
PangoColor foregr0und = { 37522, 51914, 57568 };
PangoColor backgr0und = { 0, 0, 0 };
static GimpAboutInfo about_info = { 0 };
static GimpAboutInfo about_info = { 0, };
static gboolean pp = FALSE;
static gboolean about_dialog_load_logo (GtkWidget *window);

View file

@ -270,7 +270,7 @@ palette_import_dialog_new (Gimp *gimp)
/* Palette file name entry */
import_dialog->filename_entry =
gimp_file_entry_new (_("Select palette file"), 0, FALSE, FALSE);
gimp_file_entry_new (_("Select palette file"), NULL, FALSE, FALSE);
gimp_table_attach_aligned (GTK_TABLE (table), 0, 2,
NULL, 0.0, 0.5,
import_dialog->filename_entry, 1, FALSE);

View file

@ -161,7 +161,7 @@ gimp_recent_list_update_item (GList *items,
static void
parse_info_init (ParseInfo *info)
{
info->states = g_slist_prepend (NULL, STATE_START);
info->states = g_slist_prepend (NULL, GINT_TO_POINTER (STATE_START));
info->items = NULL;
}

View file

@ -329,10 +329,10 @@ plug_in_args_to_params (Argument *args,
tmp = gimp_parasite_copy (args[i].value.pdb_pointer);
if (tmp == NULL)
{
params[i].data.d_parasite.name = 0;
params[i].data.d_parasite.name = NULL;
params[i].data.d_parasite.flags = 0;
params[i].data.d_parasite.size = 0;
params[i].data.d_parasite.data = 0;
params[i].data.d_parasite.data = NULL;
}
else
{
@ -345,10 +345,10 @@ plug_in_args_to_params (Argument *args,
{
if (args[i].value.pdb_pointer == NULL)
{
params[i].data.d_parasite.name = 0;
params[i].data.d_parasite.name = NULL;
params[i].data.d_parasite.flags = 0;
params[i].data.d_parasite.size = 0;
params[i].data.d_parasite.data = 0;
params[i].data.d_parasite.data = NULL;
}
else
memcpy (&params[i].data.d_parasite,
@ -425,8 +425,8 @@ plug_in_params_destroy (GPParam *params,
{
g_free (params[i].data.d_parasite.name);
g_free (params[i].data.d_parasite.data);
params[i].data.d_parasite.name = 0;
params[i].data.d_parasite.data = 0;
params[i].data.d_parasite.name = NULL;
params[i].data.d_parasite.data = NULL;
}
break;
case GIMP_PDB_STATUS:

View file

@ -501,7 +501,7 @@ plug_in_extra_deserialize (GScanner *scanner,
while (g_scanner_peek_next_token (scanner) == G_TOKEN_LEFT_PAREN)
{
token = token = g_scanner_get_next_token (scanner);
token = g_scanner_get_next_token (scanner);
if (token != G_TOKEN_LEFT_PAREN)
return token;

View file

@ -62,13 +62,13 @@ text_render (GimpImage *gimage,
gchar *font;
gdouble size;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), FALSE);
g_return_val_if_fail (drawable == NULL || GIMP_IS_DRAWABLE (drawable), FALSE);
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
g_return_val_if_fail (drawable == NULL || GIMP_IS_DRAWABLE (drawable), NULL);
g_return_val_if_fail (drawable == NULL ||
gimp_item_is_attached (GIMP_ITEM (drawable)), FALSE);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE);
g_return_val_if_fail (fontname != NULL, FALSE);
g_return_val_if_fail (text != NULL, FALSE);
gimp_item_is_attached (GIMP_ITEM (drawable)), NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (fontname != NULL, NULL);
g_return_val_if_fail (text != NULL, NULL);
if (border < 0)
border = 0;

View file

@ -76,13 +76,13 @@ gimp_text_from_parasite (const GimpParasite *parasite,
GimpText *text;
const gchar *str;
g_return_val_if_fail (parasite != NULL, FALSE);
g_return_val_if_fail (parasite != NULL, NULL);
g_return_val_if_fail (strcmp (gimp_parasite_name (parasite),
gimp_text_parasite_name ()) == 0, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
gimp_text_parasite_name ()) == 0, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
str = gimp_parasite_data (parasite);
g_return_val_if_fail (str != NULL, FALSE);
g_return_val_if_fail (str != NULL, NULL);
text = g_object_new (GIMP_TYPE_TEXT, NULL);

View file

@ -74,6 +74,133 @@ static inline void gimp_draw_tool_shift_to_center
static GimpToolClass *parent_class = NULL;
/* private functions */
static inline void
gimp_draw_tool_shift_to_north_west (gdouble x,
gdouble y,
gint handle_width,
gint handle_height,
GtkAnchorType anchor,
gdouble *shifted_x,
gdouble *shifted_y)
{
switch (anchor)
{
case GTK_ANCHOR_CENTER:
x -= (handle_width >> 1);
y -= (handle_height >> 1);
break;
case GTK_ANCHOR_NORTH:
x -= (handle_width >> 1);
break;
case GTK_ANCHOR_NORTH_WEST:
/* nothing, this is the default */
break;
case GTK_ANCHOR_NORTH_EAST:
x -= handle_width;
break;
case GTK_ANCHOR_SOUTH:
x -= (handle_width >> 1);
y -= handle_height;
break;
case GTK_ANCHOR_SOUTH_WEST:
y -= handle_height;
break;
case GTK_ANCHOR_SOUTH_EAST:
x -= handle_width;
y -= handle_height;
break;
case GTK_ANCHOR_WEST:
y -= (handle_height >> 1);
break;
case GTK_ANCHOR_EAST:
x -= handle_width;
y -= (handle_height >> 1);
break;
default:
break;
}
if (shifted_x)
*shifted_x = x;
if (shifted_y)
*shifted_y = y;
}
static inline void
gimp_draw_tool_shift_to_center (gdouble x,
gdouble y,
gint handle_width,
gint handle_height,
GtkAnchorType anchor,
gdouble *shifted_x,
gdouble *shifted_y)
{
switch (anchor)
{
case GTK_ANCHOR_CENTER:
/* nothing, this is the default */
break;
case GTK_ANCHOR_NORTH:
y += (handle_height >> 1);
break;
case GTK_ANCHOR_NORTH_WEST:
x += (handle_width >> 1);
y += (handle_height >> 1);
break;
case GTK_ANCHOR_NORTH_EAST:
x -= (handle_width >> 1);
y += (handle_height >> 1);
break;
case GTK_ANCHOR_SOUTH:
y -= (handle_height >> 1);
break;
case GTK_ANCHOR_SOUTH_WEST:
x += (handle_width >> 1);
y -= (handle_height >> 1);
break;
case GTK_ANCHOR_SOUTH_EAST:
x -= (handle_width >> 1);
y -= (handle_height >> 1);
break;
case GTK_ANCHOR_WEST:
x += (handle_width >> 1);
break;
case GTK_ANCHOR_EAST:
x -= (handle_width >> 1);
break;
default:
break;
}
if (shifted_x)
*shifted_x = x;
if (shifted_y)
*shifted_y = y;
}
GType
gimp_draw_tool_get_type (void)
{
@ -1225,130 +1352,3 @@ gimp_draw_tool_draw_boundary (GimpDrawTool *draw_tool,
g_free (gdk_segs);
}
/* private functions */
static inline void
gimp_draw_tool_shift_to_north_west (gdouble x,
gdouble y,
gint handle_width,
gint handle_height,
GtkAnchorType anchor,
gdouble *shifted_x,
gdouble *shifted_y)
{
switch (anchor)
{
case GTK_ANCHOR_CENTER:
x -= (handle_width >> 1);
y -= (handle_height >> 1);
break;
case GTK_ANCHOR_NORTH:
x -= (handle_width >> 1);
break;
case GTK_ANCHOR_NORTH_WEST:
/* nothing, this is the default */
break;
case GTK_ANCHOR_NORTH_EAST:
x -= handle_width;
break;
case GTK_ANCHOR_SOUTH:
x -= (handle_width >> 1);
y -= handle_height;
break;
case GTK_ANCHOR_SOUTH_WEST:
y -= handle_height;
break;
case GTK_ANCHOR_SOUTH_EAST:
x -= handle_width;
y -= handle_height;
break;
case GTK_ANCHOR_WEST:
y -= (handle_height >> 1);
break;
case GTK_ANCHOR_EAST:
x -= handle_width;
y -= (handle_height >> 1);
break;
default:
break;
}
if (shifted_x)
*shifted_x = x;
if (shifted_y)
*shifted_y = y;
}
static inline void
gimp_draw_tool_shift_to_center (gdouble x,
gdouble y,
gint handle_width,
gint handle_height,
GtkAnchorType anchor,
gdouble *shifted_x,
gdouble *shifted_y)
{
switch (anchor)
{
case GTK_ANCHOR_CENTER:
/* nothing, this is the default */
break;
case GTK_ANCHOR_NORTH:
y += (handle_height >> 1);
break;
case GTK_ANCHOR_NORTH_WEST:
x += (handle_width >> 1);
y += (handle_height >> 1);
break;
case GTK_ANCHOR_NORTH_EAST:
x -= (handle_width >> 1);
y += (handle_height >> 1);
break;
case GTK_ANCHOR_SOUTH:
y -= (handle_height >> 1);
break;
case GTK_ANCHOR_SOUTH_WEST:
x += (handle_width >> 1);
y -= (handle_height >> 1);
break;
case GTK_ANCHOR_SOUTH_EAST:
x -= (handle_width >> 1);
y -= (handle_height >> 1);
break;
case GTK_ANCHOR_WEST:
x += (handle_width >> 1);
break;
case GTK_ANCHOR_EAST:
x -= (handle_width >> 1);
break;
default:
break;
}
if (shifted_x)
*shifted_x = x;
if (shifted_y)
*shifted_y = y;
}

View file

@ -270,13 +270,13 @@ gimp_bezier_stroke_open (GimpStroke *stroke,
GList *list, *list2;
GimpStroke *new_stroke = NULL;
g_return_val_if_fail (GIMP_IS_BEZIER_STROKE (stroke), FALSE);
g_return_val_if_fail (GIMP_IS_BEZIER_STROKE (stroke), NULL);
g_return_val_if_fail (end_anchor &&
end_anchor->type == GIMP_ANCHOR_ANCHOR, FALSE);
end_anchor->type == GIMP_ANCHOR_ANCHOR, NULL);
list = g_list_find (stroke->anchors, end_anchor);
g_return_val_if_fail (list != NULL && list->next != NULL, FALSE);
g_return_val_if_fail (list != NULL && list->next != NULL, NULL);
list = g_list_next (list); /* protect the handle... */

View file

@ -762,7 +762,7 @@ gimp_stroke_anchor_insert (GimpStroke *stroke,
GimpAnchor *predec,
gdouble position)
{
g_return_val_if_fail (GIMP_IS_STROKE (stroke), FALSE);
g_return_val_if_fail (GIMP_IS_STROKE (stroke), NULL);
return GIMP_STROKE_GET_CLASS (stroke)->anchor_insert (stroke,
predec, position);
@ -773,7 +773,7 @@ gimp_stroke_real_anchor_insert (GimpStroke *stroke,
GimpAnchor *predec,
gdouble position)
{
g_return_val_if_fail (GIMP_IS_STROKE (stroke), FALSE);
g_return_val_if_fail (GIMP_IS_STROKE (stroke), NULL);
return NULL;
}

View file

@ -426,7 +426,7 @@ gimp_cell_renderer_accel_start_editing (GtkCellRenderer *cell,
if (gdk_pointer_grab (widget->window, FALSE,
GDK_BUTTON_PRESS_MASK,
FALSE, NULL,
NULL, NULL,
gdk_event_get_time (event)) != GDK_GRAB_SUCCESS)
{
gdk_display_keyboard_ungrab (gtk_widget_get_display (widget),

View file

@ -724,7 +724,7 @@ gimp_selection_data_get_font (GtkSelectionData *selection,
if ((selection->format != 8) || (selection->length < 1))
{
g_warning ("Received invalid font data!");
return FALSE;
return NULL;
}
name = (gchar *) selection->data;

View file

@ -101,7 +101,7 @@ static PlugInProcDef xcf_plug_in_load_proc =
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
FALSE,
NULL,
GIMP_INTERNAL,
3,
xcf_load_args,
@ -158,7 +158,7 @@ static PlugInProcDef xcf_plug_in_save_proc =
"Spencer Kimball & Peter Mattis",
"Spencer Kimball & Peter Mattis",
"1995-1996",
FALSE,
NULL,
GIMP_INTERNAL,
5,
xcf_save_args,

View file

@ -1676,7 +1676,7 @@ gimp_config (GPConfig *config)
/* Use SysV shared memory mechanisms for transferring tile data. */
_shm_addr = (guchar *) shmat (_shm_ID, 0, 0);
_shm_addr = (guchar *) shmat (_shm_ID, NULL, 0);
if (_shm_addr == (guchar *) -1)
{

View file

@ -113,7 +113,7 @@ gimp_datafiles_read_directories (const gchar *path_str,
GimpDatafileLoaderFunc loader_func,
gpointer user_data)
{
GimpDatafileData file_data = { 0 };
GimpDatafileData file_data;
struct stat filestat;
gchar *local_path;
GList *path;

View file

@ -89,6 +89,19 @@ static GTokenType gimp_config_deserialize_any (GValue *value,
static inline gboolean scanner_string_utf8_valid (GScanner *scanner,
const gchar *token_name);
static inline gboolean
scanner_string_utf8_valid (GScanner *scanner,
const gchar *token_name)
{
if (g_utf8_validate (scanner->value.v_string, -1, NULL))
return TRUE;
g_scanner_error (scanner,
_("value for token %s is not a valid UTF-8 string"),
token_name);
return FALSE;
}
/**
* gimp_config_deserialize_properties:
@ -777,17 +790,3 @@ gimp_config_deserialize_any (GValue *value,
return G_TOKEN_RIGHT_PAREN;
}
static inline gboolean
scanner_string_utf8_valid (GScanner *scanner,
const gchar *token_name)
{
if (g_utf8_validate (scanner->value.v_string, -1, NULL))
return TRUE;
g_scanner_error (scanner,
_("value for token %s is not a valid UTF-8 string"),
token_name);
return FALSE;
}

View file

@ -39,6 +39,29 @@ static gchar * gimp_config_path_expand_only (const gchar *path,
GError **error);
static inline gchar * extract_token (const gchar **str);
static inline gchar *
extract_token (const gchar **str)
{
const gchar *p;
gchar *token;
if (strncmp (*str, "${", 2))
return NULL;
p = *str + 2;
while (*p && (*p != '}'))
p = g_utf8_next_char (p);
if (!p)
return NULL;
token = g_strndup (*str + 2, g_utf8_pointer_to_offset (*str + 2, p));
*str = p + 1; /* after the closing bracket */
return token;
}
/**
* gimp_config_path_expand:
@ -230,27 +253,3 @@ gimp_config_path_expand_only (const gchar *path,
return expanded;
}
static inline gchar *
extract_token (const gchar **str)
{
const gchar *p;
gchar *token;
if (strncmp (*str, "${", 2))
return NULL;
p = *str + 2;
while (*p && (*p != '}'))
p = g_utf8_next_char (p);
if (!p)
return NULL;
token = g_strndup (*str + 2, g_utf8_pointer_to_offset (*str + 2, p));
*str = p + 1; /* after the closing bracket */
return token;
}

View file

@ -266,8 +266,8 @@ gimp_config_diff (GimpConfig *a,
{
GList *diff;
g_return_val_if_fail (GIMP_IS_CONFIG (a), FALSE);
g_return_val_if_fail (GIMP_IS_CONFIG (b), FALSE);
g_return_val_if_fail (GIMP_IS_CONFIG (a), NULL);
g_return_val_if_fail (GIMP_IS_CONFIG (b), NULL);
if (G_TYPE_FROM_INSTANCE (a) == G_TYPE_FROM_INSTANCE (b))
diff = gimp_config_diff_same (a, b, flags);

View file

@ -67,6 +67,29 @@ static inline void gimp_config_writer_newline (GimpConfigWriter *writer);
static gboolean gimp_config_writer_close_file (GimpConfigWriter *writer,
GError **error);
static inline void
gimp_config_writer_flush (GimpConfigWriter *writer)
{
if (write (writer->fd, writer->buffer->str, writer->buffer->len) < 0)
g_set_error (&writer->error, GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_WRITE,
g_strerror (errno));
g_string_truncate (writer->buffer, 0);
}
static inline void
gimp_config_writer_newline (GimpConfigWriter *writer)
{
gint i;
g_string_append_c (writer->buffer, '\n');
if (writer->comment)
g_string_append_len (writer->buffer, "# ", 2);
for (i = 0; i < writer->depth; i++)
g_string_append_len (writer->buffer, " ", 4);
}
/**
* gimp_config_writer_new_file:
@ -565,31 +588,6 @@ gimp_config_writer_comment (GimpConfigWriter *writer,
#undef LINE_LENGTH
}
static inline void
gimp_config_writer_flush (GimpConfigWriter *writer)
{
if (write (writer->fd, writer->buffer->str, writer->buffer->len) < 0)
g_set_error (&writer->error, GIMP_CONFIG_ERROR, GIMP_CONFIG_ERROR_WRITE,
g_strerror (errno));
g_string_truncate (writer->buffer, 0);
}
static inline void
gimp_config_writer_newline (GimpConfigWriter *writer)
{
gint i;
g_string_append_c (writer->buffer, '\n');
if (writer->comment)
g_string_append_len (writer->buffer, "# ", 2);
for (i = 0; i < writer->depth; i++)
g_string_append_len (writer->buffer, " ", 4);
}
static gboolean
gimp_config_writer_close_file (GimpConfigWriter *writer,
GError **error)

View file

@ -439,7 +439,8 @@ gimp_scanner_parse_matrix2 (GScanner *scanner,
old_scope_id = g_scanner_set_scope (scanner, scope_id);
if (! g_scanner_scope_lookup_symbol (scanner, scope_id, "matrix"))
g_scanner_scope_add_symbol (scanner, scope_id, "matrix", 0);
g_scanner_scope_add_symbol (scanner, scope_id,
"matrix", GINT_TO_POINTER (0));
token = G_TOKEN_LEFT_PAREN;

View file

@ -149,7 +149,7 @@ gimp_thumb_init (const gchar *creator,
const gchar *
gimp_thumb_get_thumb_dir (GimpThumbSize size)
{
g_return_val_if_fail (gimp_thumb_initialized, FALSE);
g_return_val_if_fail (gimp_thumb_initialized, NULL);
size = gimp_thumb_size (size);
@ -173,7 +173,7 @@ gchar *
gimp_thumb_get_thumb_dir_local (const gchar *dirname,
GimpThumbSize size)
{
g_return_val_if_fail (gimp_thumb_initialized, FALSE);
g_return_val_if_fail (gimp_thumb_initialized, NULL);
g_return_val_if_fail (dirname != NULL, NULL);
g_return_val_if_fail (size > GIMP_THUMB_SIZE_FAIL, NULL);

View file

@ -240,7 +240,7 @@ gimp_thumbnail_init (GimpThumbnail *thumbnail)
thumbnail->image_width = 0;
thumbnail->image_height = 0;
thumbnail->image_mimetype = NULL;
thumbnail->image_type = 0;
thumbnail->image_type = NULL;
thumbnail->image_num_layers = 0;
thumbnail->thumb_state = GIMP_THUMB_STATE_UNKNOWN;

View file

@ -230,7 +230,7 @@ cdisplay_proof_class_init (CdisplayProofClass *klass)
g_object_class_install_property (object_class, PROP_PROFILE,
g_param_spec_string ("profile", NULL, NULL,
FALSE,
NULL,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
GIMP_MODULE_PARAM_SERIALIZE));

View file

@ -1063,7 +1063,7 @@ save_lighting_preset (GtkWidget *widget,
GList *list;
gchar *dir;
list = gimp_path_parse (lighting_effects_path, 16, FALSE, 0);
list = gimp_path_parse (lighting_effects_path, 16, FALSE, NULL);
dir = gimp_path_get_user_writable_dir (list);
gimp_path_free (list);
@ -1198,7 +1198,7 @@ load_lighting_preset (GtkWidget *widget,
GList *list;
gchar *dir;
list = gimp_path_parse (lighting_effects_path, 16, FALSE, 0);
list = gimp_path_parse (lighting_effects_path, 16, FALSE, NULL);
dir = gimp_path_get_user_writable_dir (list);
gimp_path_free (list);

View file

@ -99,12 +99,14 @@
#define HCANNONIZE(p, x) (254*(((p).range_h - (p).range_l)*(x) + (p).range_l))
#define POS_IN_TORUS(i,size) ((i < 0) ? size + i : ((size <= i) ? i - size : i))
typedef struct
typedef struct _WidgetEntry WidgetEntry;
struct _WidgetEntry
{
GtkWidget *widget;
gpointer value;
void (*updater) ();
} WidgetEntry;
void (*updater) (WidgetEntry *);
};
enum
{

View file

@ -283,9 +283,9 @@ static bumpmap_interface_t bmint =
0, /* bm_height */
0, /* bm_bpp */
FALSE, /* bm_has_alpha */
{ 0 }, /* src_rgn */
{ 0 }, /* bm_rgn */
{ 0 } /* params */
{ 0, }, /* src_rgn */
{ 0, }, /* bm_rgn */
{ 0, } /* params */
};
static GimpDrawable *drawable = NULL;

View file

@ -740,7 +740,7 @@ run_save_dialog (Config *config)
_("Op_acity:"), 100, 0,
config->opacity, 0, 100, 1, 10, 1,
TRUE, 0, 0,
FALSE, FALSE);
NULL, NULL);
g_signal_connect (adj, "value_changed",
G_CALLBACK (gimp_double_adjustment_update),
&config->opacity);

View file

@ -209,7 +209,7 @@ run (const gchar *name,
gimp_tile_cache_ntiles (2 *
(drawable->width / gimp_tile_width () + 1));
glasstile (drawable, FALSE);
glasstile (drawable, NULL);
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_displays_flush ();

View file

@ -291,7 +291,7 @@ best_cmap_match (const guchar *cmap,
return cmap_index;
}
G_INLINE_FUNC void
static inline void
pix_composite (guchar *p1,
guchar p2[4],
gint bytes,

View file

@ -336,24 +336,7 @@ struct globals_tag
typedef struct globals_tag globals_t;
static globals_t globals =
{
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
0,
0,
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0},
{0, 0, 0, 0}
};
static globals_t globals = { 0, };
MAIN ()

View file

@ -201,205 +201,6 @@ run (const gchar *name,
gimp_drawable_detach (drawable);
}
static void
nlfilter (GimpDrawable *drawable,
GimpPreview *preview)
{
GimpPixelRgn srcPr, dstPr;
guchar *srcbuf, *dstbuf;
guchar *lastrow, *thisrow, *nextrow, *temprow;
gint x1, x2, y1, y2;
guint width, height, bpp;
gint filtno, y, rowsize, exrowsize, p_update;
if (preview)
{
gimp_preview_get_position (preview, &x1, &y1);
gimp_preview_get_size (preview, &width, &height);
x2 = x1 + width;
y2 = y1 + height;
}
else
{
gimp_drawable_mask_bounds (drawable->drawable_id, &x1, &y1, &x2, &y2);
width = x2 - x1;
height = y2 - y1;
}
bpp = drawable->bpp;
rowsize = width * bpp;
exrowsize = (width + 2) * bpp;
p_update = width / 20 + 1;
gimp_tile_cache_ntiles (2 * (width / gimp_tile_width () + 1));
gimp_pixel_rgn_init (&srcPr, drawable,
x1, y1, width, height, FALSE, FALSE);
gimp_pixel_rgn_init (&dstPr, drawable,
x1, y1, width, height,
preview == NULL, TRUE);
/* source buffer gives one pixel margin all around destination buffer */
srcbuf = g_new0 (guchar, exrowsize * 3);
dstbuf = g_new0 (guchar, rowsize);
/* pointers to second pixel in each source row */
lastrow = srcbuf + bpp;
thisrow = lastrow + exrowsize;
nextrow = thisrow + exrowsize;
filtno = nlfiltInit (nlfvals.alpha, nlfvals.radius, nlfvals.filter);
if (!preview)
gimp_progress_init (_("NL Filter..."));
/* first row */
gimp_pixel_rgn_get_row (&srcPr, thisrow, x1, y1, width);
/* copy thisrow[0] to thisrow[-1], thisrow[width-1] to thisrow[width] */
memcpy (thisrow - bpp, thisrow, bpp);
memcpy (thisrow + rowsize, thisrow + rowsize - bpp, bpp);
/* copy whole thisrow to lastrow */
memcpy (lastrow - bpp, thisrow - bpp, exrowsize);
for (y = y1; y < y2 - 1; y++)
{
if (((y % p_update) == 0) && !preview)
gimp_progress_update ((gdouble) y / (gdouble) height);
gimp_pixel_rgn_get_row (&srcPr, nextrow, x1, y + 1, width);
memcpy (nextrow - bpp, nextrow, bpp);
memcpy (nextrow + rowsize, nextrow + rowsize - bpp, bpp);
nlfiltRow (lastrow, thisrow, nextrow, dstbuf, width, bpp, filtno);
gimp_pixel_rgn_set_row (&dstPr, dstbuf, x1, y, width);
/* rotate row buffers */
temprow = lastrow; lastrow = thisrow;
thisrow = nextrow; nextrow = temprow;
}
/* last row */
memcpy (nextrow - bpp, thisrow - bpp, exrowsize);
nlfiltRow (lastrow, thisrow, nextrow, dstbuf, width, bpp, filtno);
gimp_pixel_rgn_set_row (&dstPr, dstbuf, x1, y2 - 1, width);
g_free (srcbuf);
g_free (dstbuf);
if (preview)
{
gimp_drawable_preview_draw_region (GIMP_DRAWABLE_PREVIEW (preview),
&dstPr);
}
else
{
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
gimp_drawable_update (drawable->drawable_id, x1, y1, width, height);
gimp_displays_flush ();
}
}
static gboolean
nlfilter_dialog (GimpDrawable *drawable)
{
GtkWidget *dialog;
GtkWidget *main_vbox;
GtkWidget *preview;
GtkWidget *frame;
GtkWidget *alpha_trim;
GtkWidget *opt_est;
GtkWidget *edge_enhance;
GtkWidget *table;
GtkObject *adj;
gboolean run;
gimp_ui_init ("nlfilt", TRUE);
dialog = gimp_dialog_new (_("NL Filter"), "nlfilt",
NULL, 0,
gimp_standard_help_func, "plug-in-nlfilt",
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
main_vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), main_vbox);
gtk_widget_show (main_vbox);
preview = gimp_drawable_preview_new (drawable, &nlfvals.preview);
gtk_box_pack_start_defaults (GTK_BOX (main_vbox), preview);
gtk_widget_show (preview);
g_signal_connect_swapped (preview, "invalidated",
G_CALLBACK (nlfilter),
drawable);
frame = gimp_int_radio_group_new (TRUE, _("Filter"),
G_CALLBACK (gimp_radio_button_update),
&nlfvals.filter, nlfvals.filter,
_("_Alpha trimmed mean"),
filter_alpha_trim, &alpha_trim,
_("Op_timal estimation"),
filter_opt_est, &opt_est,
_("_Edge enhancement"),
filter_edge_enhance, &edge_enhance,
NULL);
gtk_box_pack_start (GTK_BOX (main_vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
g_signal_connect_swapped (alpha_trim, "toggled",
G_CALLBACK (gimp_preview_invalidate),
preview);
g_signal_connect_swapped (opt_est, "toggled",
G_CALLBACK (gimp_preview_invalidate),
preview);
g_signal_connect_swapped (edge_enhance, "toggled",
G_CALLBACK (gimp_preview_invalidate),
preview);
table = gtk_table_new (2, 3, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
gtk_box_pack_start (GTK_BOX (main_vbox), table, FALSE, FALSE, 0);
gtk_widget_show (table);
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
_("A_lpha:"), 0, 0,
nlfvals.alpha, 0.0, 1.0, 0.05, 0.1, 2,
TRUE, 0, 0,
NULL, NULL);
g_signal_connect (adj, "value_changed",
G_CALLBACK (gimp_double_adjustment_update),
&nlfvals.alpha);
g_signal_connect_swapped (adj, "value_changed",
G_CALLBACK (gimp_preview_invalidate),
preview);
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
_("_Radius:"), 0, 0,
nlfvals.radius, 1.0 / 3.0, 1.0, 0.05, 0.1, 2,
TRUE, 0, 0,
NULL, NULL);
g_signal_connect (adj, "value_changed",
G_CALLBACK (gimp_double_adjustment_update),
&nlfvals.radius);
g_signal_connect_swapped (adj, "value_changed",
G_CALLBACK (gimp_preview_invalidate),
preview);
gtk_widget_show (dialog);
run = (gimp_dialog_run (GIMP_DIALOG (dialog)) == GTK_RESPONSE_OK);
gtk_widget_destroy (dialog);
return run;
}
/* pnmnlfilt.c - 4 in 1 (2 non-linear) filter
** - smooth an anyimage
** - do alpha trimmed mean filtering on an anyimage
@ -1099,3 +900,202 @@ rectang_area (gdouble rx0, gdouble ry0, gdouble rx1, gdouble ry1, gdouble tx0,
return 0.0;
return (rx1 - rx0) * (ry1 - ry0);
}
static void
nlfilter (GimpDrawable *drawable,
GimpPreview *preview)
{
GimpPixelRgn srcPr, dstPr;
guchar *srcbuf, *dstbuf;
guchar *lastrow, *thisrow, *nextrow, *temprow;
gint x1, x2, y1, y2;
guint width, height, bpp;
gint filtno, y, rowsize, exrowsize, p_update;
if (preview)
{
gimp_preview_get_position (preview, &x1, &y1);
gimp_preview_get_size (preview, &width, &height);
x2 = x1 + width;
y2 = y1 + height;
}
else
{
gimp_drawable_mask_bounds (drawable->drawable_id, &x1, &y1, &x2, &y2);
width = x2 - x1;
height = y2 - y1;
}
bpp = drawable->bpp;
rowsize = width * bpp;
exrowsize = (width + 2) * bpp;
p_update = width / 20 + 1;
gimp_tile_cache_ntiles (2 * (width / gimp_tile_width () + 1));
gimp_pixel_rgn_init (&srcPr, drawable,
x1, y1, width, height, FALSE, FALSE);
gimp_pixel_rgn_init (&dstPr, drawable,
x1, y1, width, height,
preview == NULL, TRUE);
/* source buffer gives one pixel margin all around destination buffer */
srcbuf = g_new0 (guchar, exrowsize * 3);
dstbuf = g_new0 (guchar, rowsize);
/* pointers to second pixel in each source row */
lastrow = srcbuf + bpp;
thisrow = lastrow + exrowsize;
nextrow = thisrow + exrowsize;
filtno = nlfiltInit (nlfvals.alpha, nlfvals.radius, nlfvals.filter);
if (!preview)
gimp_progress_init (_("NL Filter..."));
/* first row */
gimp_pixel_rgn_get_row (&srcPr, thisrow, x1, y1, width);
/* copy thisrow[0] to thisrow[-1], thisrow[width-1] to thisrow[width] */
memcpy (thisrow - bpp, thisrow, bpp);
memcpy (thisrow + rowsize, thisrow + rowsize - bpp, bpp);
/* copy whole thisrow to lastrow */
memcpy (lastrow - bpp, thisrow - bpp, exrowsize);
for (y = y1; y < y2 - 1; y++)
{
if (((y % p_update) == 0) && !preview)
gimp_progress_update ((gdouble) y / (gdouble) height);
gimp_pixel_rgn_get_row (&srcPr, nextrow, x1, y + 1, width);
memcpy (nextrow - bpp, nextrow, bpp);
memcpy (nextrow + rowsize, nextrow + rowsize - bpp, bpp);
nlfiltRow (lastrow, thisrow, nextrow, dstbuf, width, bpp, filtno);
gimp_pixel_rgn_set_row (&dstPr, dstbuf, x1, y, width);
/* rotate row buffers */
temprow = lastrow; lastrow = thisrow;
thisrow = nextrow; nextrow = temprow;
}
/* last row */
memcpy (nextrow - bpp, thisrow - bpp, exrowsize);
nlfiltRow (lastrow, thisrow, nextrow, dstbuf, width, bpp, filtno);
gimp_pixel_rgn_set_row (&dstPr, dstbuf, x1, y2 - 1, width);
g_free (srcbuf);
g_free (dstbuf);
if (preview)
{
gimp_drawable_preview_draw_region (GIMP_DRAWABLE_PREVIEW (preview),
&dstPr);
}
else
{
gimp_drawable_flush (drawable);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
gimp_drawable_update (drawable->drawable_id, x1, y1, width, height);
gimp_displays_flush ();
}
}
static gboolean
nlfilter_dialog (GimpDrawable *drawable)
{
GtkWidget *dialog;
GtkWidget *main_vbox;
GtkWidget *preview;
GtkWidget *frame;
GtkWidget *alpha_trim;
GtkWidget *opt_est;
GtkWidget *edge_enhance;
GtkWidget *table;
GtkObject *adj;
gboolean run;
gimp_ui_init ("nlfilt", TRUE);
dialog = gimp_dialog_new (_("NL Filter"), "nlfilt",
NULL, 0,
gimp_standard_help_func, "plug-in-nlfilt",
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
main_vbox = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 12);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), main_vbox);
gtk_widget_show (main_vbox);
preview = gimp_drawable_preview_new (drawable, &nlfvals.preview);
gtk_box_pack_start_defaults (GTK_BOX (main_vbox), preview);
gtk_widget_show (preview);
g_signal_connect_swapped (preview, "invalidated",
G_CALLBACK (nlfilter),
drawable);
frame = gimp_int_radio_group_new (TRUE, _("Filter"),
G_CALLBACK (gimp_radio_button_update),
&nlfvals.filter, nlfvals.filter,
_("_Alpha trimmed mean"),
filter_alpha_trim, &alpha_trim,
_("Op_timal estimation"),
filter_opt_est, &opt_est,
_("_Edge enhancement"),
filter_edge_enhance, &edge_enhance,
NULL);
gtk_box_pack_start (GTK_BOX (main_vbox), frame, FALSE, FALSE, 0);
gtk_widget_show (frame);
g_signal_connect_swapped (alpha_trim, "toggled",
G_CALLBACK (gimp_preview_invalidate),
preview);
g_signal_connect_swapped (opt_est, "toggled",
G_CALLBACK (gimp_preview_invalidate),
preview);
g_signal_connect_swapped (edge_enhance, "toggled",
G_CALLBACK (gimp_preview_invalidate),
preview);
table = gtk_table_new (2, 3, FALSE);
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
gtk_box_pack_start (GTK_BOX (main_vbox), table, FALSE, FALSE, 0);
gtk_widget_show (table);
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 0,
_("A_lpha:"), 0, 0,
nlfvals.alpha, 0.0, 1.0, 0.05, 0.1, 2,
TRUE, 0, 0,
NULL, NULL);
g_signal_connect (adj, "value_changed",
G_CALLBACK (gimp_double_adjustment_update),
&nlfvals.alpha);
g_signal_connect_swapped (adj, "value_changed",
G_CALLBACK (gimp_preview_invalidate),
preview);
adj = gimp_scale_entry_new (GTK_TABLE (table), 0, 1,
_("_Radius:"), 0, 0,
nlfvals.radius, 1.0 / 3.0, 1.0, 0.05, 0.1, 2,
TRUE, 0, 0,
NULL, NULL);
g_signal_connect (adj, "value_changed",
G_CALLBACK (gimp_double_adjustment_update),
&nlfvals.radius);
g_signal_connect_swapped (adj, "value_changed",
G_CALLBACK (gimp_preview_invalidate),
preview);
gtk_widget_show (dialog);
run = (gimp_dialog_run (GIMP_DIALOG (dialog)) == GTK_RESPONSE_OK);
gtk_widget_destroy (dialog);
return run;
}

View file

@ -263,7 +263,7 @@ run (const gchar *name,
gimp_tile_cache_ntiles (2 *
(drawable->width / gimp_tile_width () + 1));
nova (drawable, 0);
nova (drawable, NULL);
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_displays_flush ();

View file

@ -530,7 +530,7 @@ save_image (const gchar *filename,
GimpPixelRgn pixel_rgn;
GimpDrawable *drawable;
GimpImageType drawable_type;
guchar *cmap= 0, *pixels;
guchar *cmap= NULL, *pixels;
gint offset_x, offset_y, width, height;
gchar *message;
int colors, i;

View file

@ -955,7 +955,7 @@ pnmscanner_create (gint fd)
s = g_new (PNMScanner, 1);
s->fd = fd;
s->inbuf = 0;
s->inbuf = NULL;
s->eof = !read(s->fd, &(s->cur), 1);
return(s);
}

View file

@ -159,7 +159,7 @@ MAIN()
static void
query ()
query (void)
{
static GimpParamDef save_args[] =
{

View file

@ -295,7 +295,7 @@ run (const gchar *name,
GimpDrawable *drawable;
GimpRunMode run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS; /* assume the best! */
gchar *rndm_type_str = '\0';
gchar *rndm_type_str = "";
gchar prog_label[32];
static GimpParam values[1];
GRand *gr; /* The GRand object which generates the

View file

@ -640,7 +640,7 @@ MSRCR (guchar *src, gint width, gint height, gint bytes, gboolean preview_mode)
gfloat alpha;
gfloat gain;
gfloat offset;
gdouble max_preview;
gdouble max_preview = 0.0;
if (!preview_mode)
{

View file

@ -318,7 +318,7 @@ run (const gchar *name,
else
status = GIMP_PDB_CALLING_ERROR;
if (!gdk_init_check (0, NULL))
if (!gdk_init_check (NULL, NULL))
status = GIMP_PDB_CALLING_ERROR;
break;

View file

@ -266,7 +266,7 @@ sel_gauss_dialog (GimpDrawable *drawable)
_("_Max. delta:"), 128, 0,
bvals.maxdelta, 0, 255, 1, 8, 0,
TRUE, 0, 0,
FALSE, FALSE);
NULL, NULL);
g_signal_connect (adj, "value_changed",
G_CALLBACK (gimp_int_adjustment_update),
&bvals.maxdelta);

View file

@ -2997,7 +2997,7 @@ sphere_main (GimpDrawable *drawable)
makewindow ();
if (!s.com.numtexture)
sphere_response (NULL, RESPONSE_RESET, 0);
sphere_response (NULL, RESPONSE_RESET, NULL);
rebuildlist ();

View file

@ -248,6 +248,123 @@ run (const gchar *name,
#endif
}
/* this function is written as if it is blurring a column at a time,
even though it can operate on rows, too. There is no difference
in the processing of the lines, at least to the blur_line function.
*/
static inline void
blur_line (gdouble *ctable,
gdouble *cmatrix,
gint cmatrix_length,
guchar *cur_col,
guchar *dest_col,
gint y,
glong bytes)
{
gdouble scale;
gdouble sum;
gint i = 0;
gint j = 0;
gint row;
gint cmatrix_middle = cmatrix_length / 2;
gdouble *cmatrix_p;
guchar *cur_col_p;
guchar *cur_col_p1;
guchar *dest_col_p;
gdouble *ctable_p;
/* this first block is the same as the non-optimized version --
* it is only used for very small pictures, so speed isn't a
* big concern.
*/
if (cmatrix_length > y)
{
for (row = 0; row < y ; row++)
{
scale=0;
/* find the scale factor */
for (j = 0; j < y ; j++)
{
/* if the index is in bounds, add it to the scale counter */
if ((j + cmatrix_length/2 - row >= 0) &&
(j + cmatrix_length/2 - row < cmatrix_length))
scale += cmatrix[j + cmatrix_length/2 - row];
}
for (i = 0; i<bytes; i++)
{
sum = 0;
for (j = 0; j < y; j++)
{
if ((j >= row - cmatrix_length/2) &&
(j <= row + cmatrix_length/2))
sum += cur_col[j*bytes + i] * cmatrix[j];
}
dest_col[row*bytes + i] = (guchar) ROUND (sum / scale);
}
}
}
else
{
/* for the edge condition, we only use available info and scale to one */
for (row = 0; row < cmatrix_middle; row++)
{
/* find scale factor */
scale=0;
for (j = cmatrix_middle - row; j<cmatrix_length; j++)
scale += cmatrix[j];
for (i = 0; i<bytes; i++)
{
sum = 0;
for (j = cmatrix_middle - row; j<cmatrix_length; j++)
{
sum += cur_col[(row + j-cmatrix_middle)*bytes + i] * cmatrix[j];
}
dest_col[row*bytes + i] = (guchar) ROUND (sum / scale);
}
}
/* go through each pixel in each col */
dest_col_p = dest_col + row*bytes;
for (; row < y-cmatrix_middle; row++)
{
cur_col_p = (row - cmatrix_middle) * bytes + cur_col;
for (i = 0; i<bytes; i++)
{
sum = 0;
cmatrix_p = cmatrix;
cur_col_p1 = cur_col_p;
ctable_p = ctable;
for (j = cmatrix_length; j>0; j--)
{
sum += *(ctable_p + *cur_col_p1);
cur_col_p1 += bytes;
ctable_p += 256;
}
cur_col_p++;
*(dest_col_p++) = ROUND (sum);
}
}
/* for the edge condition , we only use available info, and scale to one */
for (; row < y; row++)
{
/* find scale factor */
scale=0;
for (j = 0; j< y-row + cmatrix_middle; j++)
scale += cmatrix[j];
for (i = 0; i<bytes; i++)
{
sum = 0;
for (j = 0; j<y-row + cmatrix_middle; j++)
{
sum += cur_col[(row + j-cmatrix_middle)*bytes + i] * cmatrix[j];
}
dest_col[row*bytes + i] = (guchar) ROUND (sum / scale);
}
}
}
}
static void
unsharp_mask (GimpDrawable *drawable,
gdouble radius,
@ -422,123 +539,6 @@ unsharp_region (GimpPixelRgn *srcPR,
g_free (cur_row);
}
/* this function is written as if it is blurring a column at a time,
even though it can operate on rows, too. There is no difference
in the processing of the lines, at least to the blur_line function.
*/
static inline void
blur_line (gdouble *ctable,
gdouble *cmatrix,
gint cmatrix_length,
guchar *cur_col,
guchar *dest_col,
gint y,
glong bytes)
{
gdouble scale;
gdouble sum;
gint i = 0;
gint j = 0;
gint row;
gint cmatrix_middle = cmatrix_length / 2;
gdouble *cmatrix_p;
guchar *cur_col_p;
guchar *cur_col_p1;
guchar *dest_col_p;
gdouble *ctable_p;
/* this first block is the same as the non-optimized version --
* it is only used for very small pictures, so speed isn't a
* big concern.
*/
if (cmatrix_length > y)
{
for (row = 0; row < y ; row++)
{
scale=0;
/* find the scale factor */
for (j = 0; j < y ; j++)
{
/* if the index is in bounds, add it to the scale counter */
if ((j + cmatrix_length/2 - row >= 0) &&
(j + cmatrix_length/2 - row < cmatrix_length))
scale += cmatrix[j + cmatrix_length/2 - row];
}
for (i = 0; i<bytes; i++)
{
sum = 0;
for (j = 0; j < y; j++)
{
if ((j >= row - cmatrix_length/2) &&
(j <= row + cmatrix_length/2))
sum += cur_col[j*bytes + i] * cmatrix[j];
}
dest_col[row*bytes + i] = (guchar) ROUND (sum / scale);
}
}
}
else
{
/* for the edge condition, we only use available info and scale to one */
for (row = 0; row < cmatrix_middle; row++)
{
/* find scale factor */
scale=0;
for (j = cmatrix_middle - row; j<cmatrix_length; j++)
scale += cmatrix[j];
for (i = 0; i<bytes; i++)
{
sum = 0;
for (j = cmatrix_middle - row; j<cmatrix_length; j++)
{
sum += cur_col[(row + j-cmatrix_middle)*bytes + i] * cmatrix[j];
}
dest_col[row*bytes + i] = (guchar) ROUND (sum / scale);
}
}
/* go through each pixel in each col */
dest_col_p = dest_col + row*bytes;
for (; row < y-cmatrix_middle; row++)
{
cur_col_p = (row - cmatrix_middle) * bytes + cur_col;
for (i = 0; i<bytes; i++)
{
sum = 0;
cmatrix_p = cmatrix;
cur_col_p1 = cur_col_p;
ctable_p = ctable;
for (j = cmatrix_length; j>0; j--)
{
sum += *(ctable_p + *cur_col_p1);
cur_col_p1 += bytes;
ctable_p += 256;
}
cur_col_p++;
*(dest_col_p++) = ROUND (sum);
}
}
/* for the edge condition , we only use available info, and scale to one */
for (; row < y; row++)
{
/* find scale factor */
scale=0;
for (j = 0; j< y-row + cmatrix_middle; j++)
scale += cmatrix[j];
for (i = 0; i<bytes; i++)
{
sum = 0;
for (j = 0; j<y-row + cmatrix_middle; j++)
{
sum += cur_col[(row + j-cmatrix_middle)*bytes + i] * cmatrix[j];
}
dest_col[row*bytes + i] = (guchar) ROUND (sum / scale);
}
}
}
}
/* generates a 1-D convolution matrix to be used for each pass of
* a two-pass gaussian blur. Returns the length of the matrix.
*/

View file

@ -59,7 +59,7 @@ GimpPlugInInfo PLUG_IN_INFO =
MAIN ()
static void
query ()
query (void)
{
static GimpParamDef args[] =
{

View file

@ -181,9 +181,9 @@ typedef struct
{
gint applicable_image_type;
gchar *name;
void (*initializer) ();
void (*updater) ();
void (*finalizer) ();
void (*initializer) (GimpImageBaseType, gint, guchar *, guchar *, gpointer *);
void (*updater) (GimpImageBaseType, gint, guchar *, guchar *, guchar *, gpointer);
void (*finalizer) (GimpImageBaseType, gint, guchar *, guchar *, guchar *, gpointer);
} ModeParam;
#define num_mode 8

View file

@ -222,7 +222,7 @@ run (const gchar *name,
config.alg = param[6].data.d_int32;
config.edge = param[7].data.d_int32;
if (render_effect (drawable, 0) == -1)
if (render_effect (drawable, NULL) == -1)
status = GIMP_PDB_EXECUTION_ERROR;
}
break;
@ -245,7 +245,7 @@ run (const gchar *name,
case GIMP_RUN_WITH_LAST_VALS:
gimp_get_data ("plug_in_wind", &config);
if (render_effect (drawable, FALSE) == -1)
if (render_effect (drawable, NULL) == -1)
{
status = GIMP_PDB_EXECUTION_ERROR;
gimp_message ("An execution error occured.");

View file

@ -49,6 +49,22 @@ static gint bytes;
MAIN ()
static inline gint
colours_equal (const guchar *col1,
const guchar *col2,
gint bytes)
{
gint b;
for (b = 0; b < bytes; b++)
{
if (col1[b] != col2[b])
return FALSE;
}
return TRUE;
}
static void
query (void)
{
@ -268,20 +284,3 @@ do_zcrop (GimpDrawable *drawable,
gimp_image_undo_group_end (image_id);
}
static inline gint
colours_equal (const guchar *col1,
const guchar *col2,
gint bytes)
{
gint b;
for (b = 0; b < bytes; b++)
{
if (col1[b] != col2[b])
return FALSE;
}
return TRUE;
}

View file

@ -538,7 +538,7 @@ d_copy_arc (Dobject *obj)
}
void
d_arc_object_class_init ()
d_arc_object_class_init (void)
{
DobjClass *class = &dobj_class[ARC];

View file

@ -295,7 +295,7 @@ d_copy_bezier (Dobject *obj)
}
void
d_bezier_object_class_init ()
d_bezier_object_class_init (void)
{
DobjClass *class = &dobj_class[BEZIER];

View file

@ -149,7 +149,7 @@ d_copy_circle (Dobject * obj)
}
void
d_circle_object_class_init ()
d_circle_object_class_init (void)
{
DobjClass *class = &dobj_class[CIRCLE];

View file

@ -720,7 +720,7 @@ create_save_file_chooser (GFigObj *obj,
GList *list;
gchar *dir;
list = gimp_path_parse (gfig_path, 16, FALSE, 0);
list = gimp_path_parse (gfig_path, 16, FALSE, NULL);
dir = gimp_path_get_user_writable_dir (list);
gimp_path_free (list);
@ -1849,7 +1849,7 @@ draw_sqr (GdkPoint *p)
*/
void
draw_grid_clear ()
draw_grid_clear (void)
{
/* wipe slate and start again */
gtk_widget_queue_draw (gfig_context->preview);

View file

@ -200,7 +200,7 @@ d_new_object (DobjType type,
}
void
gfig_init_object_classes ()
gfig_init_object_classes (void)
{
d_arc_object_class_init ();
d_line_object_class_init ();
@ -459,7 +459,7 @@ object_operation_end (GdkPoint *pnt,
if (move_all_pnt)
{
g_free (move_all_pnt);
move_all_pnt = 0;
move_all_pnt = NULL;
}
/* Special case - if copying mode MUST be copy when button up received */
@ -1002,7 +1002,7 @@ get_line (gchar *buf,
gint init)
{
gint slen;
char * ret;
char *ret;
if (init)
line_no = 1;
@ -1012,7 +1012,8 @@ get_line (gchar *buf,
do
{
ret = fgets (buf, s, from);
} while (!ferror (from) && buf[0] == '#');
}
while (!ferror (from) && buf[0] == '#');
slen = strlen (buf);
@ -1023,14 +1024,14 @@ get_line (gchar *buf,
if (ferror (from))
{
g_warning (_("Error reading file"));
return (0);
return NULL;
}
#ifdef DEBUG
printf ("Processing line '%s'\n", buf);
#endif /* DEBUG */
return (ret);
return ret;
}
void

View file

@ -283,7 +283,7 @@ d_copy_ellipse (Dobject * obj)
}
void
d_ellipse_object_class_init ()
d_ellipse_object_class_init (void)
{
DobjClass *class = &dobj_class[ELLIPSE];

View file

@ -134,7 +134,7 @@ d_paint_line (Dobject *obj)
*/
void
d_line_object_class_init ()
d_line_object_class_init (void)
{
DobjClass *class = &dobj_class[LINE];

View file

@ -478,7 +478,7 @@ d_copy_poly (Dobject *obj)
}
void
d_poly_object_class_init ()
d_poly_object_class_init (void)
{
DobjClass *class = &dobj_class[POLY];

View file

@ -276,7 +276,7 @@ d_copy_spiral (Dobject *obj)
}
void
d_spiral_object_class_init ()
d_spiral_object_class_init (void)
{
DobjClass *class = &dobj_class[SPIRAL];

View file

@ -319,7 +319,7 @@ d_copy_star (Dobject *obj)
}
void
d_star_object_class_init ()
d_star_object_class_init (void)
{
DobjClass *class = &dobj_class[STAR];

View file

@ -656,7 +656,7 @@ load_options (GFigObj *gfig,
}
GString *
gfig_save_as_string ()
gfig_save_as_string (void)
{
DAllObjs *objs;
gint count = 0;
@ -698,7 +698,7 @@ gfig_save_as_string ()
gboolean
gfig_save_as_parasite ()
gfig_save_as_parasite (void)
{
GimpParasite *parasite;
GString *string;
@ -730,7 +730,7 @@ gfig_save_as_parasite ()
}
GFigObj *
gfig_load_from_parasite ()
gfig_load_from_parasite (void)
{
FILE *fp;
gchar *fname;

View file

@ -232,7 +232,7 @@ create_dialog (void)
create_colorpage (GTK_NOTEBOOK (notebook));
create_generalpage (GTK_NOTEBOOK (notebook));
updatepreview (NULL, 0);
updatepreview (NULL, NULL);
/*
* This is to make sure the values from the pcvals will be reflected

View file

@ -256,7 +256,7 @@ update_vector_prev (void)
}
void
orientation_map_free_resources ()
orientation_map_free_resources (void)
{
ppm_kill (&update_om_preview_nbuffer);
ppm_kill (&update_vector_preview_backup);

View file

@ -18,7 +18,7 @@ static GtkWidget *placement_center = NULL;
static GtkObject *brush_density_adjust = NULL;
void
place_restore ()
place_restore (void)
{
gtk_toggle_button_set_active
(GTK_TOGGLE_BUTTON (placement_radio[pcvals.place_type]), TRUE);
@ -35,7 +35,7 @@ place_type_input (int in)
}
void
place_store ()
place_store (void)
{
pcvals.placement_center = GTK_TOGGLE_BUTTON (placement_center)->active;
}

View file

@ -152,7 +152,7 @@ updatesmvectorprev (void)
}
void
size_map_free_resources ()
size_map_free_resources (void)
{
ppm_kill (&update_vector_preview_backup);
ppm_kill (&update_vector_preview_sbuffer);

View file

@ -1897,7 +1897,7 @@ undo_exchange (gint el)
if (!elements[i])
{
elements[i] = undo_ring[el].elements[i];
undo_ring[el].elements[i] = 0;
undo_ring[el].elements[i] = NULL;
}
else
aff_element_compute_trans (elements[i],width, height,

View file

@ -188,7 +188,7 @@ top_changed_cb(GtkWidget *widget, gpointer data)
}
static GridDialog_t*
create_grid_settings_dialog()
create_grid_settings_dialog(void)
{
GridDialog_t *data = g_new(GridDialog_t, 1);
DefaultDialog_t *dialog;

View file

@ -109,7 +109,7 @@ static int run_flag = 0;
MAIN ()
static void query()
static void query(void)
{
static GimpParamDef args[] = {
{GIMP_PDB_INT32, "run_mode", "Interactive"},

View file

@ -551,7 +551,7 @@ switch_page(GtkWidget *widget, GtkNotebookPage *page, gint page_num,
}
static PreferencesDialog_t*
create_preferences_dialog()
create_preferences_dialog(void)
{
PreferencesDialog_t *data = g_new(PreferencesDialog_t, 1);
DefaultDialog_t *dialog;

View file

@ -81,7 +81,7 @@ type_toggled_cb(GtkWidget *widget, gpointer data)
}
static SettingsDialog_t*
create_settings_dialog()
create_settings_dialog(void)
{
SettingsDialog_t *data = g_new(SettingsDialog_t, 1);
GtkWidget *table, *view, *frame, *hbox, *label, *swin;

View file

@ -134,7 +134,7 @@ MAIN ()
static void
query ()
query (void)
{
static GimpParamDef args[] =
{

View file

@ -262,7 +262,7 @@ Combo_get_name(GtkWidget *combo,
return NULL;
}
static stp_param_t *printer_list = 0;
static stp_param_t *printer_list = NULL;
static int printer_count = 0;
static void

View file

@ -78,7 +78,7 @@ gp_plist_t *plist; /* System printers */
int saveme = FALSE; /* True if print should proceed */
int runme = FALSE; /* True if print should proceed */
stp_printer_t current_printer = 0; /* Current printer index */
stp_printer_t current_printer = NULL; /* Current printer index */
gint32 image_ID; /* image ID */
gchar *image_name;
@ -756,7 +756,7 @@ printrc_load (void)
gp_plist_t key; /* Search key */
gint format = 0; /* rc file format version */
gint system_printers; /* printer count before reading printrc */
gchar * current_printer = 0; /* printer to select */
gchar * current_printer = NULL; /* printer to select */
check_plist(1);

View file

@ -27,7 +27,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Return an entirely empty curve. */
curve_type
new_curve ()
new_curve (void)
{
curve_type curve = g_new (struct curve, 1);
@ -103,7 +103,7 @@ append_point (curve_type curve, real_coordinate_type coord)
/* Return an initialized but empty curve list. */
curve_list_type
new_curve_list ()
new_curve_list (void)
{
curve_list_type curve_list;
@ -144,7 +144,7 @@ append_curve (curve_list_type *curve_list, curve_type curve)
/* Return an initialized but empty curve list array. */
curve_list_array_type
new_curve_list_array ()
new_curve_list_array (void)
{
curve_list_array_type curve_list_array;

View file

@ -1918,7 +1918,7 @@ align (spline_list_type *l)
/* Lists of array indices (well, that is what we use it for). */
static index_list_type
new_index_list ()
new_index_list (void)
{
index_list_type index_list;

View file

@ -70,7 +70,7 @@ local_free_bitmap (bitmap_type *b)
find these outlines and put them in a list to return. */
pixel_outline_list_type
find_outline_pixels ()
find_outline_pixels (void)
{
pixel_outline_list_type outline_list;
unsigned row, col;
@ -193,7 +193,7 @@ free_pixel_outline_list (pixel_outline_list_type *outline_list)
pixel_outline_type
new_pixel_outline ()
new_pixel_outline (void)
{
pixel_outline_type pixel_outline;

View file

@ -29,7 +29,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
garbage. */
spline_type
new_spline ()
new_spline (void)
{
real_coordinate_type coord = { -100.0, -100.0 };
spline_type spline;
@ -113,7 +113,7 @@ evaluate_spline (spline_type s, real t)
/* Return a new, empty, spline list. */
spline_list_type *
new_spline_list ()
new_spline_list (void)
{
spline_list_type *answer = g_new (spline_list_type, 1);
@ -189,7 +189,7 @@ concat_spline_lists (spline_list_type *s1, spline_list_type s2)
/* Return a new, empty, spline list array. */
spline_list_array_type
new_spline_list_array ()
new_spline_list_array (void)
{
spline_list_array_type answer;

View file

@ -1912,7 +1912,7 @@ cleanup:
* allocate new layer_properties element and init with default values
* ============================================================================
*/
t_layer_props * p_new_layer_prop()
t_layer_props * p_new_layer_prop(void)
{
t_layer_props *l_new_prop;
@ -1945,7 +1945,7 @@ t_layer_props * p_new_layer_prop()
* allocate new channel_properties element and init with default values
* ============================================================================
*/
t_channel_props * p_new_channel_prop()
t_channel_props * p_new_channel_prop(void)
{
t_channel_props *l_new_prop;
@ -1975,7 +1975,7 @@ t_channel_props * p_new_channel_prop()
* allocate new guide_properties element and init with default values
* ============================================================================
*/
t_guide_props * p_new_guide_prop()
t_guide_props * p_new_guide_prop(void)
{
t_guide_props *l_new_prop;
@ -1991,7 +1991,7 @@ t_guide_props * p_new_guide_prop()
* allocate new parasite_properties element and init with default values
* ============================================================================
*/
t_parasite_props * p_new_parasite_prop()
t_parasite_props * p_new_parasite_prop(void)
{
t_parasite_props *l_new_prop;
@ -2010,7 +2010,7 @@ t_parasite_props * p_new_parasite_prop()
* allocate new parasite_properties element and init with default values
* ============================================================================
*/
t_path_props * p_new_path_prop()
t_path_props * p_new_path_prop(void)
{
t_path_props *l_new_prop;
@ -2032,7 +2032,7 @@ t_path_props * p_new_path_prop()
* allocate new layer_properties element and init with default values
* ============================================================================
*/
t_image_props * p_new_image_prop()
t_image_props * p_new_image_prop(void)
{
t_image_props *l_new_prop;