Commit 82166386 authored by Mukund Sivaraman's avatar Mukund Sivaraman Committed by Mukund Sivaraman

plug-ins/common/sinus.c plug-ins/common/compose.c

2008-03-28  Mukund Sivaraman  <muks@mukund.org>

        * plug-ins/common/sinus.c
        * plug-ins/common/compose.c
        * plug-ins/common/screenshot.c
        * plug-ins/common/mng.c
        * plug-ins/common/wind.c
        * plug-ins/common/gif-save.c
        * plug-ins/common/video.c
        * plug-ins/common/sphere-designer.c
        * plug-ins/common/hot.c
        * plug-ins/common/red-eye-removal.c
        * plug-ins/common/tile-small.c
        * plug-ins/common/gbr.c
        * plug-ins/common/jigsaw.c
        * plug-ins/common/glob.c
        * plug-ins/common/despeckle.c
        * plug-ins/common/noise-randomize.c
        * plug-ins/common/convolution-matrix.c
        * plug-ins/common/gif-load.c
        * plug-ins/common/psd-save.c
        * plug-ins/common/emboss.c
        * plug-ins/common/csource.c
        * plug-ins/common/cml-explorer.c
        * plug-ins/common/grid.c
        * plug-ins/common/pcx.c
        * plug-ins/common/engrave.c
        * plug-ins/common/curve-bend.c: Cleanups / fixes for issues
        reported by Sparse.


svn path=/trunk/; revision=25295
parent 1a0db1b5
2008-03-28 Mukund Sivaraman <muks@mukund.org>
* plug-ins/common/sinus.c
* plug-ins/common/compose.c
* plug-ins/common/screenshot.c
* plug-ins/common/mng.c
* plug-ins/common/wind.c
* plug-ins/common/gif-save.c
* plug-ins/common/video.c
* plug-ins/common/sphere-designer.c
* plug-ins/common/hot.c
* plug-ins/common/red-eye-removal.c
* plug-ins/common/tile-small.c
* plug-ins/common/gbr.c
* plug-ins/common/jigsaw.c
* plug-ins/common/glob.c
* plug-ins/common/despeckle.c
* plug-ins/common/noise-randomize.c
* plug-ins/common/convolution-matrix.c
* plug-ins/common/gif-load.c
* plug-ins/common/psd-save.c
* plug-ins/common/emboss.c
* plug-ins/common/csource.c
* plug-ins/common/cml-explorer.c
* plug-ins/common/grid.c
* plug-ins/common/pcx.c
* plug-ins/common/engrave.c
* plug-ins/common/curve-bend.c: Cleanups / fixes for issues
reported by Sparse.
2008-03-28 Mukund Sivaraman <muks@mukund.org>
* plug-ins/common/lcms.c: gimp_md5_get_digest() is deprecated;
......
......@@ -1749,7 +1749,7 @@ CML_dialog_advanced_panel_new (void)
return vbox;
}
void
static void
preview_update (void)
{
if (! CML_preview_defer)
......
......@@ -156,9 +156,9 @@ static void type_combo_callback (GimpIntComboBox *combo,
/* LAB colorspace constants */
const double Xn = 0.951;
const double Yn = 1.0;
const double Zn = 1.089;
static const double Xn = 0.951;
static const double Yn = 1.0;
static const double Zn = 1.089;
/* Maximum number of images to compose */
#define MAX_COMPOSE_IMAGES 4
......
......@@ -173,7 +173,7 @@ struct
GtkWidget *bmode[BORDER_MODES];
GtkWidget *channels[CHANNELS];
GtkWidget *autoset;
} widget_set;
} static widget_set;
MAIN ()
......
......@@ -72,7 +72,7 @@ const GimpPlugInInfo PLUG_IN_INFO =
run, /* run_proc */
};
Config config =
static Config config =
{
NULL, /* file_name */
"gimp_image", /* prefixed_name */
......
......@@ -1049,7 +1049,7 @@ p_delta_gint32 (gint32 *val,
*val = val_from + delta;
}
void
static void
p_copy_points (BenderDialog *cd,
int outline,
int xy,
......@@ -1068,7 +1068,7 @@ p_copy_points (BenderDialog *cd,
}
}
void
static void
p_copy_yval (BenderDialog *cd,
int outline,
int argc,
......@@ -2537,7 +2537,7 @@ p_put_pixel (t_GDRW *gdrw,
gimp_pixel_fetcher_put_pixel (gdrw->pft, x, y, pixel);
}
void
static void
p_put_mix_pixel (t_GDRW *gdrw,
gint32 x,
gint32 y,
......@@ -2622,7 +2622,7 @@ p_clear_drawable (GimpDrawable *drawable)
* p_create_pv_image
* ============================================================================
*/
gint32
static gint32
p_create_pv_image (GimpDrawable *src_drawable,
gint32 *layer_id)
{
......@@ -2756,7 +2756,7 @@ p_add_layer (gint width,
* ============================================================================
*/
void
static void
p_bender_calculate_iter_curve (BenderDialog *cd,
gint32 xmax,
gint32 ymax)
......@@ -3149,7 +3149,7 @@ p_vertical_bend (BenderDialog *cd,
* ============================================================================
*/
gint32
static gint32
p_main_bend (BenderDialog *cd,
GimpDrawable *original_drawable,
gint work_on_copy)
......
......@@ -88,11 +88,6 @@ static void preview_update (GtkWidget *preview);
static gint quick_median_select (const guchar **p,
guchar *i,
gint n);
static inline guchar pixel_luminance (const guchar *p,
gint bpp);
static inline void pixel_copy (guchar *dest,
const guchar *src,
gint bpp);
/*
* Globals...
......@@ -321,6 +316,42 @@ run (const gchar *name,
gimp_drawable_detach (drawable);
}
static inline guchar
pixel_luminance (const guchar *p,
gint bpp)
{
switch (bpp)
{
case 1:
case 2:
return p[0];
case 3:
case 4:
return GIMP_RGB_LUMINANCE (p[0], p[1], p[2]);
default:
return 0; /* should not be reached */
}
}
static inline void
pixel_copy (guchar *dest,
const guchar *src,
gint bpp)
{
switch (bpp)
{
case 4:
*dest++ = *src++;
case 3:
*dest++ = *src++;
case 2:
*dest++ = *src++;
case 1:
*dest++ = *src++;
}
}
/*
* 'despeckle()' - Despeckle an image using a median filter.
......@@ -796,39 +827,3 @@ quick_median_select (const guchar **p,
}
}
static inline guchar
pixel_luminance (const guchar *p,
gint bpp)
{
switch (bpp)
{
case 1:
case 2:
return p[0];
case 3:
case 4:
return GIMP_RGB_LUMINANCE (p[0], p[1], p[2]);
default:
return 0; /* should not be reached */
}
}
static inline void
pixel_copy (guchar *dest,
const guchar *src,
gint bpp)
{
switch (bpp)
{
case 4:
*dest++ = *src++;
case 3:
*dest++ = *src++;
case 2:
*dest++ = *src++;
case 1:
*dest++ = *src++;
}
}
......@@ -69,7 +69,7 @@ struct embossFilter
gdouble Nz2;
gdouble NzLz;
gdouble bg;
} Filter;
} static Filter;
static void query (void);
static void run (const gchar *name,
......
......@@ -413,7 +413,7 @@ typedef struct
guchar *data;
} PixelArea;
PixelArea area;
static PixelArea area;
static void
engrave_small (GimpDrawable *drawable,
......
......@@ -109,7 +109,7 @@ const GimpPlugInInfo PLUG_IN_INFO =
/* private variables */
BrushInfo info =
static BrushInfo info =
{
"GIMP Brush",
10
......
......@@ -581,7 +581,7 @@ DoExtension (FILE *fd,
return FALSE;
}
int ZeroDataBlock = FALSE;
static int ZeroDataBlock = FALSE;
static int
GetDataBlock (FILE *fd,
......
......@@ -105,7 +105,7 @@ static gboolean comment_was_edited = FALSE;
static GimpRunMode run_mode;
#ifdef FACEHUGGERS
GimpParasite * comment_parasite = NULL;
static GimpParasite * comment_parasite = NULL;
#endif
/* For compression code */
......
......@@ -443,7 +443,7 @@ fnmatch_intern (const gchar *pattern,
return FALSE;
}
gboolean
static gboolean
glob_fnmatch (const gchar *pattern,
const gchar *string)
{
......
......@@ -100,7 +100,7 @@ typedef struct
GimpRGB icolor;
} Config;
Config grid_cfg =
static Config grid_cfg =
{
1, 16, 8, { 0.0, 0.0, 0.0, 1.0 }, /* horizontal */
1, 16, 8, { 0.0, 0.0, 0.0, 1.0 }, /* vertical */
......
......@@ -111,7 +111,7 @@ struct
gdouble pedestal;
gdouble gamma;
gdouble code[3][3];
} mode[2] = {
} static mode[2] = {
{
7.5,
2.2,
......
......@@ -333,7 +333,7 @@ struct globals_tag
typedef struct globals_tag globals_t;
static globals_t globals = { { 0 } };
static globals_t globals;
MAIN ()
......
......@@ -140,7 +140,7 @@ struct mng_data_t
/* Values of the instance of the above struct when the plug-in is
* first invoked. */
struct mng_data_t mng_data =
static struct mng_data_t mng_data =
{
FALSE, /* interlaced */
FALSE, /* bkgd */
......@@ -573,7 +573,7 @@ mng_save_image (const gchar *filename,
goto err;
}
handle = mng_initialize ((mng_ptr) userdata, myalloc, myfree, MNG_NULL);
handle = mng_initialize ((mng_ptr) userdata, myalloc, myfree, NULL);
if (NULL == handle)
{
g_warning ("Unable to mng_initialize() in mng_save_image()");
......@@ -875,7 +875,7 @@ mng_save_image (const gchar *filename,
layer_offset_x + layer_cols,
layer_offset_y,
layer_offset_y + layer_rows,
0, 0) != MNG_NOERROR)
0, NULL) != MNG_NOERROR)
{
g_warning ("Unable to mng_putchunk_fram() in mng_save_image()");
goto err3;
......
......@@ -90,14 +90,14 @@
*/
#define PROG_UPDATE_TIME ((row % 12) == 0)
gchar *PLUG_IN_PROC[] =
static gchar *PLUG_IN_PROC[] =
{
"plug-in-randomize-hurl",
"plug-in-randomize-pick",
"plug-in-randomize-slur",
};
gchar *RNDM_NAME[] =
static gchar *RNDM_NAME[] =
{
N_("Random Hurl"),
N_("Random Pick"),
......@@ -112,7 +112,7 @@ gchar *RNDM_NAME[] =
#define SCALE_WIDTH 100
gint rndm_type = RNDM_HURL; /* hurl, pick, etc. */
static gint rndm_type = RNDM_HURL; /* hurl, pick, etc. */
/*********************************
*
......
......@@ -255,7 +255,7 @@ run (const gchar *name,
values[0].data.d_status = status;
}
guchar mono[6]= { 0, 0, 0, 255, 255, 255 };
static guchar mono[6]= { 0, 0, 0, 255, 255, 255 };
static struct
{
......
......@@ -1515,7 +1515,7 @@ get_image_data (FILE *fd,
gint
static gint
save_image (const gchar *filename,
gint32 image_id)
{
......
......@@ -85,8 +85,7 @@ const GimpPlugInInfo PLUG_IN_INFO =
run, /* run_proc */
};
gint threshold = 50;
gboolean preview_toggle = TRUE;
static gint threshold = 50;
MAIN ()
......
......@@ -389,7 +389,7 @@ select_window_x11 (GdkScreen *screen)
gint x_scr = GDK_SCREEN_XNUMBER (screen);
Window x_root = RootWindow (x_dpy, x_scr);
Window x_win = None;
GC x_gc = None;
GC x_gc = NULL;
Cursor x_cursor = XCreateFontCursor (x_dpy, GDK_CROSSHAIR);
GdkKeymapKey *keys = NULL;
gint status;
......@@ -593,7 +593,7 @@ select_window_x11 (GdkScreen *screen)
XFreeCursor (x_dpy, x_cursor);
if (x_gc != None)
if (x_gc != NULL)
XFreeGC (x_dpy, x_gc);
return x_win;
......
......@@ -621,7 +621,7 @@ sinus_random_update (GObject *unused,
/* The note book */
/*****************************************/
gint
static gint
sinus_dialog (void)
{
GtkWidget *dlg;
......@@ -948,7 +948,7 @@ sinus_dialog (void)
/* Draw preview image. if DoCompute is TRUE then recompute image. */
/******************************************************************/
void
static void
sinus_do_preview (GtkWidget *widget)
{
static GtkWidget *theWidget = NULL;
......
......@@ -286,7 +286,7 @@ struct textures_t
glong n;
};
struct textures_t textures[] =
static struct textures_t textures[] =
{
{ 0, N_("Solid"), SOLID },
{ 1, N_("Checker"), CHECKER },
......@@ -300,13 +300,6 @@ struct textures_t textures[] =
{ 0, NULL, 0 }
};
struct
{
gint solid, phong, light;
}
settings = { 1, 1, 1 };
static inline void vset (GimpVector4 *v,
gdouble a,
gdouble b,
......@@ -494,8 +487,7 @@ turbulence (gdouble * point, gdouble lofreq, gdouble hifreq)
return t - 0.3; /* readjust to make mean value = 0.0 */
}
struct camera_t camera;
struct world_t world;
static struct world_t world;
static inline void
vcopy (GimpVector4 *a, GimpVector4 *b)
......
......@@ -156,7 +156,7 @@ typedef struct
GtkWidget *applybut; /* The apply button */
} Exp_Call;
Exp_Call exp_call =
static Exp_Call exp_call =
{
ALL,
-1,
......@@ -174,7 +174,7 @@ typedef struct
GtkWidget *vtoggle;
} Reset_Call;
Reset_Call res_call =
static Reset_Call res_call =
{
NULL,
NULL,
......
......@@ -34,9 +34,10 @@
#define MAX_PATTERNS 9
#define MAX_PATTERN_SIZE 108
const gint pattern_width[MAX_PATTERNS] = { 2, 4, 1, 1, 2, 3, 6, 6, 5 };
const gint pattern_height[MAX_PATTERNS] = { 6, 12, 3, 6, 12, 3, 6, 18, 15 };
const gchar *pattern_name[MAX_PATTERNS] =
static const gint pattern_width[MAX_PATTERNS] = { 2, 4, 1, 1, 2, 3, 6, 6, 5 };
static const gint pattern_height[MAX_PATTERNS] = { 6, 12, 3, 6, 12, 3, 6,
18, 15 };
static const gchar *pattern_name[MAX_PATTERNS] =
{
N_("_Staggered"),
N_("_Large staggered"),
......@@ -49,7 +50,7 @@ const gchar *pattern_name[MAX_PATTERNS] =
N_("_Dots")
};
const gint pattern[MAX_PATTERNS][MAX_PATTERN_SIZE] =
static const gint pattern[MAX_PATTERNS][MAX_PATTERN_SIZE] =
{
{
0, 1,
......@@ -157,7 +158,7 @@ const gint pattern[MAX_PATTERNS][MAX_PATTERN_SIZE] =
#define PREVIEW_HEIGHT 100
/* The raw preview image */
const guchar preview_raw[3 * PREVIEW_WIDTH * PREVIEW_HEIGHT] =
static const guchar preview_raw[3 * PREVIEW_WIDTH * PREVIEW_HEIGHT] =
{
223,233,242,223,233,242,219,229,238,220,230,239,224,234,243,225,235,244,225,
235,244,226,236,245,226,232,243,228,234,245,227,233,244,226,231,242,230,236,
......
......@@ -145,7 +145,7 @@ struct config_tag
};
typedef struct config_tag config_t;
config_t config =
static config_t config =
{
10, /* threshold for derivative edge detection */
LEFT, /* bleed to the right */
......
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