[gimp] plug-ins: some general cleanup in file-psd (no code changes)



commit eafe1b9be3bccd03fef0c47a11161af23ada440c
Author: Michael Natterer <mitch gimp org>
Date:   Sun Feb 9 19:38:19 2014 +0100

    plug-ins: some general cleanup in file-psd (no code changes)

 plug-ins/file-psd/psd-image-res-load.c |   92 +++++++++---------
 plug-ins/file-psd/psd-image-res-load.h |   21 ++--
 plug-ins/file-psd/psd-load.c           |  160 ++++++++++++++++----------------
 plug-ins/file-psd/psd-save.c           |    2 +-
 plug-ins/file-psd/psd-thumb-load.c     |   10 +-
 plug-ins/file-psd/psd-util.c           |  118 ++++++++++++------------
 plug-ins/file-psd/psd-util.h           |   16 ++--
 7 files changed, 211 insertions(+), 208 deletions(-)
---
diff --git a/plug-ins/file-psd/psd-image-res-load.c b/plug-ins/file-psd/psd-image-res-load.c
index 074eb64..be14456 100644
--- a/plug-ins/file-psd/psd-image-res-load.c
+++ b/plug-ins/file-psd/psd-image-res-load.c
@@ -137,99 +137,99 @@
 
 /*  Local function prototypes  */
 static gint     load_resource_unknown  (const PSDimageres     *res_a,
-                                        const gint32           image_id,
+                                        gint32                 image_id,
                                         FILE                  *f,
                                         GError               **error);
 
 static gint     load_resource_ps_only  (const PSDimageres     *res_a,
-                                        const gint32           image_id,
+                                        gint32                 image_id,
                                         FILE                  *f,
                                         GError               **error);
 
 static gint     load_resource_1005     (const PSDimageres     *res_a,
-                                        const gint32           image_id,
+                                        gint32                 image_id,
                                         FILE                  *f,
                                         GError               **error);
 
 static gint     load_resource_1006     (const PSDimageres     *res_a,
-                                        const gint32           image_id,
+                                        gint32                 image_id,
                                         PSDimage              *img_a,
                                         FILE                  *f,
                                         GError               **error);
 
 static gint     load_resource_1007     (const PSDimageres     *res_a,
-                                        const gint32           image_id,
+                                        gint32                 image_id,
                                         PSDimage              *img_a,
                                         FILE                  *f,
                                         GError               **error);
 
 static gint     load_resource_1008     (const PSDimageres     *res_a,
-                                        const gint32           image_id,
+                                        gint32                 image_id,
                                         FILE                  *f,
                                         GError               **error);
 
 static gint     load_resource_1022     (const PSDimageres     *res_a,
-                                        const gint32           image_id,
+                                        gint32                 image_id,
                                         PSDimage              *img_a,
                                         FILE                  *f,
                                         GError               **error);
 
 static gint     load_resource_1024     (const PSDimageres     *res_a,
-                                        const gint32           image_id,
+                                        gint32                 image_id,
                                         PSDimage              *img_a,
                                         FILE                  *f,
                                         GError               **error);
 
 static gint     load_resource_1028     (const PSDimageres     *res_a,
-                                        const gint32           image_id,
+                                        gint32                 image_id,
                                         FILE                  *f,
                                         GError               **error);
 
 static gint     load_resource_1032     (const PSDimageres     *res_a,
-                                        const gint32           image_id,
+                                        gint32                 image_id,
                                         FILE                  *f,
                                         GError               **error);
 
 static gint     load_resource_1033     (const PSDimageres     *res_a,
-                                        const gint32           image_id,
+                                        gint32                 image_id,
                                         FILE                  *f,
                                         GError               **error);
 
 static gint     load_resource_1039     (const PSDimageres     *res_a,
-                                        const gint32           image_id,
+                                        gint32                 image_id,
                                         FILE                  *f,
                                         GError               **error);
 
 static gint     load_resource_1045     (const PSDimageres     *res_a,
-                                        const gint32           image_id,
+                                        gint32                 image_id,
                                         PSDimage              *img_a,
                                         FILE                  *f,
                                         GError               **error);
 
 static gint     load_resource_1046     (const PSDimageres     *res_a,
-                                        const gint32           image_id,
+                                        gint32                 image_id,
                                         FILE                  *f,
                                         GError               **error);
 
 static gint     load_resource_1053     (const PSDimageres     *res_a,
-                                        const gint32           image_id,
+                                        gint32                 image_id,
                                         PSDimage              *img_a,
                                         FILE                  *f,
                                         GError               **error);
 
 static gint     load_resource_1058     (const PSDimageres     *res_a,
-                                        const gint32           image_id,
+                                        gint32                 image_id,
                                         FILE                  *f,
                                         GError               **error);
 
 static gint     load_resource_1077     (const PSDimageres     *res_a,
-                                        const gint32           image_id,
+                                        gint32                 image_id,
                                         PSDimage              *img_a,
                                         FILE                  *f,
                                         GError               **error);
 
 static gint     load_resource_2000     (const PSDimageres     *res_a,
-                                        const gint32           image_id,
+                                        gint32                 image_id,
                                         FILE                  *f,
                                         GError               **error);
 
@@ -273,12 +273,12 @@ get_image_resource_header (PSDimageres  *res_a,
 }
 
 gint
-load_image_resource (PSDimageres   *res_a,
-                     const gint32   image_id,
-                     PSDimage      *img_a,
-                     FILE          *f,
-                     gboolean      *resolution_loaded,
-                     GError       **error)
+load_image_resource (PSDimageres  *res_a,
+                     gint32        image_id,
+                     PSDimage     *img_a,
+                     FILE         *f,
+                     gboolean     *resolution_loaded,
+                     GError      **error)
 {
   gint  pad;
 
@@ -414,10 +414,10 @@ load_image_resource (PSDimageres   *res_a,
 }
 
 gint
-load_thumbnail_resource (PSDimageres   *res_a,
-                         const gint32   image_id,
-                         FILE          *f,
-                         GError       **error)
+load_thumbnail_resource (PSDimageres  *res_a,
+                         gint32        image_id,
+                         FILE         *f,
+                         GError      **error)
 {
   gint  rtn = 0;
   gint  pad;
@@ -458,7 +458,7 @@ load_thumbnail_resource (PSDimageres   *res_a,
 
 static gint
 load_resource_unknown (const PSDimageres  *res_a,
-                       const gint32        image_id,
+                       gint32              image_id,
                        FILE               *f,
                        GError            **error)
 {
@@ -492,7 +492,7 @@ load_resource_unknown (const PSDimageres  *res_a,
 
 static gint
 load_resource_ps_only (const PSDimageres  *res_a,
-                       const gint32        image_id,
+                       gint32              image_id,
                        FILE               *f,
                        GError            **error)
 {
@@ -527,7 +527,7 @@ load_resource_ps_only (const PSDimageres  *res_a,
 
 static gint
 load_resource_1005 (const PSDimageres  *res_a,
-                    const gint32        image_id,
+                    gint32              image_id,
                     FILE               *f,
                     GError            **error)
 {
@@ -591,7 +591,7 @@ load_resource_1005 (const PSDimageres  *res_a,
 
 static gint
 load_resource_1006 (const PSDimageres  *res_a,
-                    const gint32        image_id,
+                    gint32              image_id,
                     PSDimage           *img_a,
                     FILE               *f,
                     GError            **error)
@@ -633,7 +633,7 @@ load_resource_1006 (const PSDimageres  *res_a,
 
 static gint
 load_resource_1007 (const PSDimageres  *res_a,
-                    const gint32        image_id,
+                    gint32              image_id,
                     PSDimage           *img_a,
                     FILE               *f,
                     GError            **error)
@@ -741,7 +741,7 @@ load_resource_1007 (const PSDimageres  *res_a,
 
 static gint
 load_resource_1008 (const PSDimageres  *res_a,
-                    const gint32        image_id,
+                    gint32              image_id,
                     FILE               *f,
                     GError            **error)
 {
@@ -768,7 +768,7 @@ load_resource_1008 (const PSDimageres  *res_a,
 
 static gint
 load_resource_1022 (const PSDimageres  *res_a,
-                    const gint32        image_id,
+                    gint32              image_id,
                     PSDimage           *img_a,
                     FILE               *f,
                     GError            **error)
@@ -795,7 +795,7 @@ load_resource_1022 (const PSDimageres  *res_a,
 
 static gint
 load_resource_1024 (const PSDimageres  *res_a,
-                    const gint32        image_id,
+                    gint32              image_id,
                     PSDimage           *img_a,
                     FILE               *f,
                     GError            **error)
@@ -815,7 +815,7 @@ load_resource_1024 (const PSDimageres  *res_a,
 
 static gint
 load_resource_1028 (const PSDimageres  *res_a,
-                    const gint32        image_id,
+                    gint32              image_id,
                     FILE               *f,
                     GError            **error)
 {
@@ -883,7 +883,7 @@ load_resource_1028 (const PSDimageres  *res_a,
 
 static gint
 load_resource_1032 (const PSDimageres  *res_a,
-                    const gint32        image_id,
+                    gint32              image_id,
                     FILE               *f,
                     GError            **error)
 {
@@ -942,7 +942,7 @@ load_resource_1032 (const PSDimageres  *res_a,
 
 static gint
 load_resource_1033 (const PSDimageres  *res_a,
-                    const gint32        image_id,
+                    gint32              image_id,
                     FILE               *f,
                     GError            **error)
 {
@@ -1091,7 +1091,7 @@ load_resource_1033 (const PSDimageres  *res_a,
 
 static gint
 load_resource_1039 (const PSDimageres  *res_a,
-                    const gint32        image_id,
+                    gint32              image_id,
                     FILE               *f,
                     GError            **error)
 {
@@ -1121,7 +1121,7 @@ load_resource_1039 (const PSDimageres  *res_a,
 
 static gint
 load_resource_1045 (const PSDimageres  *res_a,
-                    const gint32        image_id,
+                    gint32              image_id,
                     PSDimage           *img_a,
                     FILE               *f,
                     GError            **error)
@@ -1170,7 +1170,7 @@ load_resource_1045 (const PSDimageres  *res_a,
 
 static gint
 load_resource_1046 (const PSDimageres  *res_a,
-                    const gint32        image_id,
+                    gint32              image_id,
                     FILE               *f,
                     GError            **error)
 {
@@ -1202,7 +1202,7 @@ load_resource_1046 (const PSDimageres  *res_a,
 
 static gint
 load_resource_1053 (const PSDimageres  *res_a,
-                    const gint32        image_id,
+                    gint32              image_id,
                     PSDimage           *img_a,
                     FILE               *f,
                     GError            **error)
@@ -1236,7 +1236,7 @@ load_resource_1053 (const PSDimageres  *res_a,
 
 static gint
 load_resource_1058 (const PSDimageres  *res_a,
-                    const gint32        image_id,
+                    gint32              image_id,
                     FILE               *f,
                     GError            **error)
 {
@@ -1272,7 +1272,7 @@ load_resource_1058 (const PSDimageres  *res_a,
 
 static gint
 load_resource_1077 (const PSDimageres  *res_a,
-                    const gint32        image_id,
+                    gint32              image_id,
                     PSDimage           *img_a,
                     FILE               *f,
                     GError            **error)
@@ -1384,7 +1384,7 @@ load_resource_1077 (const PSDimageres  *res_a,
 
 static gint
 load_resource_2000 (const PSDimageres  *res_a,
-                    const gint32        image_id,
+                    gint32              image_id,
                     FILE               *f,
                     GError            **error)
 {
diff --git a/plug-ins/file-psd/psd-image-res-load.h b/plug-ins/file-psd/psd-image-res-load.h
index bce8604..de72961 100644
--- a/plug-ins/file-psd/psd-image-res-load.h
+++ b/plug-ins/file-psd/psd-image-res-load.h
@@ -26,16 +26,17 @@ gint  get_image_resource_header (PSDimageres  *res_a,
                                  FILE         *f,
                                  GError      **error);
 
-gint  load_image_resource       (PSDimageres   *res_a,
-                                 const gint32   image_id,
-                                 PSDimage      *img_a,
-                                 FILE          *f,
-                                 gboolean      *resolution_loaded,
-                                 GError       **error);
+gint  load_image_resource       (PSDimageres  *res_a,
+                                 gint32        image_id,
+                                 PSDimage     *img_a,
+                                 FILE         *f,
+                                 gboolean     *resolution_loaded,
+                                 GError      **error);
+
+gint  load_thumbnail_resource   (PSDimageres  *res_a,
+                                 gint32        image_id,
+                                 FILE         *f,
+                                 GError      **error);
 
-gint  load_thumbnail_resource   (PSDimageres   *res_a,
-                                 const gint32   image_id,
-                                 FILE          *f,
-                                 GError       **error);
 
 #endif /* __PSD_IMAGE_RES_LOAD_H__ */
diff --git a/plug-ins/file-psd/psd-load.c b/plug-ins/file-psd/psd-load.c
index 8c19c3d..b4af437 100644
--- a/plug-ins/file-psd/psd-load.c
+++ b/plug-ins/file-psd/psd-load.c
@@ -62,22 +62,22 @@ static gint             read_merged_image_block    (PSDimage     *img_a,
 static gint32           create_gimp_image          (PSDimage     *img_a,
                                                     const gchar  *filename);
 
-static gint             add_color_map              (const gint32  image_id,
+static gint             add_color_map              (gint32        image_id,
                                                     PSDimage     *img_a);
 
-static gint             add_image_resources        (const gint32  image_id,
+static gint             add_image_resources        (gint32        image_id,
                                                     PSDimage     *img_a,
                                                     FILE         *f,
                                                     gboolean     *resolution_loaded,
                                                     GError      **error);
 
-static gint             add_layers                 (const gint32  image_id,
+static gint             add_layers                 (gint32        image_id,
                                                     PSDimage     *img_a,
                                                     PSDlayer    **lyr_a,
                                                     FILE         *f,
                                                     GError      **error);
 
-static gint             add_merged_image           (const gint32  image_id,
+static gint             add_merged_image           (gint32        image_id,
                                                     PSDimage     *img_a,
                                                     FILE         *f,
                                                     GError      **error);
@@ -87,12 +87,12 @@ static gchar          * get_psd_color_mode_name    (PSDColorMode  mode);
 
 static void             psd_to_gimp_color_map      (guchar       *map256);
 
-static GimpImageType    get_gimp_image_type        (const GimpImageBaseType image_base_type,
-                                                    const gboolean          alpha);
+static GimpImageType    get_gimp_image_type        (GimpImageBaseType image_base_type,
+                                                    gboolean          alpha);
 
 static gint             read_channel_data          (PSDchannel     *channel,
-                                                    const guint16   bps,
-                                                    const guint16   compression,
+                                                    guint16         bps,
+                                                    guint16         compression,
                                                     const guint16  *rle_pack_len,
                                                     FILE           *f,
                                                     GError        **error);
@@ -111,12 +111,12 @@ load_image (const gchar  *filename,
             gboolean     *resolution_loaded,
             GError      **load_error)
 {
-  FILE                 *f;
-  struct stat           st;
-  PSDimage              img_a;
-  PSDlayer            **lyr_a;
-  gint32                image_id = -1;
-  GError               *error = NULL;
+  FILE         *f;
+  struct stat   st;
+  PSDimage      img_a;
+  PSDlayer    **lyr_a;
+  gint32        image_id = -1;
+  GError       *error    = NULL;
 
   /* ----- Open PSD file ----- */
   if (g_stat (filename, &st) == -1)
@@ -358,7 +358,7 @@ read_color_mode_block (PSDimage  *img_a,
                        FILE      *f,
                        GError   **error)
 {
-  static guchar cmap[] = {0, 0, 0, 255, 255, 255};
+  static guchar cmap[] = { 0, 0, 0, 255, 255, 255 };
   guint32       block_len;
 
   img_a->color_map_entries = 0;
@@ -916,47 +916,47 @@ create_gimp_image (PSDimage    *img_a,
 
   switch (img_a->color_mode)
     {
-      case PSD_GRAYSCALE:
-      case PSD_DUOTONE:
-        img_a->base_type = GIMP_GRAY;
-        break;
+    case PSD_GRAYSCALE:
+    case PSD_DUOTONE:
+      img_a->base_type = GIMP_GRAY;
+      break;
 
-      case PSD_BITMAP:
-      case PSD_INDEXED:
-        img_a->base_type = GIMP_INDEXED;
-        break;
+    case PSD_BITMAP:
+    case PSD_INDEXED:
+      img_a->base_type = GIMP_INDEXED;
+      break;
 
-      case PSD_RGB:
-        img_a->base_type = GIMP_RGB;
-        break;
+    case PSD_RGB:
+      img_a->base_type = GIMP_RGB;
+      break;
 
-      default:
-        /* Color mode already validated - should not be here */
-        g_warning ("Invalid color mode");
-        return -1;
-        break;
+    default:
+      /* Color mode already validated - should not be here */
+      g_warning ("Invalid color mode");
+      return -1;
+      break;
     }
 
     switch (img_a->bps)
       {
-        case 32:
-          precision = GIMP_PRECISION_U32_LINEAR;
-         break;
+      case 32:
+        precision = GIMP_PRECISION_U32_LINEAR;
+        break;
 
-        case 16:
-          precision = GIMP_PRECISION_U16_LINEAR;
-         break;
+      case 16:
+        precision = GIMP_PRECISION_U16_LINEAR;
+        break;
 
-        case 8:
-        case 1:
-          precision = GIMP_PRECISION_U8_LINEAR;
-         break;
+      case 8:
+      case 1:
+        precision = GIMP_PRECISION_U8_LINEAR;
+        break;
 
-        default:
-         /* Precision not supported */
-         g_warning ("Invalid precision");
-         return -1;
-         break;
+      default:
+        /* Precision not supported */
+        g_warning ("Invalid precision");
+        return -1;
+        break;
       }
 
   /* Create gimp image */
@@ -970,8 +970,8 @@ create_gimp_image (PSDimage    *img_a,
 }
 
 static gint
-add_color_map (const gint32  image_id,
-               PSDimage     *img_a)
+add_color_map (gint32    image_id,
+               PSDimage *img_a)
 {
   GimpParasite *parasite;
 
@@ -998,11 +998,11 @@ add_color_map (const gint32  image_id,
 }
 
 static gint
-add_image_resources (const gint32  image_id,
-                     PSDimage     *img_a,
-                     FILE         *f,
-                     gboolean     *resolution_loaded,
-                     GError      **error)
+add_image_resources (gint32     image_id,
+                     PSDimage  *img_a,
+                     FILE      *f,
+                     gboolean  *resolution_loaded,
+                     GError   **error)
 {
   PSDimageres  res_a;
 
@@ -1043,11 +1043,11 @@ add_image_resources (const gint32  image_id,
 }
 
 static gint
-add_layers (const gint32  image_id,
-            PSDimage     *img_a,
-            PSDlayer    **lyr_a,
-            FILE         *f,
-            GError      **error)
+add_layers (gint32     image_id,
+            PSDimage  *img_a,
+            PSDlayer **lyr_a,
+            FILE      *f,
+            GError   **error)
 {
   PSDchannel          **lyr_chn;
   GArray               *parent_group_stack;
@@ -1100,7 +1100,7 @@ add_layers (const gint32  image_id,
     }
 
   /* set the root of the group hierarchy */
-  parent_group_stack = g_array_new (FALSE, FALSE, sizeof(gint32));
+  parent_group_stack = g_array_new (FALSE, FALSE, sizeof (gint32));
   g_array_append_val (parent_group_stack, parent_group_id);
 
   for (lidx = 0; lidx < img_a->num_layers; ++lidx)
@@ -1512,10 +1512,10 @@ add_layers (const gint32  image_id,
 }
 
 static gint
-add_merged_image (const gint32  image_id,
-                  PSDimage     *img_a,
-                  FILE         *f,
-                  GError      **error)
+add_merged_image (gint32     image_id,
+                  PSDimage  *img_a,
+                  FILE      *f,
+                  GError   **error)
 {
   PSDchannel            chn_a[MAX_CHANNELS];
   gchar                *alpha_name;
@@ -1849,28 +1849,28 @@ psd_to_gimp_color_map (guchar *map256)
 }
 
 static GimpImageType
-get_gimp_image_type (const GimpImageBaseType image_base_type,
-                     const gboolean          alpha)
+get_gimp_image_type (GimpImageBaseType image_base_type,
+                     gboolean          alpha)
 {
   GimpImageType image_type;
 
   switch (image_base_type)
     {
-      case GIMP_GRAY:
-        image_type = (alpha) ? GIMP_GRAYA_IMAGE : GIMP_GRAY_IMAGE;
-        break;
+    case GIMP_GRAY:
+      image_type = (alpha) ? GIMP_GRAYA_IMAGE : GIMP_GRAY_IMAGE;
+      break;
 
-      case GIMP_INDEXED:
-        image_type = (alpha) ? GIMP_INDEXEDA_IMAGE : GIMP_INDEXED_IMAGE;
-        break;
+    case GIMP_INDEXED:
+      image_type = (alpha) ? GIMP_INDEXEDA_IMAGE : GIMP_INDEXED_IMAGE;
+      break;
 
-      case GIMP_RGB:
-        image_type = (alpha) ? GIMP_RGBA_IMAGE : GIMP_RGB_IMAGE;
-        break;
+    case GIMP_RGB:
+      image_type = (alpha) ? GIMP_RGBA_IMAGE : GIMP_RGB_IMAGE;
+      break;
 
-      default:
-        image_type = -1;
-        break;
+    default:
+      image_type = -1;
+      break;
     }
 
   return image_type;
@@ -1878,8 +1878,8 @@ get_gimp_image_type (const GimpImageBaseType image_base_type,
 
 static gint
 read_channel_data (PSDchannel     *channel,
-                   const guint16   bps,
-                   const guint16   compression,
+                   guint16         bps,
+                   guint16         compression,
                    const guint16  *rle_pack_len,
                    FILE           *f,
                    GError        **error)
diff --git a/plug-ins/file-psd/psd-save.c b/plug-ins/file-psd/psd-save.c
index 1d78b96..f85da0f 100644
--- a/plug-ins/file-psd/psd-save.c
+++ b/plug-ins/file-psd/psd-save.c
@@ -1689,7 +1689,7 @@ save_image (const gchar  *filename,
   return TRUE;
 }
 
-static const Babl*
+static const Babl *
 get_pixel_format (gint32 drawableID)
 {
   const Babl *format;
diff --git a/plug-ins/file-psd/psd-thumb-load.c b/plug-ins/file-psd/psd-thumb-load.c
index c75a8d8..14cde5d 100644
--- a/plug-ins/file-psd/psd-thumb-load.c
+++ b/plug-ins/file-psd/psd-thumb-load.c
@@ -49,7 +49,7 @@ static gint    read_image_resource_block  (PSDimage     *img_a,
 static gint32  create_gimp_image          (PSDimage     *img_a,
                                            const gchar  *filename);
 
-static gint    add_image_resources        (const gint32  image_id,
+static gint    add_image_resources        (gint32        image_id,
                                            PSDimage     *img_a,
                                            FILE         *f,
                                            GError      **error);
@@ -273,10 +273,10 @@ create_gimp_image (PSDimage    *img_a,
 }
 
 static gint
-add_image_resources (const gint32   image_id,
-                     PSDimage      *img_a,
-                     FILE          *f,
-                     GError       **error)
+add_image_resources (gint32     image_id,
+                     PSDimage  *img_a,
+                     FILE      *f,
+                     GError   **error)
 {
   PSDimageres   res_a;
   gint          status;
diff --git a/plug-ins/file-psd/psd-util.c b/plug-ins/file-psd/psd-util.c
index 661d17e..f5cca19 100644
--- a/plug-ins/file-psd/psd-util.c
+++ b/plug-ins/file-psd/psd-util.c
@@ -35,14 +35,14 @@
 #define MIN_RUN     3
 
 /*  Local function prototypes  */
-static gchar *          gimp_layer_mode_effects_name    (const GimpLayerModeEffects      mode);
+static gchar * gimp_layer_mode_effects_name (GimpLayerModeEffects mode);
 
 
 /* Utility function */
 void
-psd_set_error (const gboolean   file_eof,
-               const gint       err_no,
-               GError         **error)
+psd_set_error (gboolean   file_eof,
+               gint       err_no,
+               GError   **error)
 {
   if (file_eof)
     {
@@ -59,11 +59,11 @@ psd_set_error (const gboolean   file_eof,
 }
 
 gchar *
-fread_pascal_string (gint32         *bytes_read,
-                     gint32         *bytes_written,
-                     const guint16   mod_len,
-                     FILE           *f,
-                     GError        **error)
+fread_pascal_string (gint32   *bytes_read,
+                     gint32   *bytes_written,
+                     guint16   mod_len,
+                     FILE     *f,
+                     GError  **error)
 {
   /*
    * Reads a pascal string from the file padded to a multiple of mod_len
@@ -134,22 +134,22 @@ fread_pascal_string (gint32         *bytes_read,
 }
 
 gint32
-fwrite_pascal_string (const gchar    *src,
-                      const guint16   mod_len,
-                      FILE           *f,
-                      GError        **error)
+fwrite_pascal_string (const gchar  *src,
+                      guint16       mod_len,
+                      FILE         *f,
+                      GError      **error)
 {
   /*
    *  Converts utf-8 string to current locale and writes as pascal
    *  string with padding to a multiple of mod_len.
    */
 
-  gchar        *str;
-  gchar        *pascal_str;
-  gchar         null_str = 0x0;
-  guchar        pascal_len;
-  gint32        bytes_written = 0;
-  gsize         len;
+  gchar  *str;
+  gchar  *pascal_str;
+  gchar   null_str = 0x0;
+  guchar  pascal_len;
+  gint32  bytes_written = 0;
+  gsize   len;
 
   if (src == NULL)
     {
@@ -203,23 +203,23 @@ fwrite_pascal_string (const gchar    *src,
 }
 
 gchar *
-fread_unicode_string (gint32         *bytes_read,
-                      gint32         *bytes_written,
-                      const guint16   mod_len,
-                      FILE           *f,
-                      GError        **error)
+fread_unicode_string (gint32   *bytes_read,
+                      gint32   *bytes_written,
+                      guint16   mod_len,
+                      FILE     *f,
+                      GError  **error)
 {
   /*
    * Reads a utf-16 string from the file padded to a multiple of mod_len
    * and returns a utf-8 string.
    */
 
-  gchar        *utf8_str;
-  gunichar2    *utf16_str;
-  gint32        len;
-  gint32        i;
-  gint32        padded_len;
-  glong         utf8_str_len;
+  gchar     *utf8_str;
+  gunichar2 *utf16_str;
+  gint32     len;
+  gint32     i;
+  gint32     padded_len;
+  glong      utf8_str_len;
 
   *bytes_read = 0;
   *bytes_written = -1;
@@ -285,22 +285,22 @@ fread_unicode_string (gint32         *bytes_read,
 }
 
 gint32
-fwrite_unicode_string (const gchar    *src,
-                       const guint16   mod_len,
-                       FILE           *f,
-                       GError        **error)
+fwrite_unicode_string (const gchar  *src,
+                       guint16       mod_len,
+                       FILE         *f,
+                       GError      **error)
 {
   /*
    *  Converts utf-8 string to utf-16 and writes 4 byte length
    *  then string padding to multiple of mod_len.
    */
 
-  gunichar2    *utf16_str;
-  gchar         null_str = 0x0;
-  gint32        utf16_len = 0;
-  gint32        bytes_written = 0;
-  gint          i;
-  glong         len;
+  gunichar2 *utf16_str;
+  gchar      null_str = 0x0;
+  gint32     utf16_len = 0;
+  gint32     bytes_written = 0;
+  gint       i;
+  glong      len;
 
   if (src == NULL)
     {
@@ -355,15 +355,16 @@ decode_packbits (const gchar *src,
                  guint16      packed_len,
                  guint32      unpacked_len)
 {
-/*
- *  Decode a PackBits chunk.
- */
-  gint      n;
-  gchar     dat;
-  gint32    unpack_left = unpacked_len;
-  gint32    pack_left = packed_len;
-  gint32    error_code = 0;
-  gint32    return_val = 0;
+  /*
+   *  Decode a PackBits chunk.
+   */
+
+  gint    n;
+  gchar   dat;
+  gint32  unpack_left = unpacked_len;
+  gint32  pack_left = packed_len;
+  gint32  error_code = 0;
+  gint32  return_val = 0;
 
   while (unpack_left > 0 && pack_left > 0)
     {
@@ -464,13 +465,14 @@ decode_packbits (const gchar *src,
 }
 
 gchar *
-encode_packbits (const gchar   *src,
-                 const guint32  unpacked_len,
-                 guint16       *packed_len)
+encode_packbits (const gchar *src,
+                 guint32      unpacked_len,
+                 guint16     *packed_len)
 {
-/*
- *  Encode a PackBits chunk.
- */
+  /*
+   *  Encode a PackBits chunk.
+   */
+
   GString *dst_str;                      /* destination string */
   gint     curr_char;                    /* current character */
   gchar    char_buff[128];               /* buffer of already read characters */
@@ -750,9 +752,9 @@ psd_to_gimp_blend_mode (const gchar *psd_mode)
 }
 
 gchar *
-gimp_to_psd_blend_mode (const GimpLayerModeEffects gimp_layer_mode)
+gimp_to_psd_blend_mode (GimpLayerModeEffects gimp_layer_mode)
 {
-  gchar        *psd_mode;
+  gchar *psd_mode;
 
   switch (gimp_layer_mode)
     {
@@ -870,7 +872,7 @@ gimp_to_psd_blend_mode (const GimpLayerModeEffects gimp_layer_mode)
 }
 
 static gchar *
-gimp_layer_mode_effects_name (const GimpLayerModeEffects mode)
+gimp_layer_mode_effects_name (GimpLayerModeEffects mode)
 {
   static gchar *layer_mode_effects_names[] =
   {
diff --git a/plug-ins/file-psd/psd-util.h b/plug-ins/file-psd/psd-util.h
index 2883e7a..3fe2b2d 100644
--- a/plug-ins/file-psd/psd-util.h
+++ b/plug-ins/file-psd/psd-util.h
@@ -24,8 +24,8 @@
 /*
  *  Set file read error
  */
-void                    psd_set_error          (const gboolean  file_eof,
-                                                const gint      err_no,
+void                    psd_set_error          (gboolean        file_eof,
+                                                gint            err_no,
                                                 GError        **error);
 
 /*
@@ -34,7 +34,7 @@ void                    psd_set_error          (const gboolean  file_eof,
  */
 gchar                 * fread_pascal_string    (gint32         *bytes_read,
                                                 gint32         *bytes_written,
-                                                const guint16   mod_len,
+                                                guint16         mod_len,
                                                 FILE           *f,
                                                 GError        **error);
 
@@ -43,7 +43,7 @@ gchar                 * fread_pascal_string    (gint32         *bytes_read,
  *  string with padding to a multiple of mod_len.
  */
 gint32                  fwrite_pascal_string   (const gchar    *src,
-                                                const guint16   mod_len,
+                                                guint16         mod_len,
                                                 FILE           *f,
                                                 GError        **error);
 
@@ -53,7 +53,7 @@ gint32                  fwrite_pascal_string   (const gchar    *src,
  */
 gchar                 * fread_unicode_string   (gint32         *bytes_read,
                                                 gint32         *bytes_written,
-                                                const guint16   mod_len,
+                                                guint16         mod_len,
                                                 FILE           *f,
                                                 GError        **error);
 
@@ -62,7 +62,7 @@ gchar                 * fread_unicode_string   (gint32         *bytes_read,
  *  then string padding to multiple of mod_len.
  */
 gint32                  fwrite_unicode_string  (const gchar    *src,
-                                                const guint16   mod_len,
+                                                guint16         mod_len,
                                                 FILE           *f,
                                                 GError        **error);
 
@@ -72,11 +72,11 @@ gint                    decode_packbits        (const gchar    *src,
                                                 guint32         unpacked_len);
 
 gchar                 * encode_packbits        (const gchar    *src,
-                                                const guint32   unpacked_len,
+                                                guint32         unpacked_len,
                                                 guint16        *packed_len);
 
 GimpLayerModeEffects    psd_to_gimp_blend_mode (const gchar    *psd_mode);
 
-gchar *                 gimp_to_psd_blend_mode (const GimpLayerModeEffects gimp_layer_mode);
+gchar *                 gimp_to_psd_blend_mode (GimpLayerModeEffects gimp_layer_mode);
 
 #endif /* __PSD_UTIL_H__ */


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