( acht, maxacolors )
| 701 | |
| 702 | |
| 703 | static acolorhist_vector |
| 704 | pam_acolorhashtoacolorhist( acht, maxacolors ) |
| 705 | acolorhash_table acht; |
| 706 | int maxacolors; |
| 707 | { |
| 708 | acolorhist_vector achv; |
| 709 | acolorhist_list achl; |
| 710 | int i, j; |
| 711 | |
| 712 | /* Now collate the hash table into a simple acolorhist array. */ |
| 713 | achv = (acolorhist_vector) malloc( maxacolors * sizeof(struct acolorhist_item) ); |
| 714 | /* (Leave room for expansion by caller.) */ |
| 715 | if ( achv == (acolorhist_vector) 0 ) { |
| 716 | fprintf( stderr, " out of memory generating histogram\n" ); |
| 717 | exit(9); |
| 718 | } |
| 719 | |
| 720 | /* Loop through the hash table. */ |
| 721 | j = 0; |
| 722 | for ( i = 0; i < HASH_SIZE; ++i ) |
| 723 | for ( achl = acht[i]; achl != (acolorhist_list) 0; achl = achl->next ) |
| 724 | { |
| 725 | /* Add the new entry. */ |
| 726 | achv[j] = achl->ch; |
| 727 | ++j; |
| 728 | } |
| 729 | |
| 730 | /* All done. */ |
| 731 | return achv; |
| 732 | } |
| 733 | |
| 734 | |
| 735 |
no outgoing calls
no test coverage detected