xref: /csrg-svn/lib/libc/string/bcmp.c (revision 46613)
130423Smckusick /*
230423Smckusick  * Copyright (c) 1987 Regents of the University of California.
335110Sbostic  * All rights reserved.
435110Sbostic  *
542635Sbostic  * %sccs.include.redist.c%
630423Smckusick  */
730423Smckusick 
830423Smckusick #if defined(LIBC_SCCS) && !defined(lint)
9*46613Sbostic static char sccsid[] = "@(#)bcmp.c	5.6 (Berkeley) 02/24/91";
1035110Sbostic #endif /* LIBC_SCCS and not lint */
1130423Smckusick 
1242144Sbostic #include <string.h>
1342144Sbostic 
1430423Smckusick /*
1530423Smckusick  * bcmp -- vax cmpc3 instruction
1630423Smckusick  */
1730423Smckusick bcmp(b1, b2, length)
18*46613Sbostic 	const void *b1, *b2;
1942144Sbostic 	register size_t length;
2030423Smckusick {
21*46613Sbostic 	register char *p1, *p2;
2230423Smckusick 
2330423Smckusick 	if (length == 0)
2442144Sbostic 		return(0);
25*46613Sbostic 	p1 = (char *)b1;
26*46613Sbostic 	p2 = (char *)b2;
2730423Smckusick 	do
28*46613Sbostic 		if (*p1++ != *p2++)
2930423Smckusick 			break;
3030423Smckusick 	while (--length);
3130423Smckusick 	return(length);
3230423Smckusick }
33