From f66a2b1783ea50a5313cd66d7a5ffa11321971f8 Mon Sep 17 00:00:00 2001 From: emax Date: Sat, 7 Oct 2006 23:41:22 +0000 Subject: [PATCH] MFC: Pacify new GCC4 warnings Submitted by: kan Approved by: re (kensmith) --- usr.sbin/bluetooth/hccontrol/hccontrol.h | 30 ++++++++++---------- usr.sbin/bluetooth/hccontrol/link_control.c | 2 +- usr.sbin/bluetooth/hccontrol/util.c | 30 ++++++++++---------- usr.sbin/bluetooth/hcsecd/hcsecd.c | 7 +++-- usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.c | 4 +-- usr.sbin/bluetooth/sdpd/server.c | 6 ++-- 6 files changed, 41 insertions(+), 38 deletions(-) diff --git a/usr.sbin/bluetooth/hccontrol/hccontrol.h b/usr.sbin/bluetooth/hccontrol/hccontrol.h index d471982ef69..cd56ebfb7bc 100644 --- a/usr.sbin/bluetooth/hccontrol/hccontrol.h +++ b/usr.sbin/bluetooth/hccontrol/hccontrol.h @@ -59,21 +59,21 @@ int hci_simple_request (int, int, char *, int *); int hci_send (int, char const *, int); int hci_recv (int, char *, int *); -char const * const hci_link2str (int); -char const * const hci_pin2str (int); -char const * const hci_scan2str (int); -char const * const hci_encrypt2str (int, int); -char const * const hci_coding2str (int); -char const * const hci_vdata2str (int); -char const * const hci_hmode2str (int, char *, int); -char const * const hci_ver2str (int); -char const * const hci_lmpver2str (int); -char const * const hci_manufacturer2str(int); -char const * const hci_features2str (uint8_t *, char *, int); -char const * const hci_cc2str (int); -char const * const hci_con_state2str (int); -char const * const hci_status2str (int); -char const * const hci_bdaddr2str (bdaddr_t const *); +char const * hci_link2str (int); +char const * hci_pin2str (int); +char const * hci_scan2str (int); +char const * hci_encrypt2str (int, int); +char const * hci_coding2str (int); +char const * hci_vdata2str (int); +char const * hci_hmode2str (int, char *, int); +char const * hci_ver2str (int); +char const * hci_lmpver2str (int); +char const * hci_manufacturer2str(int); +char const * hci_features2str (uint8_t *, char *, int); +char const * hci_cc2str (int); +char const * hci_con_state2str (int); +char const * hci_status2str (int); +char const * hci_bdaddr2str (bdaddr_t const *); #endif /* _HCCONTROL_H_ */ diff --git a/usr.sbin/bluetooth/hccontrol/link_control.c b/usr.sbin/bluetooth/hccontrol/link_control.c index 6123e447987..ea880cd091e 100644 --- a/usr.sbin/bluetooth/hccontrol/link_control.c +++ b/usr.sbin/bluetooth/hccontrol/link_control.c @@ -42,7 +42,7 @@ static int hci_inquiry(int s, int argc, char **argv) { int n0, n1, n2, timo; - uint8_t b[512]; + char b[512]; ng_hci_inquiry_cp cp; ng_hci_event_pkt_t *e = (ng_hci_event_pkt_t *) b; diff --git a/usr.sbin/bluetooth/hccontrol/util.c b/usr.sbin/bluetooth/hccontrol/util.c index 380cc3de58a..4bb5000c087 100644 --- a/usr.sbin/bluetooth/hccontrol/util.c +++ b/usr.sbin/bluetooth/hccontrol/util.c @@ -36,7 +36,7 @@ #define SIZE(x) (sizeof((x))/sizeof((x)[0])) -char const * const +char const * hci_link2str(int link_type) { static char const * const t[] = { @@ -47,7 +47,7 @@ hci_link2str(int link_type) return (link_type >= SIZE(t)? "?" : t[link_type]); } /* hci_link2str */ -char const * const +char const * hci_pin2str(int type) { static char const * const t[] = { @@ -58,7 +58,7 @@ hci_pin2str(int type) return (type >= SIZE(t)? "?" : t[type]); } /* hci_pin2str */ -char const * const +char const * hci_scan2str(int scan) { static char const * const t[] = { @@ -71,7 +71,7 @@ hci_scan2str(int scan) return (scan >= SIZE(t)? "?" : t[scan]); } /* hci_scan2str */ -char const * const +char const * hci_encrypt2str(int encrypt, int brief) { static char const * const t[] = { @@ -92,7 +92,7 @@ hci_encrypt2str(int encrypt, int brief) return (encrypt >= SIZE(t)? "?" : t[encrypt]); } /* hci_encrypt2str */ -char const * const +char const * hci_coding2str(int coding) { static char const * const t[] = { @@ -105,7 +105,7 @@ hci_coding2str(int coding) return (coding >= SIZE(t)? "?" : t[coding]); } /* hci_coding2str */ -char const * const +char const * hci_vdata2str(int data) { static char const * const t[] = { @@ -118,7 +118,7 @@ hci_vdata2str(int data) return (data >= SIZE(t)? "?" : t[data]); } /* hci_vdata2str */ -char const * const +char const * hci_hmode2str(int mode, char *buffer, int size) { static char const * const t[] = { @@ -144,7 +144,7 @@ hci_hmode2str(int mode, char *buffer, int size) return (buffer); } /* hci_hmode2str */ -char const * const +char const * hci_ver2str(int ver) { static char const * const t[] = { @@ -157,7 +157,7 @@ hci_ver2str(int ver) return (ver >= SIZE(t)? "?" : t[ver]); } /* hci_ver2str */ -char const * const +char const * hci_lmpver2str(int ver) { static char const * const t[] = { @@ -170,7 +170,7 @@ hci_lmpver2str(int ver) return (ver >= SIZE(t)? "?" : t[ver]); } /* hci_lmpver2str */ -char const * const +char const * hci_manufacturer2str(int m) { static char const * const t[] = { @@ -244,7 +244,7 @@ hci_manufacturer2str(int m) return (m >= SIZE(t)? "?" : t[m]); } /* hci_manufacturer2str */ -char const * const +char const * hci_features2str(uint8_t *features, char *buffer, int size) { static char const * const t[][8] = { @@ -307,7 +307,7 @@ hci_features2str(uint8_t *features, char *buffer, int size) return (buffer); } /* hci_features2str */ -char const * const +char const * hci_cc2str(int cc) { static char const * const t[] = { @@ -318,7 +318,7 @@ hci_cc2str(int cc) return (cc >= SIZE(t)? "?" : t[cc]); } /* hci_cc2str */ -char const * const +char const * hci_con_state2str(int state) { static char const * const t[] = { @@ -331,7 +331,7 @@ hci_con_state2str(int state) return (state >= SIZE(t)? "UNKNOWN" : t[state]); } /* hci_con_state2str */ -char const * const +char const * hci_status2str(int status) { static char const * const t[] = { @@ -382,7 +382,7 @@ hci_status2str(int status) return (status >= SIZE(t)? "Unknown error" : t[status]); } /* hci_status2str */ -char const * const +char const * hci_bdaddr2str(bdaddr_t const *ba) { extern int numeric_bdaddr; diff --git a/usr.sbin/bluetooth/hcsecd/hcsecd.c b/usr.sbin/bluetooth/hcsecd/hcsecd.c index a1b72a3b34a..de7a77581b1 100644 --- a/usr.sbin/bluetooth/hcsecd/hcsecd.c +++ b/usr.sbin/bluetooth/hcsecd/hcsecd.c @@ -65,7 +65,8 @@ static void usage int main(int argc, char *argv[]) { - int n, detach, sock, size; + int n, detach, sock; + socklen_t size; struct sigaction sa; struct sockaddr_hci addr; struct ng_btsocket_hci_raw_filter filter; @@ -281,8 +282,8 @@ send_pin_code_reply(int sock, struct sockaddr_hci *addr, cp = (ng_hci_pin_code_rep_cp *)(cmd + 1); memcpy(&cp->bdaddr, bdaddr, sizeof(cp->bdaddr)); - strncpy(cp->pin, pin, sizeof(cp->pin)); - cp->pin_size = strlen(cp->pin); + strncpy((char *) cp->pin, pin, sizeof(cp->pin)); + cp->pin_size = strlen((char const *) cp->pin); syslog(LOG_DEBUG, "Sending PIN_Code_Reply to '%s' " \ "for remote bdaddr %s", diff --git a/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.c b/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.c index 79c48c1fd1b..7a879bbfb39 100644 --- a/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.c +++ b/usr.sbin/bluetooth/rfcomm_pppd/rfcomm_pppd.c @@ -301,8 +301,8 @@ main(int argc, char *argv[]) } for (done = 0; !done; ) { - int len = sizeof(sock_addr); - int s1 = accept(s, (struct sockaddr *) &sock_addr, &len); + socklen_t len = sizeof(sock_addr); + int s1 = accept(s, (struct sockaddr *) &sock_addr, &len); if (s1 < 0) { syslog(LOG_ERR, "Could not accept connection " \ diff --git a/usr.sbin/bluetooth/sdpd/server.c b/usr.sbin/bluetooth/sdpd/server.c index 72f529a62d4..bef7e3ee8d1 100644 --- a/usr.sbin/bluetooth/sdpd/server.c +++ b/usr.sbin/bluetooth/sdpd/server.c @@ -66,7 +66,8 @@ server_init(server_p srv, char const *control) { struct sockaddr_un un; struct sockaddr_l2cap l2; - int32_t unsock, l2sock, size; + int32_t unsock, l2sock; + socklen_t size; uint16_t imtu; assert(srv != NULL); @@ -289,8 +290,9 @@ static void server_accept_client(server_p srv, int32_t fd) { uint8_t *rsp = NULL; - int32_t cfd, size, priv; + int32_t cfd, priv; uint16_t omtu; + socklen_t size; do { cfd = accept(fd, NULL, NULL); -- 2.45.2