Changeset 16796
- Timestamp:
- Mar 4, 2008, 12:17:15 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20080223/Ohana/src/kapa2/src/CheckVisual.c
r16011 r16796 14 14 unsigned long planes[3]; 15 15 XPixmapFormatValues *pixmaps; 16 int Npixmaps ;16 int Npixmaps, Npixels; 17 17 18 18 if (DEBUG) { … … 127 127 128 128 if (isDynamic) { 129 Npixels = NPIXELS_DYNAMIC; 130 if ((N = get_argument (*argc, argv, "-ncolors"))) { 131 remove_argument(N, argc, argv); 132 Npixels = atoi (argv[N]); 133 remove_argument(N, argc, argv); 134 } 135 129 136 /* allocate color cells */ 130 ALLOCATE (graphic[0].pixels, unsigned long, N PIXELS_DYNAMIC);131 ALLOCATE (graphic[0].cmap, XColor, N PIXELS_DYNAMIC);132 for (graphic[0].Npixels = N PIXELS_DYNAMIC; graphic[0].Npixels >= 16; graphic[0].Npixels -= 4) {137 ALLOCATE (graphic[0].pixels, unsigned long, Npixels); 138 ALLOCATE (graphic[0].cmap, XColor, Npixels); 139 for (graphic[0].Npixels = Npixels; graphic[0].Npixels >= 16; graphic[0].Npixels -= 4) { 133 140 if (DEBUG) fprintf (stderr, "trying %d colors\n", (int) graphic[0].Npixels); 134 141 if (XAllocColorCells (graphic[0].display, graphic[0].colormap, FALSE, planes, 1, graphic[0].pixels, graphic[0].Npixels)) { … … 163 170 } 164 171 } else { 172 Npixels = NPIXELS_STATIC; 173 if ((N = get_argument (*argc, argv, "-ncolors"))) { 174 remove_argument(N, argc, argv); 175 Npixels = atoi (argv[N]); 176 remove_argument(N, argc, argv); 177 } 178 165 179 // XXX allocate the unsigned long *pixels here and above 166 ALLOCATE (graphic[0].pixels, unsigned long, N PIXELS_STATIC);167 ALLOCATE (graphic[0].cmap, XColor, N PIXELS_STATIC);168 graphic[0].Npixels = N PIXELS_STATIC;180 ALLOCATE (graphic[0].pixels, unsigned long, Npixels); 181 ALLOCATE (graphic[0].cmap, XColor, Npixels); 182 graphic[0].Npixels = Npixels; 169 183 } 170 184
Note:
See TracChangeset
for help on using the changeset viewer.
