Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 881213 | Differences between
and this patch

Collapse All | Expand All

(-)work/cnv/giftorle.c (-1 / +1 lines)
Lines 204-210 Link Here
204
	    EasyFail("EOF in extention\n",TRUE);
204
	    EasyFail("EOF in extention\n",TRUE);
205
	if (c == 0)
205
	if (c == 0)
206
	    return FALSE;
206
	    return FALSE;
207
	if (read(fd,buf,(int) c)!=(int) c) 
207
	if (!ReadOK(fd,buf,(int)c)) 
208
	    EasyFail("EOF in extention\n",TRUE);
208
	    EasyFail("EOF in extention\n",TRUE);
209
    }
209
    }
210
}
210
}
(-)work/get/getx11/getx11.c (-5 / +5 lines)
Lines 72-78 Link Here
72
72
73
char 		*progname = NULL;
73
char 		*progname = NULL;
74
Display		*dpy = NULL;
74
Display		*dpy = NULL;
75
Window		root_window = NULL;
75
Window		root_window = 0;
76
int		screen = 0;
76
int		screen = 0;
77
77
78
Boolean		debug_flag = False;	/* set if debug mode -D */
78
Boolean		debug_flag = False;	/* set if debug mode -D */
Lines 106-117 Link Here
106
void init_img_info( i )
106
void init_img_info( i )
107
image_information *i;
107
image_information *i;
108
{
108
{
109
    i->window = i->icn_window = NULL;
109
    i->window = i->icn_window = 0;
110
    i->pixmap = i->icn_pixmap = NULL;
110
    i->pixmap = i->icn_pixmap = 0;
111
    i->pix_info_window = NULL;
111
    i->pix_info_window = 0;
112
    i->gc = i->icn_gc = NULL;
112
    i->gc = i->icn_gc = NULL;
113
    i->image = i->icn_image = NULL;
113
    i->image = i->icn_image = NULL;
114
    i->colormap = NULL;
114
    i->colormap = 0;
115
    i->visual_class = -1;
115
    i->visual_class = -1;
116
    i->pixmap_failed = False;
116
    i->pixmap_failed = False;
117
    
117
    
(-)work/get/getx11/timer.c (-1 / +4 lines)
Lines 71-78 Link Here
71
wait_timer()
71
wait_timer()
72
{
72
{
73
#ifndef NO_ITIMER
73
#ifndef NO_ITIMER
74
    sigset_t sig_alarm_mask;
75
    (void) sigemptyset(&sig_alarm_mask);
76
    (void) sigaddset(&sig_alarm_mask, SIGALRM);
74
    while (!ringring)
77
    while (!ringring)
75
	sigpause( ~sigmask(SIGALRM));
78
	sigsuspend(&sig_alarm_mask);
76
    signal(SIGALRM, ofunc);
79
    signal(SIGALRM, ofunc);
77
#endif
80
#endif
78
}
81
}
(-)work/get/getx11/x11_stuff.c (-15 / +15 lines)
Lines 51-59 Link Here
51
    init_separate_color_ro(), init_color_ro(), init_mono_rw(), init_mono_ro();
51
    init_separate_color_ro(), init_color_ro(), init_mono_rw(), init_mono_ro();
52
static CONST_DECL char *visual_class_to_string();
52
static CONST_DECL char *visual_class_to_string();
53
53
54
static Cursor circle_cursor = NULL;
54
static Cursor circle_cursor = 0;
55
static Cursor left_ptr_cursor = NULL;
55
static Cursor left_ptr_cursor = 0;
56
static Cursor watch_cursor = NULL;
56
static Cursor watch_cursor = 0;
57
57
58
static int specified_screen = -1;	/* No specific screen. */
58
static int specified_screen = -1;	/* No specific screen. */
59
59
Lines 83-98 Link Here
83
void get_cursors( window )
83
void get_cursors( window )
84
Window window;
84
Window window;
85
{
85
{
86
    if (circle_cursor == NULL)
86
    if (circle_cursor == 0)
87
	circle_cursor = XCreateFontCursor (dpy, XC_circle);
87
	circle_cursor = XCreateFontCursor (dpy, XC_circle);
88
    
88
    
89
    if (watch_cursor == NULL)
89
    if (watch_cursor == 0)
90
	watch_cursor = XCreateFontCursor (dpy, XC_watch);
90
	watch_cursor = XCreateFontCursor (dpy, XC_watch);
91
91
92
    if (left_ptr_cursor == NULL)
92
    if (left_ptr_cursor == 0)
93
	left_ptr_cursor = XCreateFontCursor (dpy, XC_left_ptr);
93
	left_ptr_cursor = XCreateFontCursor (dpy, XC_left_ptr);
94
94
95
    if (circle_cursor == NULL) {
95
    if (circle_cursor == 0) {
96
	Pixmap	source;
96
	Pixmap	source;
97
	Pixmap	mask;
97
	Pixmap	mask;
98
	XColor	color_1;
98
	XColor	color_1;
Lines 266-277 Link Here
266
	if ( img ) {
266
	if ( img ) {
267
	    if ( xid == img->pixmap ){
267
	    if ( xid == img->pixmap ){
268
		DPRINTF(stderr, "img->pixmap allocation failed\n");
268
		DPRINTF(stderr, "img->pixmap allocation failed\n");
269
		img->pixmap = NULL;
269
		img->pixmap = 0;
270
		img->pixmap_failed = True;
270
		img->pixmap_failed = True;
271
	    } else
271
	    } else
272
	    if ( xid == img->icn_pixmap ){ 
272
	    if ( xid == img->icn_pixmap ){ 
273
		DPRINTF(stderr, "img->icn_pixmap allocation failed\n");
273
		DPRINTF(stderr, "img->icn_pixmap allocation failed\n");
274
		img->icn_pixmap = NULL;
274
		img->icn_pixmap = 0;
275
		img->pixmap_failed = True;
275
		img->pixmap_failed = True;
276
	    } else
276
	    } else
277
		_XDefaultError (dpy, event);
277
		_XDefaultError (dpy, event);
Lines 331-340 Link Here
331
    int iw = img->w * img->mag_fact;
331
    int iw = img->w * img->mag_fact;
332
    int ih = img->h * img->mag_fact;
332
    int ih = img->h * img->mag_fact;
333
    
333
    
334
    if (( img->pixmap != NULL && reallocate ) ||
334
    if (( img->pixmap != 0 && reallocate ) ||
335
	( img->pixmap != NULL && (img->pix_w < iw || img->pix_h < ih ))){
335
	( img->pixmap != 0 && (img->pix_w < iw || img->pix_h < ih ))){
336
	free_X_pixmap( dpy, img->pixmap );
336
	XFreePixmap( dpy, img->pixmap );
337
	img->pixmap = NULL;
337
	img->pixmap = 0;
338
    }
338
    }
339
    
339
    
340
    /* reallocate it: use the Min of the winsize and (pic * mag) */
340
    /* reallocate it: use the Min of the winsize and (pic * mag) */
Lines 1384-1390 Link Here
1384
	    }
1384
	    }
1385
	}
1385
	}
1386
	    
1386
	    
1387
	if (XAllocColors(dpy, img->colormap, color_defs, total_levels, status)== 0)
1387
	if (XAllocColor(dpy, img->colormap, color_defs, total_levels, status)== 0)
1388
	{
1388
	{
1389
	    for ( i = 0, j = 0; i < total_levels; i++ )
1389
	    for ( i = 0, j = 0; i < total_levels; i++ )
1390
		if (status[i])
1390
		if (status[i])
Lines 1638-1644 Link Here
1638
	    }
1638
	    }
1639
	}
1639
	}
1640
	    
1640
	    
1641
	if (XAllocColors(dpy, img->colormap, color_defs, num_lvls, status)== 0)
1641
	if (XAllocColor(dpy, img->colormap, color_defs, num_lvls, status)== 0)
1642
	{
1642
	{
1643
	    for ( i = 0, j = 0; i < num_lvls; i++ )
1643
	    for ( i = 0, j = 0; i < num_lvls; i++ )
1644
		if (status[i])
1644
		if (status[i])
(-)work/get/getx11/XGetHClrs.c (-2 / +3 lines)
Lines 1-4 Link Here
1
#ifndef XLIBINT_H_NOT_AVAILABLE
1
#ifdef XLIBINT_H_NOT_AVAILABLE
2
2
3
/* $XConsortium: XGetHClrs.c,v 11.10 88/09/06 16:07:50 martin Exp $ */
3
/* $XConsortium: XGetHClrs.c,v 11.10 88/09/06 16:07:50 martin Exp $ */
4
/* Copyright    Massachusetts Institute of Technology    1986	*/
4
/* Copyright    Massachusetts Institute of Technology    1986	*/
Lines 23-34 Link Here
23
}
23
}
24
24
25
25
26
Status XAllocColors(dpy, cmap, defs, ndefs, statuses)
26
Status XAllocColor(dpy, cmap, defs, ndefs, statuses)
27
register Display *dpy;
27
register Display *dpy;
28
Colormap cmap;
28
Colormap cmap;
29
XColor *defs;
29
XColor *defs;
30
int ndefs;
30
int ndefs;
31
Status *statuses;
31
Status *statuses;
32
32
{
33
{
33
    xAllocColorReply rep;
34
    xAllocColorReply rep;
34
    register xAllocColorReq *req;
35
    register xAllocColorReq *req;
(-)work/get/getx11/x11_stuff.c (-26 / +26 lines)
Lines 123-132 Link Here
123
	XFreePixmap (dpy, mask);
123
	XFreePixmap (dpy, mask);
124
    }
124
    }
125
    
125
    
126
    if (watch_cursor == NULL)
126
    if (watch_cursor == 0)
127
	watch_cursor = circle_cursor;
127
	watch_cursor = circle_cursor;
128
128
129
    if (left_ptr_cursor == NULL)
129
    if (left_ptr_cursor == 0)
130
	left_ptr_cursor = circle_cursor;
130
	left_ptr_cursor = circle_cursor;
131
}
131
}
132
132
Lines 147-153 Link Here
147
				 (img->binary_img ? 1 : img->dpy_depth), 
147
				 (img->binary_img ? 1 : img->dpy_depth), 
148
				 (img->binary_img ? XYBitmap : ZPixmap), 
148
				 (img->binary_img ? XYBitmap : ZPixmap), 
149
				 NULL, &img->shm_img, width, height );
149
				 NULL, &img->shm_img, width, height );
150
	if ( image != NULL )
150
	if ( image != 0 )
151
	{
151
	{
152
	    /* Allocate shared segment. */
152
	    /* Allocate shared segment. */
153
	    img->shm_img.shmid =
153
	    img->shm_img.shmid =
Lines 521-527 Link Here
521
{
521
{
522
    img->colormap = XCreateColormap (dpy, root_window,
522
    img->colormap = XCreateColormap (dpy, root_window,
523
				     img->dpy_visual, AllocNone );
523
				     img->dpy_visual, AllocNone );
524
    if (img->colormap == NULL) 
524
    if (img->colormap == 0) 
525
	fprintf(stderr, "getx11: Could not create color map for visual\n");
525
	fprintf(stderr, "getx11: Could not create color map for visual\n");
526
    else {
526
    else {
527
	VPRINTF(stderr, "created colormap for visual type %s\n",
527
	VPRINTF(stderr, "created colormap for visual type %s\n",
Lines 543-556 Link Here
543
	    specified_screen = atoi( dotp+1 );
543
	    specified_screen = atoi( dotp+1 );
544
    }
544
    }
545
545
546
    if (display_name == NULL || *display_name == '\0')
546
    if (display_name == 0 || *display_name == '\0')
547
	display_name = getenv("DISPLAY");
547
	display_name = getenv("DISPLAY");
548
548
549
    dpy = XOpenDisplay(display_name);
549
    dpy = XOpenDisplay(display_name);
550
    
550
    
551
    if (dpy == NULL) {
551
    if (dpy == 0) {
552
	fprintf(stderr, "%s: Cant open display %s\n", progname,
552
	fprintf(stderr, "%s: Cant open display %s\n", progname,
553
		(display_name == NULL) ? "" : display_name);
553
		(display_name == 0) ? "" : display_name);
554
	exit(1);
554
	exit(1);
555
    }
555
    }
556
556
Lines 608-615 Link Here
608
     * Now, make the window.
608
     * Now, make the window.
609
     */
609
     */
610
    
610
    
611
    new_window = (img->window == NULL && img->icn_window == NULL);
611
    new_window = (img->window == 0 && img->icn_window == 0);
612
    new_pixmaps = ((img->pixmap == NULL || img->icn_pixmap == NULL) &&
612
    new_pixmaps = ((img->pixmap == 0 || img->icn_pixmap == 0) &&
613
		   !img->pixmap_failed && !stingy_flag);
613
		   !img->pixmap_failed && !stingy_flag);
614
    
614
    
615
    if ( !img->window )
615
    if ( !img->window )
Lines 1279-1285 Link Here
1279
	nunique = (p - pixels) + 1;
1279
	nunique = (p - pixels) + 1;
1280
1280
1281
	DPRINTF(stderr, "In free_unique_pixels \n\nPixels: ");
1281
	DPRINTF(stderr, "In free_unique_pixels \n\nPixels: ");
1282
	for (i=0;i<nunique;i++) DPRINTF(stderr, " %d ",pixels[i]);
1282
	for (i=0;i<nunique;i++) DPRINTF(stderr, " %zu ",pixels[i]);
1283
	DPRINTF(stderr, "\n");
1283
	DPRINTF(stderr, "\n");
1284
    }
1284
    }
1285
    else
1285
    else
Lines 1340-1352 Link Here
1340
	/* try to get a color map entry for each color. */
1340
	/* try to get a color map entry for each color. */
1341
	red_index = green_index = blue_index = 0;
1341
	red_index = green_index = blue_index = 0;
1342
	
1342
	
1343
#ifdef XLIBINT_H_NOT_AVAILABLE
1343
#ifndef XLIBINT_H_NOT_AVAILABLE
1344
	for ( i = 0; i < total_levels; i++ ) {
1344
	for ( i = 0; i < total_levels; i++ ) {
1345
	    color_def.red   = map[red_index] << 8;
1345
	    color_defs->red   = map[red_index] << 8;
1346
	    color_def.green = map[green_index] << 8;
1346
	    color_defs->green = map[green_index] << 8;
1347
	    color_def.blue  = map[blue_index] << 8;
1347
	    color_defs->blue  = map[blue_index] << 8;
1348
	    
1348
	    
1349
	    if ( XAllocColor (dpy, img->colormap, &color_def ) == 0 ) {
1349
	    if ( XAllocColor (dpy, img->colormap, color_defs ) == 0 ) {
1350
		break;
1350
		break;
1351
	    }
1351
	    }
1352
	    
1352
	    
Lines 1357-1363 Link Here
1357
		red_index = 0;
1357
		red_index = 0;
1358
	    }
1358
	    }
1359
	    
1359
	    
1360
	    img->pixel_table[i] = color_def.pixel;
1360
	    img->pixel_table[i] = color_defs->pixel;
1361
	}
1361
	}
1362
	
1362
	
1363
	/* Check if the colors are available */
1363
	/* Check if the colors are available */
Lines 1592-1613 Link Here
1592
	
1592
	
1593
	/* try to get a color map entry for each color.  */
1593
	/* try to get a color map entry for each color.  */
1594
	
1594
	
1595
#ifdef XLIBINT_H_NOT_AVAILABLE
1595
#ifndef XLIBINT_H_NOT_AVAILABLE
1596
	for ( i = 0; i < num_lvls; i++ ) {
1596
	for ( i = 0; i < num_lvls; i++ ) {
1597
	    if ( img->mono_color ) {
1597
	    if ( img->mono_color ) {
1598
		color_def.red   = img->in_cmap[RLE_RED][i] << 8;
1598
		color_defs->red   = img->in_cmap[RLE_RED][i] << 8;
1599
		color_def.green = img->in_cmap[RLE_GREEN][i] << 8;
1599
		color_defs->green = img->in_cmap[RLE_GREEN][i] << 8;
1600
		color_def.blue  = img->in_cmap[RLE_BLUE][i] << 8;
1600
		color_defs->blue  = img->in_cmap[RLE_BLUE][i] << 8;
1601
	    } else {
1601
	    } else {
1602
		color_def.red   = map[i] << 8;
1602
		color_defs->red   = map[i] << 8;
1603
		color_def.green = map[i] << 8;
1603
		color_defs->green = map[i] << 8;
1604
		color_def.blue  = map[i] << 8;
1604
		color_defs->blue  = map[i] << 8;
1605
	    }
1605
	    }
1606
	    
1606
	    
1607
	    if ( XAllocColor (dpy, img->colormap, &color_def ) == 0 ){ 
1607
	    if ( XAllocColor (dpy, img->colormap, color_defs ) == 0 ){ 
1608
		break;
1608
		break;
1609
	    }
1609
	    }
1610
	    img->pixel_table[i] = color_def.pixel;
1610
	    img->pixel_table[i] = color_defs->pixel;
1611
	}
1611
	}
1612
	
1612
	
1613
	/* Check if the colors are available */
1613
	/* Check if the colors are available */
Lines 1981-1987 Link Here
1981
    font_height = pixel_font_info->ascent + pixel_font_info->descent + 4;
1981
    font_height = pixel_font_info->ascent + pixel_font_info->descent + 4;
1982
    y = (use_top ? 0 : (h - font_height));
1982
    y = (use_top ? 0 : (h - font_height));
1983
1983
1984
    if ( img->pix_info_window == NULL ) {
1984
    if ( img->pix_info_window == 0 ) {
1985
	XSetFont (dpy, img->gc, pixel_font_info->fid );
1985
	XSetFont (dpy, img->gc, pixel_font_info->fid );
1986
	img->pix_info_window = XCreateSimpleWindow(
1986
	img->pix_info_window = XCreateSimpleWindow(
1987
	    dpy, img->window, 0, y, w, font_height, 0, None,
1987
	    dpy, img->window, 0, y, w, font_height, 0, None,
(-)work/cnv/rletops.c (-1 / +1 lines)
Lines 231-237 Link Here
231
FILE *outfile;
231
FILE *outfile;
232
unsigned char p;
232
unsigned char p;
233
{
233
{
234
    static npixo = 0;
234
    static int npixo = 0;
235
    static char tohex[] = "0123456789ABCDEF";
235
    static char tohex[] = "0123456789ABCDEF";
236
236
237
    putc(tohex[(p>>4)&0xF],outfile);
237
    putc(tohex[(p>>4)&0xF],outfile);
(-)work/lib/rle_cp.c (-4 / +4 lines)
Lines 158-170 Link Here
158
	    /* Total paranoia.  nc should never be > buflen. */
158
	    /* Total paranoia.  nc should never be > buflen. */
159
	    while ( nc > buflen )
159
	    while ( nc > buflen )
160
	    {
160
	    {
161
		fread( buffer, nc, 1, infile );
161
		(void) fread( buffer, nc, 1, infile );
162
		fwrite( buffer, nc, 1, outfile );
162
		(void) fwrite( buffer, nc, 1, outfile );
163
		nc -= buflen;
163
		nc -= buflen;
164
	    }
164
	    }
165
165
166
	    fread( buffer, nc, 1, infile );
166
	    (void) fread( buffer, nc, 1, infile );
167
	    fwrite( buffer, nc, 1, outfile );
167
	    (void) fwrite( buffer, nc, 1, outfile );
168
	    break;
168
	    break;
169
169
170
	case RRunDataOp:
170
	case RRunDataOp:
(-)work/tools/avg4.c (-1 / +1 lines)
Lines 34-40 Link Here
34
#include <stdio.h>
34
#include <stdio.h>
35
#include "rle.h"
35
#include "rle.h"
36
36
37
static bit_count[16] = {0, 63, 63, 127, 63, 127, 127,
37
static int bit_count[16] = {0, 63, 63, 127, 63, 127, 127,
38
    192, 63, 127, 127, 192, 127, 192, 192, 255};
38
    192, 63, 127, 127, 192, 127, 192, 192, 255};
39
39
40
void
40
void
(-)work/tools/mcut.c (-2 / +2 lines)
Lines 791-797 Link Here
791
		    TRACE( tmp_cb, cb_list )
791
		    TRACE( tmp_cb, cb_list )
792
		    {
792
		    {
793
			register color_t *newcol = &tmp_cb->color;
793
			register color_t *newcol = &tmp_cb->color;
794
			register newdist = DISTANCE( ref_col, *newcol );
794
			register int newdist = DISTANCE( ref_col, *newcol );
795
795
796
			if ( newdist < dist )
796
			if ( newdist < dist )
797
			{
797
			{
Lines 963-969 Link Here
963
cmp_radices ( h1, h2 )
963
cmp_radices ( h1, h2 )
964
histogram_t **h1, **h2;
964
histogram_t **h1, **h2;
965
{
965
{
966
    register c1 = -1, c2 = -1;
966
    register int c1 = -1, c2 = -1;
967
967
968
    if ( *h1 )
968
    if ( *h1 )
969
	c1 = (*h1)->color & mask;
969
	c1 = (*h1)->color & mask;

Return to bug 881213