gimp r25295 - in trunk: . plug-ins/common



Author: muks
Date: Sat Mar 29 02:30:58 2008
New Revision: 25295
URL: http://svn.gnome.org/viewvc/gimp?rev=25295&view=rev

Log:
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.



Modified:
   trunk/ChangeLog
   trunk/plug-ins/common/cml-explorer.c
   trunk/plug-ins/common/compose.c
   trunk/plug-ins/common/convolution-matrix.c
   trunk/plug-ins/common/csource.c
   trunk/plug-ins/common/curve-bend.c
   trunk/plug-ins/common/despeckle.c
   trunk/plug-ins/common/emboss.c
   trunk/plug-ins/common/engrave.c
   trunk/plug-ins/common/gbr.c
   trunk/plug-ins/common/gif-load.c
   trunk/plug-ins/common/gif-save.c
   trunk/plug-ins/common/glob.c
   trunk/plug-ins/common/grid.c
   trunk/plug-ins/common/hot.c
   trunk/plug-ins/common/jigsaw.c
   trunk/plug-ins/common/mng.c
   trunk/plug-ins/common/noise-randomize.c
   trunk/plug-ins/common/pcx.c
   trunk/plug-ins/common/psd-save.c
   trunk/plug-ins/common/red-eye-removal.c
   trunk/plug-ins/common/screenshot.c
   trunk/plug-ins/common/sinus.c
   trunk/plug-ins/common/sphere-designer.c
   trunk/plug-ins/common/tile-small.c
   trunk/plug-ins/common/video.c
   trunk/plug-ins/common/wind.c

Modified: trunk/plug-ins/common/cml-explorer.c
==============================================================================
--- trunk/plug-ins/common/cml-explorer.c	(original)
+++ trunk/plug-ins/common/cml-explorer.c	Sat Mar 29 02:30:58 2008
@@ -1749,7 +1749,7 @@
   return vbox;
 }
 
-void
+static void
 preview_update (void)
 {
   if (! CML_preview_defer)

Modified: trunk/plug-ins/common/compose.c
==============================================================================
--- trunk/plug-ins/common/compose.c	(original)
+++ trunk/plug-ins/common/compose.c	Sat Mar 29 02:30:58 2008
@@ -156,9 +156,9 @@
 
 
 /* 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

Modified: trunk/plug-ins/common/convolution-matrix.c
==============================================================================
--- trunk/plug-ins/common/convolution-matrix.c	(original)
+++ trunk/plug-ins/common/convolution-matrix.c	Sat Mar 29 02:30:58 2008
@@ -173,7 +173,7 @@
   GtkWidget *bmode[BORDER_MODES];
   GtkWidget *channels[CHANNELS];
   GtkWidget *autoset;
-} widget_set;
+} static widget_set;
 
 
 MAIN ()

Modified: trunk/plug-ins/common/csource.c
==============================================================================
--- trunk/plug-ins/common/csource.c	(original)
+++ trunk/plug-ins/common/csource.c	Sat Mar 29 02:30:58 2008
@@ -72,7 +72,7 @@
   run,   /* run_proc   */
 };
 
-Config config =
+static Config config =
 {
   NULL,         /* file_name */
   "gimp_image", /* prefixed_name */

Modified: trunk/plug-ins/common/curve-bend.c
==============================================================================
--- trunk/plug-ins/common/curve-bend.c	(original)
+++ trunk/plug-ins/common/curve-bend.c	Sat Mar 29 02:30:58 2008
@@ -1049,7 +1049,7 @@
     *val  = val_from + delta;
 }
 
-void
+static void
 p_copy_points (BenderDialog *cd,
                int           outline,
                int           xy,
@@ -1068,7 +1068,7 @@
    }
 }
 
-void
+static void
 p_copy_yval (BenderDialog *cd,
              int           outline,
              int           argc,
@@ -2537,7 +2537,7 @@
   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_create_pv_image
  * ============================================================================
  */
-gint32
+static gint32
 p_create_pv_image (GimpDrawable *src_drawable,
                    gint32    *layer_id)
 {
@@ -2756,7 +2756,7 @@
  * ============================================================================
  */
 
-void
+static void
 p_bender_calculate_iter_curve (BenderDialog *cd,
                                gint32        xmax,
                                gint32        ymax)
@@ -3149,7 +3149,7 @@
  * ============================================================================
  */
 
-gint32
+static gint32
 p_main_bend (BenderDialog *cd,
              GimpDrawable    *original_drawable,
              gint          work_on_copy)

Modified: trunk/plug-ins/common/despeckle.c
==============================================================================
--- trunk/plug-ins/common/despeckle.c	(original)
+++ trunk/plug-ins/common/despeckle.c	Sat Mar 29 02:30:58 2008
@@ -88,11 +88,6 @@
 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 @@
   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 @@
     }
 }
 
-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++;
-    }
-}

Modified: trunk/plug-ins/common/emboss.c
==============================================================================
--- trunk/plug-ins/common/emboss.c	(original)
+++ trunk/plug-ins/common/emboss.c	Sat Mar 29 02:30:58 2008
@@ -69,7 +69,7 @@
   gdouble Nz2;
   gdouble NzLz;
   gdouble bg;
-} Filter;
+} static Filter;
 
 static void     query         (void);
 static void     run           (const gchar      *name,

Modified: trunk/plug-ins/common/engrave.c
==============================================================================
--- trunk/plug-ins/common/engrave.c	(original)
+++ trunk/plug-ins/common/engrave.c	Sat Mar 29 02:30:58 2008
@@ -413,7 +413,7 @@
   guchar *data;
 } PixelArea;
 
-PixelArea area;
+static PixelArea area;
 
 static void
 engrave_small (GimpDrawable *drawable,

Modified: trunk/plug-ins/common/gbr.c
==============================================================================
--- trunk/plug-ins/common/gbr.c	(original)
+++ trunk/plug-ins/common/gbr.c	Sat Mar 29 02:30:58 2008
@@ -109,7 +109,7 @@
 
 /*  private variables  */
 
-BrushInfo info =
+static BrushInfo info =
 {
   "GIMP Brush",
   10

Modified: trunk/plug-ins/common/gif-load.c
==============================================================================
--- trunk/plug-ins/common/gif-load.c	(original)
+++ trunk/plug-ins/common/gif-load.c	Sat Mar 29 02:30:58 2008
@@ -581,7 +581,7 @@
   return FALSE;
 }
 
-int ZeroDataBlock = FALSE;
+static int ZeroDataBlock = FALSE;
 
 static int
 GetDataBlock (FILE          *fd,

Modified: trunk/plug-ins/common/gif-save.c
==============================================================================
--- trunk/plug-ins/common/gif-save.c	(original)
+++ trunk/plug-ins/common/gif-save.c	Sat Mar 29 02:30:58 2008
@@ -105,7 +105,7 @@
 
 static GimpRunMode run_mode;
 #ifdef FACEHUGGERS
-GimpParasite * comment_parasite = NULL;
+static GimpParasite * comment_parasite = NULL;
 #endif
 
 /* For compression code */

Modified: trunk/plug-ins/common/glob.c
==============================================================================
--- trunk/plug-ins/common/glob.c	(original)
+++ trunk/plug-ins/common/glob.c	Sat Mar 29 02:30:58 2008
@@ -443,7 +443,7 @@
   return FALSE;
 }
 
-gboolean
+static gboolean
 glob_fnmatch (const gchar *pattern,
               const gchar *string)
 {

Modified: trunk/plug-ins/common/grid.c
==============================================================================
--- trunk/plug-ins/common/grid.c	(original)
+++ trunk/plug-ins/common/grid.c	Sat Mar 29 02:30:58 2008
@@ -100,7 +100,7 @@
   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     */

Modified: trunk/plug-ins/common/hot.c
==============================================================================
--- trunk/plug-ins/common/hot.c	(original)
+++ trunk/plug-ins/common/hot.c	Sat Mar 29 02:30:58 2008
@@ -111,7 +111,7 @@
   gdouble pedestal;
   gdouble gamma;
   gdouble code[3][3];
-} mode[2] = {
+} static mode[2] = {
   {
     7.5,
     2.2,

Modified: trunk/plug-ins/common/jigsaw.c
==============================================================================
--- trunk/plug-ins/common/jigsaw.c	(original)
+++ trunk/plug-ins/common/jigsaw.c	Sat Mar 29 02:30:58 2008
@@ -333,7 +333,7 @@
 
 typedef struct globals_tag globals_t;
 
-static globals_t globals = { { 0 } };
+static globals_t globals;
 
 MAIN ()
 

Modified: trunk/plug-ins/common/mng.c
==============================================================================
--- trunk/plug-ins/common/mng.c	(original)
+++ trunk/plug-ins/common/mng.c	Sat Mar 29 02:30:58 2008
@@ -140,7 +140,7 @@
 /* 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 @@
       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 @@
                              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;

Modified: trunk/plug-ins/common/noise-randomize.c
==============================================================================
--- trunk/plug-ins/common/noise-randomize.c	(original)
+++ trunk/plug-ins/common/noise-randomize.c	Sat Mar 29 02:30:58 2008
@@ -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 @@
 
 #define SCALE_WIDTH  100
 
-gint rndm_type = RNDM_HURL;  /* hurl, pick, etc. */
+static gint rndm_type = RNDM_HURL;  /* hurl, pick, etc. */
 
 /*********************************
  *

Modified: trunk/plug-ins/common/pcx.c
==============================================================================
--- trunk/plug-ins/common/pcx.c	(original)
+++ trunk/plug-ins/common/pcx.c	Sat Mar 29 02:30:58 2008
@@ -255,7 +255,7 @@
   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
 {

Modified: trunk/plug-ins/common/psd-save.c
==============================================================================
--- trunk/plug-ins/common/psd-save.c	(original)
+++ trunk/plug-ins/common/psd-save.c	Sat Mar 29 02:30:58 2008
@@ -1515,7 +1515,7 @@
 
 
 
-gint
+static gint
 save_image (const gchar *filename,
             gint32       image_id)
 {

Modified: trunk/plug-ins/common/red-eye-removal.c
==============================================================================
--- trunk/plug-ins/common/red-eye-removal.c	(original)
+++ trunk/plug-ins/common/red-eye-removal.c	Sat Mar 29 02:30:58 2008
@@ -85,8 +85,7 @@
   run,   /* run_proc   */
 };
 
-gint threshold = 50;
-gboolean preview_toggle = TRUE;
+static gint threshold = 50;
 
 MAIN ()
 

Modified: trunk/plug-ins/common/screenshot.c
==============================================================================
--- trunk/plug-ins/common/screenshot.c	(original)
+++ trunk/plug-ins/common/screenshot.c	Sat Mar 29 02:30:58 2008
@@ -389,7 +389,7 @@
   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 @@
 
   XFreeCursor (x_dpy, x_cursor);
 
-  if (x_gc != None)
+  if (x_gc != NULL)
     XFreeGC (x_dpy, x_gc);
 
   return x_win;

Modified: trunk/plug-ins/common/sinus.c
==============================================================================
--- trunk/plug-ins/common/sinus.c	(original)
+++ trunk/plug-ins/common/sinus.c	Sat Mar 29 02:30:58 2008
@@ -621,7 +621,7 @@
 /* The note book                         */
 /*****************************************/
 
-gint
+static gint
 sinus_dialog (void)
 {
   GtkWidget *dlg;
@@ -948,7 +948,7 @@
 /* Draw preview image. if DoCompute is TRUE then recompute image. */
 /******************************************************************/
 
-void
+static void
 sinus_do_preview (GtkWidget *widget)
 {
   static GtkWidget *theWidget = NULL;

Modified: trunk/plug-ins/common/sphere-designer.c
==============================================================================
--- trunk/plug-ins/common/sphere-designer.c	(original)
+++ trunk/plug-ins/common/sphere-designer.c	Sat Mar 29 02:30:58 2008
@@ -286,7 +286,7 @@
   glong  n;
 };
 
-struct textures_t textures[] =
+static struct textures_t textures[] =
 {
   { 0, N_("Solid"),   SOLID   },
   { 1, N_("Checker"), CHECKER },
@@ -300,13 +300,6 @@
   { 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 @@
   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)

Modified: trunk/plug-ins/common/tile-small.c
==============================================================================
--- trunk/plug-ins/common/tile-small.c	(original)
+++ trunk/plug-ins/common/tile-small.c	Sat Mar 29 02:30:58 2008
@@ -156,7 +156,7 @@
   GtkWidget *applybut; /* The apply button  */
 } Exp_Call;
 
-Exp_Call exp_call =
+static Exp_Call exp_call =
 {
   ALL,
   -1,
@@ -174,7 +174,7 @@
   GtkWidget *vtoggle;
 } Reset_Call;
 
-Reset_Call res_call =
+static Reset_Call res_call =
 {
   NULL,
   NULL,

Modified: trunk/plug-ins/common/video.c
==============================================================================
--- trunk/plug-ins/common/video.c	(original)
+++ trunk/plug-ins/common/video.c	Sat Mar 29 02:30:58 2008
@@ -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 @@
   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 @@
 #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,

Modified: trunk/plug-ins/common/wind.c
==============================================================================
--- trunk/plug-ins/common/wind.c	(original)
+++ trunk/plug-ins/common/wind.c	Sat Mar 29 02:30:58 2008
@@ -145,7 +145,7 @@
 };
 
 typedef struct config_tag config_t;
-config_t config =
+static config_t config =
 {
   10,          /* threshold for derivative edge detection */
   LEFT,        /* bleed to the right */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]