diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-04-04 09:36:57 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-04-04 14:46:23 +0200 |
commit | de8a76da2f374792594ce03a203b3f30e4889f6f (patch) | |
tree | 12b5e1e59358005c3c522955c08aee4795e4829c /freebsd/sys/libkern | |
parent | Enable bridging by default (diff) | |
download | rtems-libbsd-de8a76da2f374792594ce03a203b3f30e4889f6f.tar.bz2 |
Update to FreeBSD head 2017-04-04
Git mirror commit 642b174daddbd0efd9bb5f242c43f4ab4db6869f.
Diffstat (limited to 'freebsd/sys/libkern')
-rw-r--r-- | freebsd/sys/libkern/bcd.c | 4 | ||||
-rw-r--r-- | freebsd/sys/libkern/inet_ntoa.c | 14 | ||||
-rw-r--r-- | freebsd/sys/libkern/random.c | 4 |
3 files changed, 6 insertions, 16 deletions
diff --git a/freebsd/sys/libkern/bcd.c b/freebsd/sys/libkern/bcd.c index df4abad2..38e7d0c1 100644 --- a/freebsd/sys/libkern/bcd.c +++ b/freebsd/sys/libkern/bcd.c @@ -8,6 +8,7 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); +#include <rtems/bsd/sys/param.h> #include <sys/libkern.h> u_char const bcd2bin_data[] = { @@ -22,6 +23,7 @@ u_char const bcd2bin_data[] = { 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 0, 0, 0, 0, 0, 0, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 }; +CTASSERT(nitems(bcd2bin_data) == LIBKERN_LEN_BCD2BIN); u_char const bin2bcd_data[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, @@ -35,6 +37,8 @@ u_char const bin2bcd_data[] = { 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99 }; +CTASSERT(nitems(bin2bcd_data) == LIBKERN_LEN_BIN2BCD); /* This is actually used with radix [2..36] */ char const hex2ascii_data[] = "0123456789abcdefghijklmnopqrstuvwxyz"; +CTASSERT(nitems(hex2ascii_data) == LIBKERN_LEN_HEX2ASCII + 1); diff --git a/freebsd/sys/libkern/inet_ntoa.c b/freebsd/sys/libkern/inet_ntoa.c index 1d36ab29..1aa48077 100644 --- a/freebsd/sys/libkern/inet_ntoa.c +++ b/freebsd/sys/libkern/inet_ntoa.c @@ -38,20 +38,6 @@ __FBSDID("$FreeBSD$"); #include <netinet/in.h> char * -inet_ntoa(struct in_addr ina) -{ - static char buf[4*sizeof "123"]; - unsigned char *ucp = (unsigned char *)&ina; - - sprintf(buf, "%d.%d.%d.%d", - ucp[0] & 0xff, - ucp[1] & 0xff, - ucp[2] & 0xff, - ucp[3] & 0xff); - return buf; -} - -char * inet_ntoa_r(struct in_addr ina, char *buf) { unsigned char *ucp = (unsigned char *)&ina; diff --git a/freebsd/sys/libkern/random.c b/freebsd/sys/libkern/random.c index 5b780670..efa9a70a 100644 --- a/freebsd/sys/libkern/random.c +++ b/freebsd/sys/libkern/random.c @@ -12,7 +12,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -59,7 +59,7 @@ srandom(seed) u_long random() { - register long x, hi, lo, t; + long x, hi, lo, t; /* * Compute x[n + 1] = (7^5 * x[n]) mod (2^31 - 1). |