summaryrefslogtreecommitdiff
path: root/x11/Xaw-Xpm/patches/patch-aa
blob: 04146761f8f9501d55b880f21e66038c3bc8f666 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
$NetBSD: patch-aa,v 1.4 2007/10/09 11:09:22 rillig Exp $

Handle wide signal masks.

For the removal of the type casts, see patch-ak.

--- Xpm.c.orig	1996-11-26 14:40:26.000000000 +0100
+++ Xpm.c	2007-10-09 12:54:37.000000000 +0200
@@ -46,7 +46,7 @@ char directory[MAXPATHLEN];
 			}
 			chdir(directory);
 		}
-		(PixmapNode *)PixList.first = (PixmapNode *)pixnode;
+		PixList.first = pixnode;
 		pixnode->next = NULL;
 		PixList.n_entries = 1;
 		pixnode->filename = filename;
@@ -55,18 +55,18 @@ char directory[MAXPATHLEN];
 
 /* Is the pixmap already in the list? */
 
-	(PixmapNode *)pixnode = (PixmapNode *)PixList.first;
+	pixnode = PixList.first;
 	for(;;)
 	{
 		if(strncmp(filename,pixnode->filename, MAXPATHLEN) == 0)
 			return((Pixmap *)&pixnode->pixmap);
 		if(pixnode->next == NULL) break;
-		(PixmapNode *)pixnode = (PixmapNode *)pixnode->next;
+		pixnode = pixnode->next;
 	}
 
 /* Didnt find the pixmap...make a new one */
 	
-	(PixmapNode *)pixnew = (void *)malloc(sizeof(PixmapNode));
+	pixnew = (void *)malloc(sizeof(PixmapNode));
 	
 	XGetWindowAttributes(XtDisplay(w) ,DefaultRootWindow(XtDisplay(w)),&root_att);
    	orig_att.closeness=65536;
@@ -86,7 +86,7 @@ char directory[MAXPATHLEN];
    		 }
    		 chdir(directory);
    	}
-	(PixmapNode *)pixnode->next = (PixmapNode *)pixnew;
+	pixnode->next = pixnew;
 	pixnew->filename = filename;
 	pixnew->next = NULL;
    	return((Pixmap *)&pixnew->pixmap);
@@ -105,7 +105,7 @@ XpmAttributes orig_att;
 char error_buf[BUFSIZ];
 char directory[MAXPATHLEN];
 
-           (PixmapNode *)pixnode = (PixmapNode *)PixList.first;
+           pixnode = PixList.first;
 	for(;;)
 	{
 		if(strncmp(filename,pixnode->filename, MAXPATHLEN) == 0)
@@ -114,7 +114,7 @@ char directory[MAXPATHLEN];
 			break;
 		}
 		if(pixnode->next == NULL) break;
-		(PixmapNode *)pixnode = (PixmapNode *)pixnode->next;
+		pixnode = pixnode->next;
 	}
 	if(found)
 	{
@@ -140,7 +140,7 @@ char directory[MAXPATHLEN];
    	}
 	else
 	{
-		(PixmapNode *)pixnew = (void *)malloc(sizeof(PixmapNode));
+		pixnew = (void *)malloc(sizeof(PixmapNode));
 		 XGetWindowAttributes(XtDisplay(w) ,DefaultRootWindow(XtDisplay(w)),&root_att);
   	 	orig_att.closeness=65536;
   	 	orig_att.colormap=root_att.colormap;
@@ -159,7 +159,7 @@ char directory[MAXPATHLEN];
    			}
    			chdir(directory);
  	  	}
-		(PixmapNode *)pixnode->next = (PixmapNode *)pixnew;
+		pixnode->next = pixnew;
 		pixnew->filename = filename;
 		pixnew->next = NULL;
   	 	return((Pixmap *)&pixnew->mask);
@@ -206,9 +206,8 @@ char *soundfile;
 	sigchld.
 */
   		new.sa_handler=SigHandle;
-		new.sa_mask=0;
-		new.sa_flags=SA_NOMASK | SA_ONESHOT;
-		new.sa_restorer=NULL;
+		(void) memset(&new.sa_mask, 0, sizeof(new.sa_mask));
+		new.sa_flags=SA_NODEFER;
 		sigaction(SIGCHLD, &new, &old);
 		playing = 1;
 		soundpid = fork();