about summary refs log tree commit diff
path: root/converter/ppm
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2012-07-08 21:51:37 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2012-07-08 21:51:37 +0000
commita72e4eeb62545fd6c474e03d2d613d2a273cd57c (patch)
tree71d8e827aa043fa633a29d4cacafcab865f769a7 /converter/ppm
parenta8f45c59ce7ab77d7a35e96f5f83a4606d0f0bea (diff)
downloadnetpbm-mirror-a72e4eeb62545fd6c474e03d2d613d2a273cd57c.tar.gz
netpbm-mirror-a72e4eeb62545fd6c474e03d2d613d2a273cd57c.tar.xz
netpbm-mirror-a72e4eeb62545fd6c474e03d2d613d2a273cd57c.zip
fix comments
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1713 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/ppm')
-rw-r--r--converter/ppm/ppmtospu.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/converter/ppm/ppmtospu.c b/converter/ppm/ppmtospu.c
index c655ca05..5bbbc2d3 100644
--- a/converter/ppm/ppmtospu.c
+++ b/converter/ppm/ppmtospu.c
@@ -245,9 +245,10 @@ sort(struct PixelType * const pixelType,
     int i, j;
     
     /* Rearrange so that everything less than 'pivot' is on the left side of
-       the subject array slice, while everything else is on the right side (we
-       won't know until we're done where the dividing line between the sides
-       is), then sort those two sides.
+       the subject array slice and everything greater than is on the right
+       side and elements equal could be on either side (we won't know until
+       we're done where the dividing line between the sides is), then sort
+       those two sides.
     */
 
     assert(left <= right);
@@ -259,8 +260,10 @@ sort(struct PixelType * const pixelType,
             --j;
         
         if (i <= j) {
-            /* A pixel not less popular than pivot is to the left of a pixel
-               less popular than pivot, so swap them.
+            /* An element not less popular than pivot is to the left of a
+               pixel not more popular than pivot, so swap them.  Note that we
+               could be swapping equal (pivot-valued) elements.  Though the
+               swap isn't necessary, moving 'i' and 'j' is.
             */
             swapPixelType(pixelType, i, j);
             ++i;