[gimp] app/display: sprinkle render code with const qualifiers



commit 375567df6fd4b28f55efab67e8fe866413245af1
Author: Sven Neumann <sven gimp org>
Date:   Tue Sep 28 22:46:21 2010 +0200

    app/display: sprinkle render code with const qualifiers

 app/display/gimpdisplayshell-render.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-render.c b/app/display/gimpdisplayshell-render.c
index b710504..354daee 100644
--- a/app/display/gimpdisplayshell-render.c
+++ b/app/display/gimpdisplayshell-render.c
@@ -511,7 +511,7 @@ box_filter_premult (const guint    left_weight,
       case 4:
 #define ALPHA 3
         {
-          guint factors[9] =
+          const guint factors[9] =
             {
               (src[1][ALPHA] * top_weight)    >> 4,
               (src[4][ALPHA] * middle_weight) >> 4,
@@ -524,9 +524,11 @@ box_filter_premult (const guint    left_weight,
               (src[6][ALPHA] * bottom_weight) >> 4
             };
 
-          guint a = (center_weight * (factors[0] + factors[1] + factors[2]) +
-                     right_weight  * (factors[3] + factors[4] + factors[5]) +
-                     left_weight   * (factors[6] + factors[7] + factors[8]));
+          const guint a =
+            (center_weight * (factors[0] + factors[1] + factors[2]) +
+             right_weight  * (factors[3] + factors[4] + factors[5]) +
+             left_weight   * (factors[6] + factors[7] + factors[8]));
+
           guint i;
 
           for (i = 0; i < ALPHA; i++)
@@ -556,7 +558,7 @@ box_filter_premult (const guint    left_weight,
          *       the behavior in all needed ways.
          */
         {
-          guint factors[9] =
+          const guint factors[9] =
             {
               (src[1][ALPHA] * top_weight)    >> 4,
               (src[4][ALPHA] * middle_weight) >> 4,
@@ -569,9 +571,11 @@ box_filter_premult (const guint    left_weight,
               (src[6][ALPHA] * bottom_weight) >> 4
             };
 
-          guint a = (center_weight * (factors[0] + factors[1] + factors[2]) +
-                     right_weight  * (factors[3] + factors[4] + factors[5]) +
-                     left_weight   * (factors[6] + factors[7] + factors[8]));
+          const guint a =
+            (center_weight * (factors[0] + factors[1] + factors[2]) +
+             right_weight  * (factors[3] + factors[4] + factors[5]) +
+             left_weight   * (factors[6] + factors[7] + factors[8]));
+
           guint i;
 
           for (i = 0; i < ALPHA; i++)



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