Path: blob/main/japanese/FreeWnn-server/files/patch-Wnn-etc-bcopy.c
16461 views
Index: Wnn/etc/bcopy.c1===================================================================2RCS file: /home/cvs/private/hrs/freewnn/Wnn/etc/bcopy.c,v3retrieving revision 1.1.1.14retrieving revision 1.25diff -u -p -r1.1.1.1 -r1.26--- Wnn/etc/bcopy.c 20 Dec 2008 07:13:30 -0000 1.1.1.17+++ Wnn/etc/bcopy.c 20 Dec 2008 15:22:40 -0000 1.28@@ -38,47 +38,43 @@910#ifndef HAVE_BCOPY11void12-bcopy (b1, b2, length)13- unsigned char *b1, *b2;14- int length;15+bcopy(unsigned char *b1,16+ unsigned char *b2,17+ int length)18{19- if (length <= 0)20- return;21- if (b1 < b2 && b1 + length > b2)22- {23- b2 += length;24- b1 += length;25- while (length--)26- {27- *--b2 = *--b1;28- }29- }30- else31- {32- memcpy (b2, b1, length);33- }34+ if (length <= 0)35+ return;36+37+ if (b1 < b2 && b1 + length > b2) {38+ b2 += length;39+ b1 += length;40+41+ while (length--)42+ *--b2 = *--b1;43+ } else {44+ memcpy (b2, b1, length);45+ }46}47#endif /* !HAVE_BCOPY */4849#ifndef HAVE_BZERO50void51-bzero (b, length)52- unsigned char *b;53- int length;54+bzero(unsigned char *b,55+ int length)56{57- memset (b, 0, length);58+ memset (b, 0, length);59}60#endif /* !HAVE_BZERO */6162#ifndef HAVE_BCMP63int64-bcmp (b1, b2, length)65- unsigned char *b1;66- unsigned char *b2;67- int length;68+bcmp(unsigned char *b1,69+ unsigned *b2,70+ int length)71{72- if (length == 0)73- return 0;74- return memcmp (b1, b2, length);75+ if (length == 0)76+ return 0;77+78+ return memcmp(b1, b2, length);79}80#endif /* !HAVE_BCMP */818283