From 0861102cd5955111404467c4fff111208bc9f06d Mon Sep 17 00:00:00 2001 From: giraffedata Date: Tue, 10 Oct 2023 17:59:39 +0000 Subject: Add comments git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4746 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- lib/libpgm1.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') diff --git a/lib/libpgm1.c b/lib/libpgm1.c index 43458f8a..0656e1e0 100644 --- a/lib/libpgm1.c +++ b/lib/libpgm1.c @@ -125,6 +125,13 @@ pgm_validateComputableMaxval(gray const maxval) { Code also sometimes iterates through sample values and quits when the value is greater than the maxval. + + Code often divides by the maxval, but we don't have to check for maxval + == 0 as a computability problem because that is not a valid maxval. + + Note that in the PNM Plain formats, there is no upper limit for a + maxval, though the 'gray' type does constrain what has been passed to + us. */ if (maxval > INT_MAX-1) -- cgit 1.4.1