1 |
– |
/* Copyright (c) 1997 Silicon Graphics, Inc. */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ SGI"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* Allocate and control dynamic color table. |
6 |
|
* |
62 |
|
return(0); |
63 |
|
/* free old tables */ |
64 |
|
if (clrtab != NULL) |
65 |
< |
free((char *)clrtab); |
65 |
> |
free((void *)clrtab); |
66 |
|
if (ctree != NULL) |
67 |
< |
free((char *)ctree); |
67 |
> |
free((void *)ctree); |
68 |
|
/* get new tables */ |
69 |
|
for (treesize = 1; treesize < ncolors; treesize <<= 1) |
70 |
|
; |
76 |
|
/* partition color space */ |
77 |
|
cut(ctree, 0, CLRCUBE, 0, ncolors); |
78 |
|
/* clear histogram */ |
79 |
< |
bzero((char *)histo, sizeof(histo)); |
79 |
> |
bzero((void *)histo, sizeof(histo)); |
80 |
|
/* return number of colors used */ |
81 |
|
return(ncolors); |
82 |
|
} |
152 |
|
} |
153 |
|
/* split box */ |
154 |
|
*tree = split(box); |
155 |
< |
bcopy((char *)box, (char *)kb, sizeof(kb)); |
155 |
> |
bcopy((void *)box, (void *)kb, sizeof(kb)); |
156 |
|
/* do left (lesser) branch */ |
157 |
|
kb[prim(*tree)][1] = part(*tree); |
158 |
|
cut(tree+(1<<level), level+1, kb, c0, (c0+c1)>>1); |