History log of /freebsd-10-stable/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c
Revision Date Author Comments
# 310900 31-Dec-2016 ngie

MFstable/11 r310899:

MFC r310666,r310675:

r310666:

style(9) fixes

- Clean up trailing whitespace
- Fix variable type alignment in storage_OS_get_swap(..)

r310675:

Fix the build by moving the initializers for len/nswapdev down below the
declarations

Pointyhat to: ngie


# 275039 25-Nov-2014 dim

MFC r274900:

Fix the following -Werror warnings from clang 3.5.0, while building
bsnmpd's snmp_hostres module:

usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:204:20: error: absolute value function 'abs' given an argument of type 'const long' but has parameter of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value]
str[9] = (u_char)(abs(tm->tm_gmtoff) / 3600);
^
usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:204:20: note: use function 'labs' instead
str[9] = (u_char)(abs(tm->tm_gmtoff) / 3600);
^~~
labs
usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:205:22: error: absolute value function 'abs' given an argument of type 'const long' but has parameter of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value]
str[10] = (u_char)((abs(tm->tm_gmtoff) % 3600) / 60);
^
usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:205:22: note: use function 'labs' instead
str[10] = (u_char)((abs(tm->tm_gmtoff) % 3600) / 60);
^~~
labs

Since tm::tm_gmtoff is a long, use labs(3) instead.


# 275039 25-Nov-2014 dim

MFC r274900:

Fix the following -Werror warnings from clang 3.5.0, while building
bsnmpd's snmp_hostres module:

usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:204:20: error: absolute value function 'abs' given an argument of type 'const long' but has parameter of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value]
str[9] = (u_char)(abs(tm->tm_gmtoff) / 3600);
^
usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:204:20: note: use function 'labs' instead
str[9] = (u_char)(abs(tm->tm_gmtoff) / 3600);
^~~
labs
usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:205:22: error: absolute value function 'abs' given an argument of type 'const long' but has parameter of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value]
str[10] = (u_char)((abs(tm->tm_gmtoff) % 3600) / 60);
^
usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:205:22: note: use function 'labs' instead
str[10] = (u_char)((abs(tm->tm_gmtoff) % 3600) / 60);
^~~
labs

Since tm::tm_gmtoff is a long, use labs(3) instead.