diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2015-08-04 15:45:00 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2015-08-04 15:45:00 +0000 |
commit | 17069c6b5c1f06ecb81d1bb42b0e766f972fc12a (patch) | |
tree | a791a736b5b1c0f9566a429a9246021134f9fbb7 /lib | |
parent | 8a60eb7a79ad9ed77050bda87fd4e60126ac0bda (diff) | |
download | netpbm-mirror-17069c6b5c1f06ecb81d1bb42b0e766f972fc12a.tar.gz netpbm-mirror-17069c6b5c1f06ecb81d1bb42b0e766f972fc12a.tar.xz netpbm-mirror-17069c6b5c1f06ecb81d1bb42b0e766f972fc12a.zip |
cleanup
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@2621 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libpammap.c | 21 |
1 files changed, 19 insertions, 2 deletions
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; } + + |