freebsd-skq/usr.sbin/rtadvd
dim 10bfcc72ff MFC r274898:
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
Differential Revision: https://reviews.freebsd.org/D1197
2014-11-25 13:12:45 +00:00
..
advcap.c Fix a bug that prevents tc=xxx from working. 2011-06-07 15:40:17 +00:00
advcap.h
config.c Fix a crash when reloading the configuration file. 2013-08-27 11:50:33 +00:00
config.h - Improve interface list handling. The rtadvd(8) now supports dynamically- 2011-07-17 19:24:54 +00:00
control_client.c - Fix a bug that can lead to displaying an incorrect value. (r224210) 2011-09-12 23:52:55 +00:00
control_client.h - Fix a bug that can lead to displaying an incorrect value. (r224210) 2011-09-12 23:52:55 +00:00
control_server.c - Fix a bug that can lead to displaying an incorrect value. (r224210) 2011-09-12 23:52:55 +00:00
control_server.h - Fix a bug that can lead to displaying an incorrect value. (r224210) 2011-09-12 23:52:55 +00:00
control.c - Fix a bug that can lead to displaying an incorrect value. (r224210) 2011-09-12 23:52:55 +00:00
control.h - Fix a bug that can lead to displaying an incorrect value. (r224210) 2011-09-12 23:52:55 +00:00
if.c Ignore if the interface is not IPv6-capable. 2013-09-02 20:44:19 +00:00
if.h - Improve interface list handling. The rtadvd(8) now supports dynamically- 2011-07-17 19:24:54 +00:00
Makefile - Improve interface list handling. The rtadvd(8) now supports dynamically- 2011-07-17 19:24:54 +00:00
pathnames.h - Refactoring the interface list. It now supports dynamically 2011-07-14 10:09:58 +00:00
rrenum.c - Use time_uptime instead of time_second in data structures for 2013-08-05 20:13:02 +00:00
rrenum.h - Implement RDNSS and DNSSL options (RFC 6106, IPv6 Router Advertisement 2011-06-06 03:06:43 +00:00
rtadvd.8 - Implement and use usage(). 2013-02-25 16:47:09 +00:00
rtadvd.c MFC r274898: 2014-11-25 13:12:45 +00:00
rtadvd.conf - Implement RDNSS and DNSSL options (RFC 6106, IPv6 Router Advertisement 2011-06-06 03:06:43 +00:00
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