diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2015-09-26 19:59:25 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2015-09-26 19:59:25 +0000 |
commit | d77b3e8f164893762749f22f38bed0d13883905e (patch) | |
tree | e1fa32bd49bdc7c5e862aba30c0ca81a963ef658 /lib/libpammap.c | |
parent | 6e879ff027c9019c964d15ae0e0c966fc7d1c7a8 (diff) | |
download | netpbm-mirror-d77b3e8f164893762749f22f38bed0d13883905e.tar.gz netpbm-mirror-d77b3e8f164893762749f22f38bed0d13883905e.tar.xz netpbm-mirror-d77b3e8f164893762749f22f38bed0d13883905e.zip |
Update Advanced to 10.72
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@2639 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib/libpammap.c')
-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; } + + |