From 17069c6b5c1f06ecb81d1bb42b0e766f972fc12a Mon Sep 17 00:00:00 2001 From: giraffedata Date: Tue, 4 Aug 2015 15:45:00 +0000 Subject: cleanup git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2621 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- lib/libpammap.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'lib/libpammap.c') diff --git a/lib/libpammap.c b/lib/libpammap.c index 55e1d3ff..22224913 100644 --- a/lib/libpammap.c +++ b/lib/libpammap.c @@ -75,7 +75,7 @@ pnm_createtuplehash(void) { void pnm_destroytuplehash(tuplehash const tuplehash) { - int i; + unsigned int i; /* Free the chains */ @@ -156,7 +156,13 @@ pnm_lookuptuple(struct pam * const pamP, const tuple searchval, int * const foundP, int * const retvalP) { - +/*---------------------------------------------------------------------------- + Return as *revtvalP the index of the tuple value 'searchval' in the + tuple hash 'tuplehash'. + + But iff the tuple value isn't in the hash, return *foundP == false + and nothing as *retvalP. +-----------------------------------------------------------------------------*/ unsigned int const hashvalue = pnm_hashtuple(pamP, searchval); struct tupleint_list_item * p; struct tupleint_list_item * found; @@ -221,7 +227,16 @@ pnm_addtuplefreqoccurrence(struct pam * const pamP, tuple const value, tuplehash const tuplefreqhash, int * const firstOccurrenceP) { +/*---------------------------------------------------------------------------- + Tally one more occurence of the tuple value 'value' to the tuple frequencey + hash 'tuplefreqhash', adding the tuple to the hash if it isn't there + already. + + Allocate new space for the tuple value and the hash chain element. + If we can't allocate space for the new hash chain element, abort the + program. +-----------------------------------------------------------------------------*/ unsigned int const hashvalue = pnm_hashtuple(pamP, value); struct tupleint_list_item * p; @@ -735,3 +750,5 @@ pam_colorname(struct pam * const pamP, sprintf(colorname, "#%02x%02x%02x", r, g, b); return colorname; } + + -- cgit 1.4.1