about summary refs log tree commit diff
path: root/analyzer
diff options
context:
space:
mode:
Diffstat (limited to 'analyzer')
-rw-r--r--analyzer/pgmtexture.c9
-rw-r--r--analyzer/pnmpsnr.c2
2 files changed, 10 insertions, 1 deletions
diff --git a/analyzer/pgmtexture.c b/analyzer/pgmtexture.c
index ea0b6210..5af51bf5 100644
--- a/analyzer/pgmtexture.c
+++ b/analyzer/pgmtexture.c
@@ -49,7 +49,16 @@ static bool const sortit = FALSE;
 static float *
 vector(unsigned int const nl,
        unsigned int const nh) {
+/*----------------------------------------------------------------------------
+  Allocate a float vector with range [nl..nh]
+
+  We do some seedy C here, subtracting an arbitrary integer from a pointer and
+  calling the result a pointer.  It normally works because the only way we'll
+  use that pointer is by adding that same integer or something greater to it.
 
+  The point of this is not to allocate memory for vector elements that will
+  never be referenced (component < nl).
+-----------------------------------------------------------------------------*/
     float * v;
     unsigned int i;
 
diff --git a/analyzer/pnmpsnr.c b/analyzer/pnmpsnr.c
index 2363e8c3..6543c542 100644
--- a/analyzer/pnmpsnr.c
+++ b/analyzer/pnmpsnr.c
@@ -179,7 +179,7 @@ validateInput(struct pam const pam1,
                  pam1.height, pam2.height);
 
     if (pam1.maxval != pam2.maxval)
-        pm_error("images do not have the same maxval.  This programs works "
+        pm_error("images do not have the same maxval.  This program works "
                  "only on like maxvals.  "
                  "The first image has maxval %u, "
                  "while the second has %u.  Use Pamdepth to change the "