Lines 1-58
Link Here
|
1 |
--- ./lib/libxview/notify/ntfyclient.c.orig Tue Jun 29 07:18:11 1993 |
1 |
--- lib/libxview/notify/ntfyclient.c.orig Tue Jun 29 00:18:11 1993 |
2 |
+++ ./lib/libxview/notify/ntfyclient.c Sat Apr 1 18:25:26 2000 |
2 |
+++ lib/libxview/notify/ntfyclient.c Sun Mar 26 19:54:38 2006 |
3 |
@@ -18,7 +18,9 @@ static char sccsid[] = "@(#)ntfyclie |
3 |
@@ -43,7 +43,20 @@ |
4 |
#include <xview_private/ntfy.h> |
4 |
tmp = key2a >> 16; |
5 |
#include <xview_private/ndis.h> /* For ndis_default_prioritizer */ |
5 |
tmp1 = key2a << 21; |
6 |
#include <xview_private/ndet.h> |
6 |
key2a = tmp1 | ((key2a << 5) & 0x001f0000) | tmp; |
7 |
+#ifndef __FreeBSD__ |
7 |
- return key1a - key2a; |
8 |
#include <search.h> |
8 |
+/* return key1a - key2a; */ |
9 |
+#endif |
9 |
+ /* OUCH, trying to store the result of the subtraction of two unsigned |
10 |
#include <xview_private/portable.h> |
10 |
+ * ints (which potentially can use the whole range of an unsigned int, due |
|
|
11 |
+ * to the bit-shifting above) in a signed int is not a very clever idea. |
12 |
+ * But we only have to return *any* positive value if key1a is greater than |
13 |
+ * key2a, 0 if they're equal or *any* negatve value if key1a is less than |
14 |
+ * key2a; the actual difference doesn't matter. So let's use a simple |
15 |
+ * comparison. |
16 |
+ * <mbuck@debian.org> |
17 |
+ */ |
18 |
+ return (key1a < key2a) ? -1 : |
19 |
+ ((key1a > key2a) ? 1 : |
20 |
+ 0); |
21 |
+ |
22 |
} |
11 |
|
23 |
|
12 |
/* Variables used in paranoid enumerator (see ntfy_condition) */ |
24 |
pkg_private NTFY_CLIENT * |
13 |
@@ -60,6 +62,7 @@ ntfy_find_nclient(client_list, nclient, |
25 |
@@ -60,6 +73,7 @@ |
14 |
if (*client_latest && (*client_latest)->nclient == nclient) |
26 |
if (*client_latest && (*client_latest)->nclient == nclient) |
15 |
return (*client_latest); |
27 |
return (*client_latest); |
16 |
|
28 |
|
17 |
+#ifndef __FreeBSD__ |
29 |
+#ifdef _SEARCH_H_ |
18 |
if(( client_list == ndet_clients ) && ndet_clients ) { |
30 |
if(( client_list == ndet_clients ) && ndet_clients ) { |
19 |
dummy_client.nclient = nclient; |
31 |
dummy_client.nclient = nclient; |
20 |
/* Find client */ |
32 |
/* Find client */ |
21 |
@@ -73,7 +76,9 @@ ntfy_find_nclient(client_list, nclient, |
33 |
@@ -73,7 +87,9 @@ |
22 |
return (client); |
34 |
return (client); |
23 |
} |
35 |
} |
24 |
} |
36 |
} |
25 |
- |
37 |
- |
26 |
+#else |
38 |
+#else |
27 |
+ if(0); |
39 |
+ if(0); |
28 |
+#endif |
40 |
+#endif |
29 |
else |
41 |
else |
30 |
/* Search entire list */ |
42 |
/* Search entire list */ |
31 |
for (client = client_list; client; client = next) { |
43 |
for (client = client_list; client; client = next) { |
32 |
@@ -100,6 +105,7 @@ ntfy_new_nclient(client_list, nclient, c |
44 |
@@ -163,8 +179,10 @@ |
33 |
register NTFY_CLIENT *client; |
|
|
34 |
static NTFY_CLIENT *new_client; |
35 |
|
36 |
+#ifndef __FreeBSD__ |
37 |
if( client_list == &ndet_clients ) { |
38 |
if( new_client == NTFY_CLIENT_NULL ) { |
39 |
if ((new_client = ntfy_alloc_client()) == NTFY_CLIENT_NULL) |
40 |
@@ -119,7 +125,9 @@ ntfy_new_nclient(client_list, nclient, c |
41 |
else |
42 |
return client; |
43 |
} |
44 |
- |
45 |
+#else |
46 |
+ if(0); |
47 |
+#endif |
48 |
else if ((client = ntfy_find_nclient(*client_list, nclient, |
49 |
client_latest)) != NTFY_CLIENT_NULL) |
50 |
return client; |
51 |
@@ -163,8 +171,10 @@ ntfy_remove_client(client_list, client, |
52 |
ntfy_remove_condition(client, condition, who); |
45 |
ntfy_remove_condition(client, condition, who); |
53 |
} |
46 |
} |
54 |
/* Remove & free client from client_list */ |
47 |
/* Remove & free client from client_list */ |
55 |
+#ifndef __FreeBSD__ |
48 |
+#ifdef _SEARCH_H_ |
56 |
if( client_list == &ndet_clients ) |
49 |
if( client_list == &ndet_clients ) |
57 |
tdelete( client, ndet_root, ndet_compar ); |
50 |
tdelete( client, ndet_root, ndet_compar ); |
58 |
+#endif |
51 |
+#endif |