summaryrefslogtreecommitdiff
path: root/editors/uemacs/patches/patch-src_search_c
blob: fe1ab64e6f184b2f8f9a869a9ac3297ee508ca8a (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
$NetBSD: patch-src_search_c,v 1.1 2012/05/10 20:53:30 dholland Exp $

- silence initialization warning seen with gcc 4.1
- fix mixing of signed and unsigned char pointers
- silence gcc braces and parentheses warnings

--- src/search.c~	2012-05-10 19:25:36.000000000 +0000
+++ src/search.c
@@ -255,6 +255,10 @@ int repeats;
 	int	patlenadd;
 	int	jump;
 
+	/* required by gcc 4.1  */
+	patlenadd = 0;
+	jump = 0;
+
 	/* If we are going in reverse, then the 'end' is actually
 	 * the beginning of the pattern.  Toggle it.
 	 */
@@ -410,7 +414,7 @@ int *pcwoff;
 		/* Is the current meta-character modified
 		 * by a closure?
 		 */
-		if (cl_type = (mcptr->mc_type & ALLCLOS)) {
+		if ((cl_type = (mcptr->mc_type & ALLCLOS)) != 0) {
 
 			/* Minimum number of characters that may
 			 * match is 0 or 1.
@@ -807,7 +811,7 @@ DELTA *tbl;
  */
 VOID PASCAL NEAR setjtable()
 {
-	make_delta(pat, &deltapat);
+	make_delta((char *)pat, &deltapat);
 	make_delta(strrev(strcpy((char *)tap, (char *)pat)), &tapatled);
 }
 
@@ -876,13 +880,14 @@ int srch;
 	/* Only make the meta-pattern if in magic mode, since the
 	 * pattern in question might have an invalid meta combination.
 	 */
-	if (status == TRUE)
+	if (status == TRUE) {
 		if ((curwp->w_bufp->b_mode & MDMAGIC) == 0) {
 			mcclear();
 			rmcclear();
 		}
 		else
 			status = srch? mcstr(): rmcstr();
+	}
 #endif
 	return (status);
 }
@@ -1500,7 +1505,7 @@ MC *mcptr;
 	 * Now loop through the pattern, collecting characters until
 	 * we run into a meta-character.
 	 */
-	while (pchr = *++patptr)
+	while ((pchr = *++patptr) != 0)
 	{
 		/*
 		 * If the current character is a closure character,