< prev index next >
src/java.desktop/unix/native/common/awt/X11Color.c
Print this page
rev 59383 : [mq]: final
*** 87,149 ****
*/
#define CMAP_ALLOC_MIN 100 /* minimum number of colors to "add" */
#define CMAP_ALLOC_DEFAULT 200 /* default number of colors in cmap */
#define CMAP_ALLOC_MAX 245 /* maximum number of colors in cmap */
- #ifdef __solaris__
- #include <sys/utsname.h>
-
- struct {
- char *machine;
- int cubesize;
- } machinemap[] = {
- { "i86pc", LOOKUPSIZE / 4 }, /* BugTraq ID 4102599 */
- { "sun4c", LOOKUPSIZE / 4 },
- { "sun4m", LOOKUPSIZE / 2 },
- { "sun4d", LOOKUPSIZE / 2 },
- { "sun4u", LOOKUPSIZE / 1 },
- };
-
- #define MACHMAPSIZE (sizeof(machinemap) / sizeof(machinemap[0]))
-
- int getVirtCubeSize() {
- struct utsname name;
- int i, ret;
-
- ret = uname(&name);
- if (ret < 0) {
- #ifdef DEBUG
- #include <errno.h>
- jio_fprintf(stderr, "uname errno = %d, using default cubesize %d\n",
- errno, LOOKUPSIZE);
- #endif
- return LOOKUPSIZE;
- }
-
- for (i = 0; i < MACHMAPSIZE; i++) {
- if (strcmp(name.machine, machinemap[i].machine) == 0) {
- #ifdef DEBUG
- if (debug_colormap) {
- jio_fprintf(stderr, "'%s'.cubesize = '%d'\n",
- machinemap[i].machine, machinemap[i].cubesize);
- }
- #endif
- return machinemap[i].cubesize;
- }
- }
-
- #ifdef DEBUG
- if (debug_colormap) {
- jio_fprintf(stderr, "unknown machine '%s' using cubesize %d\n",
- name.machine, LOOKUPSIZE);
- }
- #endif
- return LOOKUPSIZE;
- }
- #else /* __solaris__ */
#define getVirtCubeSize() (LOOKUPSIZE)
- #endif /* __solaris__ */
unsigned char img_bwgamma[256];
uns_ordered_dither_array img_oda_alpha;
#ifdef NEED_IMAGE_CONVERT
--- 87,97 ----
< prev index next >