about summary refs log tree commit diff
path: root/converter/pbm/mrftopbm.c
diff options
context:
space:
mode:
Diffstat (limited to 'converter/pbm/mrftopbm.c')
-rw-r--r--converter/pbm/mrftopbm.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/converter/pbm/mrftopbm.c b/converter/pbm/mrftopbm.c
index 696fe839..9534f3a5 100644
--- a/converter/pbm/mrftopbm.c
+++ b/converter/pbm/mrftopbm.c
@@ -62,10 +62,13 @@ doSquare(FILE *          const in,
         }
     } else {
         /* not all one color, so recurse. */
-        doSquare(in, image, ox,      oy,     w, size >> 1);
-        doSquare(in, image, ox+size, oy,     w, size >> 1);
-        doSquare(in, image, ox,      oy+size,w, size >> 1);
-        doSquare(in, image, ox+size, oy+size,w, size >> 1);
+
+        int halfsize = size >> 1;
+
+        doSquare(in, image, ox,          oy,          w, halfsize);
+        doSquare(in, image, ox+halfsize, oy,          w, halfsize);
+        doSquare(in, image, ox,          oy+halfsize, w, halfsize);
+        doSquare(in, image, ox+halfsize, oy+halfsize, w, halfsize);
     }
 }