Removed functions moved to libkern: strcpy, strcmp, strlen, ffs, etc.

This commit is contained in:
jtc 1993-09-11 00:08:03 +00:00
parent 8173ef3c7f
commit 070f4a7f50
2 changed files with 2 additions and 118 deletions

View File

@ -1 +1 @@
revision 1.5 intentionally removed
revision 1.6 intentionally removed

View File

@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* from: @(#)subr_xxx.c 7.10 (Berkeley) 4/20/91
* $Id: subr_xxx.c,v 1.5 1993/06/27 06:01:54 andrew Exp $
* $Id: subr_xxx.c,v 1.6 1993/09/11 00:08:06 jtc Exp $
*/
/*
@ -113,119 +113,3 @@ voidop()
{
}
/*
* Definitions of various trivial functions;
* usually expanded inline rather than being defined here.
*/
#ifdef NEED_MINMAX
int
imin(a, b)
int a, b;
{
return (a < b ? a : b);
}
int
imax(a, b)
int a, b;
{
return (a > b ? a : b);
}
unsigned int
min(a, b)
unsigned int a, b;
{
return (a < b ? a : b);
}
unsigned int
max(a, b)
unsigned int a, b;
{
return (a > b ? a : b);
}
long
lmin(a, b)
long a, b;
{
return (a < b ? a : b);
}
long
lmax(a, b)
long a, b;
{
return (a > b ? a : b);
}
unsigned long
ulmin(a, b)
unsigned long a, b;
{
return (a < b ? a : b);
}
unsigned long
ulmax(a, b)
unsigned long a, b;
{
return (a > b ? a : b);
}
#endif /* NEED_MINMAX */
#ifdef NEED_FFS
int
ffs(mask)
register long mask;
{
register int bit;
if (!mask)
return(0);
for (bit = 1;; ++bit) {
if (mask&0x01)
return(bit);
mask >>= 1;
}
return 0;
}
#endif /* NEED_FFS */
#ifdef NEED_BCMP
int
bcmp(v1, v2, len)
void *v1, *v2;
register unsigned len;
{
register u_char *s1 = v1, *s2 = v2;
while (len--)
if (*s1++ != *s2++)
return (1);
return (0);
}
#endif /* NEED_BCMP */
#ifdef NEED_STRLEN
size_t
strlen(s1)
register const char *s1;
{
register size_t len;
for (len = 0; *s1++ != '\0'; len++)
;
return (len);
}
#endif /* NEED_STRLEN */