[gimp/muks/openjpeg] plug-ins: fix minor syntax bugs.



commit 71d9550f507d72233413040f0bd3febaf7e8c945
Author: Jehan <jehan girinstud io>
Date:   Sun Mar 4 16:16:23 2018 +0100

    plug-ins: fix minor syntax bugs.
    
    - Add a space before "if|for" and parenthese.
    - Remove some spaces after parentheses.
    - Get rid of 2 trailing whitespaces.
    - Align function call parameters, declarations, assignments…

 plug-ins/common/file-jp2-load.c |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/plug-ins/common/file-jp2-load.c b/plug-ins/common/file-jp2-load.c
index a6a3b1a..05cc38d 100644
--- a/plug-ins/common/file-jp2-load.c
+++ b/plug-ins/common/file-jp2-load.c
@@ -913,24 +913,25 @@ load_image (const gchar  *filename,
         }
     }
 
-  if(image->color_space == OPJ_CLRSPC_GRAY)
+  if (image->color_space == OPJ_CLRSPC_GRAY)
     {
-      base_type = GIMP_GRAY;
+      base_type  = GIMP_GRAY;
       image_type = GIMP_GRAY_IMAGE;
     }
   else
     {
-      base_type = GIMP_RGB;
+      base_type  = GIMP_RGB;
       image_type = GIMP_RGB_IMAGE;
+
     }
 
   num_components = image->numcomps;
 
-  if(num_components == 2)
+  if (num_components == 2)
     {
       image_type = GIMP_GRAYA_IMAGE;
     }
-  else if(num_components == 4)
+  else if (num_components == 4)
     {
       image_type = GIMP_RGBA_IMAGE;
     }
@@ -963,35 +964,34 @@ load_image (const gchar  *filename,
 
   for (i = 0; i < height; i++)
     {
-      for( j = 0; j < num_components; j++)
+      for (j = 0; j < num_components; j++)
         {
-          const int channel_prec = 8;
-
+          const int  channel_prec   = 8;
           OPJ_UINT32 component_prec = image->comps[j].prec;
 
-          if(component_prec >= channel_prec)
+          if (component_prec >= channel_prec)
             {
               int shift = component_prec - channel_prec;
 
-              for( k = 0; k < width; k++)
+              for (k = 0; k < width; k++)
                 {
-                  pixels[k * num_components + j] = image->comps[j].data[i * width + k] >> shift; 
+                  pixels[k * num_components + j] = image->comps[j].data[i * width + k] >> shift;
                 }
             }
           else
             {
               int mult = 1 << (channel_prec - component_prec);
 
-              for( k = 0; k < width; k++)
+              for (k = 0; k < width; k++)
                 {
-                  pixels[k* num_components + j] = image->comps[j].data[i * width + k ] * mult; 
+                  pixels[k * num_components + j] = image->comps[j].data[i * width + k ] * mult;
                 }
 
             }
         }
 
         gegl_buffer_set (buffer, GEGL_RECTANGLE (0, i, width, 1), 0,
-                       NULL, pixels, GEGL_AUTO_ROWSTRIDE);
+                         NULL, pixels, GEGL_AUTO_ROWSTRIDE);
     }
 
 #if 0


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