freebsd-skq/usr.sbin/rtadvd
dim abfc69102b Fix the following -Werror warnings from clang 3.5.0, while building
usr.sbin/rtadvd:

usr.sbin/rtadvd/rtadvd.c:1291:7: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
                    abs(preferred_time - pfx->pfx_pltimeexpire) > rai->rai_clockskew) {
                    ^
usr.sbin/rtadvd/rtadvd.c:1291:7: note: remove the call to 'abs' since unsigned values cannot be negative
                    abs(preferred_time - pfx->pfx_pltimeexpire) > rai->rai_clockskew) {
                    ^~~
usr.sbin/rtadvd/rtadvd.c:1324:7: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
                    abs(valid_time - pfx->pfx_vltimeexpire) > rai->rai_clockskew) {
                    ^
usr.sbin/rtadvd/rtadvd.c:1324:7: note: remove the call to 'abs' since unsigned values cannot be negative
                    abs(valid_time - pfx->pfx_vltimeexpire) > rai->rai_clockskew) {
                    ^~~
2 errors generated.

These warnings occur because both preferred_time and pfx_pltimeexpire
are uint32_t's, so the subtraction expression is also unsigned, and
calling abs() is a no-op.

However, the intention was to look at the absolute difference between
the two unsigned quantities.  Introduce a small static function to
clarify what we're doing, and call that instead.

Reviewed by:	hrs
MFC after:	3 days
Differential Revision: https://reviews.freebsd.org/D1197
2014-11-22 23:04:33 +00:00
..
advcap.c Fix off-by-one. 2014-10-11 23:08:00 +00:00
advcap.h
config.c Check buffer length more strictly. 2014-10-11 23:24:09 +00:00
config.h
control_client.c
control_client.h
control_server.c
control_server.h
control.c
control.h
if.c Ignore if the interface is not IPv6-capable. 2013-09-02 20:44:19 +00:00
if.h
Makefile
pathnames.h
rrenum.c - Use time_uptime instead of time_second in data structures for 2013-08-05 20:13:02 +00:00
rrenum.h
rtadvd.8 - Implement and use usage(). 2013-02-25 16:47:09 +00:00
rtadvd.c Fix the following -Werror warnings from clang 3.5.0, while building 2014-11-22 23:04:33 +00:00
rtadvd.conf
rtadvd.conf.5 mdoc: correct .Bd/.Bl arguments. 2012-03-26 21:22:53 +00:00
rtadvd.h - Use time_uptime instead of time_second in data structures for 2013-08-05 20:13:02 +00:00
timer_subr.c - Use time_uptime instead of time_second in data structures for 2013-08-05 20:13:02 +00:00
timer_subr.h - Use time_uptime instead of time_second in data structures for 2013-08-05 20:13:02 +00:00
timer.c Fix build on arm and mips. 2013-08-06 15:49:18 +00:00
timer.h - Use time_uptime instead of time_second in data structures for 2013-08-05 20:13:02 +00:00