[gegl] undo pointless obfuscation



commit 8801f6fd76192d0e08892f2daf0e156f328c6ed0
Author: Nicolas Robidoux <nrobidoux git gnome org>
Date:   Wed Dec 12 13:31:29 2012 -0500

    undo pointless obfuscation

 gegl/buffer/gegl-sampler.c |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/gegl/buffer/gegl-sampler.c b/gegl/buffer/gegl-sampler.c
index 2a664b0..629191d 100644
--- a/gegl/buffer/gegl-sampler.c
+++ b/gegl/buffer/gegl-sampler.c
@@ -261,17 +261,14 @@ gegl_sampler_get_ptr (GeglSampler *const sampler,
        * maximum width and height of the fetch_rectangle is 64, so
        * that half of it is 32, one fourth of the elbow room is at most
        * 8.
-       *
-       * Note: numerator is non-negative, so "/ 8" can be replaced by
-       * ">> 3"
        */
 
       fetch_rectangle.x =
         x + sampler->context_rect[0].x -
-        ((maximum_width_and_height - sampler->context_rect[0].width ) >> 3);
+        (maximum_width_and_height - sampler->context_rect[0].width ) / 8;
       fetch_rectangle.y =
         y + sampler->context_rect[0].y -
-        ((maximum_width_and_height - sampler->context_rect[0].height) >> 3);
+        (maximum_width_and_height - sampler->context_rect[0].height) / 8;
 
       fetch_rectangle.width  = maximum_width_and_height;
       fetch_rectangle.height = maximum_width_and_height;
@@ -347,9 +344,9 @@ gegl_sampler_get_from_buffer (GeglSampler *const sampler,
       GeglRectangle fetch_rectangle;
 
       fetch_rectangle.x =
-        x - ((maximum_width_and_height - sampler->context_rect[0].width ) >> 3);
+        x - (maximum_width_and_height - sampler->context_rect[0].width ) / 8;
       fetch_rectangle.y =
-        y - ((maximum_width_and_height - sampler->context_rect[0].height) >> 3);
+        y - (maximum_width_and_height - sampler->context_rect[0].height) / 8;
 
       fetch_rectangle.width  = maximum_width_and_height;
       fetch_rectangle.height = maximum_width_and_height;
@@ -436,10 +433,10 @@ gegl_sampler_get_from_mipmap (GeglSampler *const sampler,
 
       fetch_rectangle.x =
         x + sampler->context_rect[level].x -
-        ((maximum_width_and_height - sampler->context_rect[level].width ) >> 3);
+        (maximum_width_and_height - sampler->context_rect[level].width ) / 8;
       fetch_rectangle.y =
         y + sampler->context_rect[level].y -
-        ((maximum_width_and_height - sampler->context_rect[level].height) >> 3);
+        (maximum_width_and_height - sampler->context_rect[level].height) / 8;
 
       fetch_rectangle.width  = maximum_width_and_height;
       fetch_rectangle.height = maximum_width_and_height;



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