Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-kde
Path: blob/main/japanese/FreeWnn-server/files/patch-Wnn-etc-bcopy.c
16461 views
1
Index: Wnn/etc/bcopy.c
2
===================================================================
3
RCS file: /home/cvs/private/hrs/freewnn/Wnn/etc/bcopy.c,v
4
retrieving revision 1.1.1.1
5
retrieving revision 1.2
6
diff -u -p -r1.1.1.1 -r1.2
7
--- Wnn/etc/bcopy.c 20 Dec 2008 07:13:30 -0000 1.1.1.1
8
+++ Wnn/etc/bcopy.c 20 Dec 2008 15:22:40 -0000 1.2
9
@@ -38,47 +38,43 @@
10
11
#ifndef HAVE_BCOPY
12
void
13
-bcopy (b1, b2, length)
14
- unsigned char *b1, *b2;
15
- int length;
16
+bcopy(unsigned char *b1,
17
+ unsigned char *b2,
18
+ int length)
19
{
20
- if (length <= 0)
21
- return;
22
- if (b1 < b2 && b1 + length > b2)
23
- {
24
- b2 += length;
25
- b1 += length;
26
- while (length--)
27
- {
28
- *--b2 = *--b1;
29
- }
30
- }
31
- else
32
- {
33
- memcpy (b2, b1, length);
34
- }
35
+ if (length <= 0)
36
+ return;
37
+
38
+ if (b1 < b2 && b1 + length > b2) {
39
+ b2 += length;
40
+ b1 += length;
41
+
42
+ while (length--)
43
+ *--b2 = *--b1;
44
+ } else {
45
+ memcpy (b2, b1, length);
46
+ }
47
}
48
#endif /* !HAVE_BCOPY */
49
50
#ifndef HAVE_BZERO
51
void
52
-bzero (b, length)
53
- unsigned char *b;
54
- int length;
55
+bzero(unsigned char *b,
56
+ int length)
57
{
58
- memset (b, 0, length);
59
+ memset (b, 0, length);
60
}
61
#endif /* !HAVE_BZERO */
62
63
#ifndef HAVE_BCMP
64
int
65
-bcmp (b1, b2, length)
66
- unsigned char *b1;
67
- unsigned char *b2;
68
- int length;
69
+bcmp(unsigned char *b1,
70
+ unsigned *b2,
71
+ int length)
72
{
73
- if (length == 0)
74
- return 0;
75
- return memcmp (b1, b2, length);
76
+ if (length == 0)
77
+ return 0;
78
+
79
+ return memcmp(b1, b2, length);
80
}
81
#endif /* !HAVE_BCMP */
82
83