From 9c0b5859e6cc4b7a0e925fde8665990281b265d3 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 29 Jan 2009 17:58:28 +0100 Subject: Fix mostly every warning caused by -Wsign-compare --- acinclude.m4 | 1 - audio/Makefile.am | 8 ++++---- audio/gstsbcenc.c | 2 +- compat/bnep.c | 12 ++++++------ compat/hidd.c | 4 ++-- compat/msdun.c | 3 ++- compat/sdp.c | 2 +- cups/hcrp.c | 3 ++- input/device.c | 2 +- input/fakehid.c | 3 ++- network/common.c | 5 +++-- serial/proxy.c | 3 ++- serial/storage.c | 3 ++- src/sdpd-request.c | 13 +++++++------ src/sdpd-service.c | 2 +- test/sdptest.c | 2 +- tools/avctrl.c | 2 +- tools/avinfo.c | 4 ++-- tools/bccmd.c | 9 +++++---- tools/ciptool.c | 2 +- tools/dfubabel.c | 2 +- tools/dfutool.c | 15 +++++++++------ tools/hciattach_tialt.c | 2 +- tools/hciconfig.c | 7 ++++--- tools/hcitool.c | 2 +- tools/hid2hci.c | 9 +++++---- tools/sdptool.c | 11 ++++++----- 27 files changed, 73 insertions(+), 60 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 372833e8..eb7cdeb9 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -16,7 +16,6 @@ AC_DEFUN([COMPILER_FLAGS], [ fi if (test "$USE_MAINTAINER_MODE" = "yes"); then CFLAGS+=" -Werror -Wextra" - CFLAGS+=" -Wno-sign-compare" CFLAGS+=" -Wno-unused-parameter" CFLAGS+=" -Wno-missing-field-initializers" CFLAGS+=" -Wdeclaration-after-statement" diff --git a/audio/Makefile.am b/audio/Makefile.am index 43030b8f..b102a1e8 100644 --- a/audio/Makefile.am +++ b/audio/Makefile.am @@ -27,12 +27,12 @@ alsa_LTLIBRARIES = libasound_module_pcm_bluetooth.la libasound_module_ctl_blueto libasound_module_pcm_bluetooth_la_SOURCES = pcm_bluetooth.c rtp.h ipc.h ipc.c libasound_module_pcm_bluetooth_la_LDFLAGS = -module -avoid-version -export-symbols-regex [_]*snd_pcm_.* libasound_module_pcm_bluetooth_la_LIBADD = @SBC_LIBS@ @BLUEZ_LIBS@ @ALSA_LIBS@ -libasound_module_pcm_bluetooth_la_CFLAGS = @ALSA_CFLAGS@ @BLUEZ_CFLAGS@ @SBC_CFLAGS@ +libasound_module_pcm_bluetooth_la_CFLAGS = @ALSA_CFLAGS@ @BLUEZ_CFLAGS@ @SBC_CFLAGS@ -Wno-sign-compare libasound_module_ctl_bluetooth_la_SOURCES = ctl_bluetooth.c rtp.h ipc.h ipc.c libasound_module_ctl_bluetooth_la_LDFLAGS = -module -avoid-version -export-symbols-regex [_]*snd_ctl_.* libasound_module_ctl_bluetooth_la_LIBADD = @BLUEZ_LIBS@ @ALSA_LIBS@ -libasound_module_ctl_bluetooth_la_CFLAGS = @ALSA_CFLAGS@ @BLUEZ_CFLAGS@ +libasound_module_ctl_bluetooth_la_CFLAGS = @ALSA_CFLAGS@ @BLUEZ_CFLAGS@ -Wno-sign-compare endif if GSTREAMER @@ -51,11 +51,11 @@ libgstbluetooth_la_SOURCES = gstbluetooth.c \ rtp.h ipc.h ipc.c libgstbluetooth_la_LDFLAGS = -module -avoid-version -export-symbols-regex gst_plugin_desc libgstbluetooth_la_LIBADD = @SBC_LIBS@ @BLUEZ_LIBS@ @GSTREAMER_LIBS@ -lgstaudio-0.10 -lgstrtp-0.10 -libgstbluetooth_la_CFLAGS = @GSTREAMER_CFLAGS@ @BLUEZ_CFLAGS@ @SBC_CFLAGS@ +libgstbluetooth_la_CFLAGS = @GSTREAMER_CFLAGS@ @BLUEZ_CFLAGS@ @SBC_CFLAGS@ -Wno-sign-compare endif endif -AM_CFLAGS = @BLUEZ_CFLAGS@ @DBUS_CFLAGS@ @GLIB_CFLAGS@ @GDBUS_CFLAGS@ +AM_CFLAGS = @BLUEZ_CFLAGS@ @DBUS_CFLAGS@ @GLIB_CFLAGS@ @GDBUS_CFLAGS@ -Wno-sign-compare CLEANFILES = $(BUILT_SOURCES) diff --git a/audio/gstsbcenc.c b/audio/gstsbcenc.c index 789bf78f..0ecf39c8 100644 --- a/audio/gstsbcenc.c +++ b/audio/gstsbcenc.c @@ -371,7 +371,7 @@ static GstFlowReturn sbc_enc_chain(GstPad *pad, GstBuffer *buffer) gst_adapter_push(adapter, buffer); while (gst_adapter_available(adapter) >= enc->codesize && - res == GST_FLOW_OK) { + res == GST_FLOW_OK) { GstBuffer *output; GstCaps *caps; const guint8 *data; diff --git a/compat/bnep.c b/compat/bnep.c index f8d2b291..e9742c7a 100644 --- a/compat/bnep.c +++ b/compat/bnep.c @@ -128,7 +128,7 @@ int bnep_show_connections(void) { struct bnep_connlist_req req; struct bnep_conninfo ci[48]; - int i; + unsigned int i; req.cnum = 48; req.ci = ci; @@ -137,7 +137,7 @@ int bnep_show_connections(void) return -1; } - for (i=0; i < req.cnum; i++) { + for (i = 0; i < req.cnum; i++) { printf("%s %s %s\n", ci[i].device, batostr((bdaddr_t *) ci[i].dst), bnep_svc2str(ci[i].role)); @@ -162,7 +162,7 @@ int bnep_kill_all_connections(void) { struct bnep_connlist_req req; struct bnep_conninfo ci[48]; - int i; + unsigned int i; req.cnum = 48; req.ci = ci; @@ -171,7 +171,7 @@ int bnep_kill_all_connections(void) return -1; } - for (i=0; i < req.cnum; i++) { + for (i = 0; i < req.cnum; i++) { struct bnep_conndel_req req; memcpy(req.dst, ci[i].dst, ETH_ALEN); req.flags = 0; @@ -227,7 +227,7 @@ int bnep_accept_connection(int sk, uint16_t role, char *dev) errno = EPROTO; - if (r < sizeof(*req)) + if (r < (int) sizeof(*req)) return -1; req = (void *) pkt; @@ -292,7 +292,7 @@ receive: errno = EPROTO; - if (r < sizeof(*rsp)) + if (r < (int) sizeof(*rsp)) return -1; rsp = (void *) pkt; diff --git a/compat/hidd.c b/compat/hidd.c index a6f67410..212c0926 100644 --- a/compat/hidd.c +++ b/compat/hidd.c @@ -425,7 +425,7 @@ static void do_show(int ctl) struct hidp_connlist_req req; struct hidp_conninfo ci[16]; char addr[18]; - int i; + unsigned int i; req.cnum = 16; req.ci = ci; @@ -598,7 +598,7 @@ static void do_kill(int ctl, bdaddr_t *bdaddr, uint32_t flags) struct hidp_conndel_req req; struct hidp_connlist_req cl; struct hidp_conninfo ci[16]; - int i; + unsigned int i; if (!bacmp(bdaddr, BDADDR_ALL)) { cl.cnum = 16; diff --git a/compat/msdun.c b/compat/msdun.c index fab4c586..1759ef66 100644 --- a/compat/msdun.c +++ b/compat/msdun.c @@ -56,7 +56,8 @@ static void sig_alarm(int sig) static int w4_str(int fd, char *str) { char buf[40]; - int r, len = 0; + unsigned len = 0; + int r; while (1) { r = read(fd, buf + len, sizeof(buf) - len - 1); diff --git a/compat/sdp.c b/compat/sdp.c index 941895d4..bb188f6a 100644 --- a/compat/sdp.c +++ b/compat/sdp.c @@ -71,7 +71,7 @@ static void epox_endian_quirk(unsigned char *data, int size) */ unsigned char pattern[] = { 0x05, 0x07, 0x19, 0x00, 0x2a, 0x00, 0xff, 0x15, 0x00, 0x26, 0x00, 0xff }; - int i; + unsigned int i; if (!data) return; diff --git a/cups/hcrp.c b/cups/hcrp.c index 6739b3d4..155236d6 100644 --- a/cups/hcrp.c +++ b/cups/hcrp.c @@ -177,7 +177,8 @@ int hcrp_print(bdaddr_t *src, bdaddr_t *dst, unsigned short ctrl_psm, unsigned s struct l2cap_options opts; socklen_t size; unsigned char buf[2048]; - int i, ctrl_sk, data_sk, mtu, count, len, timeout = 0; + int i, ctrl_sk, data_sk, count, len, timeout = 0; + unsigned int mtu; uint8_t status; uint16_t tid = 0; uint32_t tmp, credit = 0; diff --git a/input/device.c b/input/device.c index 3f9e0691..a2a3c38d 100644 --- a/input/device.c +++ b/input/device.c @@ -472,7 +472,7 @@ static void epox_endian_quirk(unsigned char *data, int size) */ unsigned char pattern[] = { 0x05, 0x07, 0x19, 0x00, 0x2a, 0x00, 0xff, 0x15, 0x00, 0x26, 0x00, 0xff }; - int i; + unsigned int i; if (!data) return; diff --git a/input/fakehid.c b/input/fakehid.c index 05bbea1d..900399d2 100644 --- a/input/fakehid.c +++ b/input/fakehid.c @@ -147,7 +147,8 @@ static int ps3remote_decode(char *buff, int size, unsigned int *value) { static unsigned int lastkey = 0; static unsigned int lastmask = 0; - int retval, mask, i; + unsigned int i, mask; + int retval; guint8 key; if (size < 12) { diff --git a/network/common.c b/network/common.c index 2f690b75..c92baf0c 100644 --- a/network/common.c +++ b/network/common.c @@ -175,7 +175,8 @@ int bnep_kill_all_connections(void) { struct bnep_connlist_req req; struct bnep_conninfo ci[7]; - int i, err; + unsigned int i; + int err; memset(&req, 0, sizeof(req)); req.cnum = 7; @@ -187,7 +188,7 @@ int bnep_kill_all_connections(void) return -err; } - for (i=0; i < req.cnum; i++) { + for (i = 0; i < req.cnum; i++) { struct bnep_conndel_req del; memset(&del, 0, sizeof(del)); diff --git a/serial/proxy.c b/serial/proxy.c index d2831083..76f2e1d2 100644 --- a/serial/proxy.c +++ b/serial/proxy.c @@ -1033,7 +1033,8 @@ static void parse_proxy(char *key, char *value, void *data) char uuid128[MAX_LEN_UUID_STR], tmp[3]; char *pvalue; proxy_type_t type; - int ch, opts, pos; + unsigned int pos; + int ch, opts; struct termios ti; uint8_t *pti; diff --git a/serial/storage.c b/serial/storage.c index 284e8084..a6564a72 100644 --- a/serial/storage.c +++ b/serial/storage.c @@ -103,7 +103,8 @@ int proxy_store(bdaddr_t *src, const char *uuid, const char *tty, const char *name, uint8_t ch, int opts, struct termios *ti) { char filename[PATH_MAX + 1], key[32], src_addr[18], *value; - int i, pos, size, err; + unsigned int i; + int pos, size, err; uint8_t *pti; ba2str(src, src_addr); diff --git a/src/sdpd-request.c b/src/sdpd-request.c index ae08fa51..1015213f 100644 --- a/src/sdpd-request.c +++ b/src/sdpd-request.c @@ -122,7 +122,7 @@ static int extract_des(uint8_t *buf, int len, sdp_list_t **svcReqSeq, uint8_t *p char *pElem = NULL; int localSeqLength = 0; - if (bufsize < sizeof(uint8_t)) { + if (bufsize < (int) sizeof(uint8_t)) { SDPDBG("->Unexpected end of buffer"); return -1; } @@ -145,7 +145,7 @@ static int extract_des(uint8_t *buf, int len, sdp_list_t **svcReqSeq, uint8_t *p p += sizeof(uint8_t); seqlen += sizeof(uint8_t); bufsize -= sizeof(uint8_t); - if (bufsize < sizeof(uint16_t)) { + if (bufsize < (int) sizeof(uint16_t)) { SDPDBG("->Unexpected end of buffer"); return -1; } @@ -460,9 +460,9 @@ static int service_search_req(sdp_req_t *req, sdp_buf_t *buf) SDPDBG("Setting non-NULL sdp_cstate_t"); if (cstate) - memcpy((char *)&newState, cstate, sizeof(sdp_cont_state_t)); + memcpy(&newState, cstate, sizeof(sdp_cont_state_t)); else { - memset((char *)&newState, 0, sizeof(sdp_cont_state_t)); + memset(&newState, 0, sizeof(sdp_cont_state_t)); newState.timestamp = cStateId; } newState.cStateValue.lastIndexSent = i; @@ -563,7 +563,7 @@ static int service_attr_req(sdp_req_t *req, sdp_buf_t *buf) sdp_list_t *seq = NULL; uint8_t dtd = 0; int scanned = 0; - int max_rsp_size; + unsigned int max_rsp_size; int status = 0, plen, mlen; uint8_t *pdata = req->buf + sizeof(sdp_pdu_hdr_t); uint32_t handle = ntohl(bt_get_unaligned((uint32_t *)pdata)); @@ -679,7 +679,8 @@ static int service_search_attr_req(sdp_req_t *req, sdp_buf_t *buf) { int status = 0, plen, totscanned; uint8_t *pdata, *pResponse = NULL; - int scanned, max, rsp_count = 0; + unsigned int max; + int scanned, rsp_count = 0; sdp_list_t *pattern = NULL, *seq = NULL, *svcList; sdp_cont_state_t *cstate = NULL; short cstate_size = 0; diff --git a/src/sdpd-service.c b/src/sdpd-service.c index a6eab93d..826eb104 100644 --- a/src/sdpd-service.c +++ b/src/sdpd-service.c @@ -448,7 +448,7 @@ int remove_record_from_server(uint32_t handle) } // FIXME: refactor for server-side -static sdp_record_t *extract_pdu_server(bdaddr_t *device, uint8_t *p, int bufsize, uint32_t handleExpected, int *scanned) +static sdp_record_t *extract_pdu_server(bdaddr_t *device, uint8_t *p, unsigned int bufsize, uint32_t handleExpected, int *scanned) { int extractStatus = -1, localExtractedLength = 0; uint8_t dtd; diff --git a/test/sdptest.c b/test/sdptest.c index 141a195e..cccb1da7 100644 --- a/test/sdptest.c +++ b/test/sdptest.c @@ -43,7 +43,7 @@ static volatile sig_atomic_t __io_finished = 0; static void callback(uint8_t type, uint16_t status, uint8_t *rsp, size_t size, void *udata) { - int i; + unsigned int i; for (i = 0; i < size; i++) { printf("%02x ", rsp[i]); diff --git a/tools/avctrl.c b/tools/avctrl.c index 463af945..7b5e685b 100644 --- a/tools/avctrl.c +++ b/tools/avctrl.c @@ -142,7 +142,7 @@ static int find_devices(struct device_info *devinfo, size_t size) struct usb_bus *bus; struct usb_device *dev; struct device_id *id; - int count = 0; + unsigned int count = 0; usb_find_busses(); usb_find_devices(); diff --git a/tools/avinfo.c b/tools/avinfo.c index 8f50cfd0..341c0af1 100644 --- a/tools/avinfo.c +++ b/tools/avinfo.c @@ -500,8 +500,8 @@ static int avdtp_get_caps(int sk, int seid) if (ret < 0) return ret; - if (ret < (sizeof(struct getcap_resp) + 4 + - sizeof(struct avdtp_media_codec_capability))) { + if (ret < ((int) sizeof(struct getcap_resp) + 4 + + (int) sizeof(struct avdtp_media_codec_capability))) { printf("Invalid capabilities\n"); return -1; } diff --git a/tools/bccmd.c b/tools/bccmd.c index 9d29cb0c..0e0c28c9 100644 --- a/tools/bccmd.c +++ b/tools/bccmd.c @@ -409,7 +409,8 @@ static int cmd_buildname(int transport, int argc, char *argv[]) { uint8_t array[130]; char name[64]; - int i, err; + unsigned int i; + int err; OPT_HELP(0, NULL); @@ -699,7 +700,7 @@ static int cmd_psget(int transport, int argc, char *argv[]) return err; length = array[2] + (array[3] << 8); - if (length + 6 > sizeof(array) / 2) + if (length + 6 > (int) sizeof(array) / 2) return -EIO; memset(array, 0, sizeof(array)); @@ -774,7 +775,7 @@ static int cmd_psset(int transport, int argc, char *argv[]) return err; length = array[2] + (array[3] << 8); - if (length + 6 > sizeof(array) / 2) + if (length + 6 > (int) sizeof(array) / 2) return -EIO; memset(array, 0, sizeof(array)); @@ -962,7 +963,7 @@ static int cmd_psread(int transport, int argc, char *argv[]) continue; length = array[2] + (array[3] << 8); - if (length + 6 > sizeof(array) / 2) + if (length + 6 > (int) sizeof(array) / 2) continue; memset(array, 0, sizeof(array)); diff --git a/tools/ciptool.c b/tools/ciptool.c index e8597f11..2afa30e8 100644 --- a/tools/ciptool.c +++ b/tools/ciptool.c @@ -203,7 +203,7 @@ static void cmd_show(int ctl, bdaddr_t *bdaddr, int argc, char **argv) struct cmtp_connlist_req req; struct cmtp_conninfo ci[16]; char addr[18]; - int i; + unsigned int i; req.cnum = 16; req.ci = ci; diff --git a/tools/dfubabel.c b/tools/dfubabel.c index 9778502e..498a717a 100644 --- a/tools/dfubabel.c +++ b/tools/dfubabel.c @@ -115,7 +115,7 @@ static int find_devices(struct device_info *devinfo, size_t size) struct usb_bus *bus; struct usb_device *dev; struct device_id *id; - int count = 0; + unsigned int count = 0; usb_find_busses(); usb_find_devices(); diff --git a/tools/dfutool.c b/tools/dfutool.c index 10387bbf..cab39feb 100644 --- a/tools/dfutool.c +++ b/tools/dfutool.c @@ -321,9 +321,10 @@ static void cmd_verify(char *device, int argc, char **argv) uint16_t bcd; char str[16]; unsigned char *buf; - unsigned long size; + size_t size; char *filename; - int i, fd, len; + unsigned int i, len; + int fd; if (argc < 2) { usage(); @@ -350,7 +351,7 @@ static void cmd_verify(char *device, int argc, char **argv) exit(1); } - if (read(fd, buf, size) < size) { + if (read(fd, buf, size) < (ssize_t) size) { perror("Can't load firmware"); free(buf); close(fd); @@ -419,10 +420,12 @@ static void cmd_upgrade(char *device, int argc, char **argv) struct dfu_suffix suffix; struct stat st; char *buf; - unsigned long filesize, count, timeout = 0; + size_t filesize; + unsigned long count, timeout = 0; char *filename; uint32_t crc, dwCRC; - int fd, i, block, len, size, sent = 0, try = 10; + unsigned int i; + int fd, block, len, size, sent = 0, try = 10; if (argc < 2) { usage(); @@ -449,7 +452,7 @@ static void cmd_upgrade(char *device, int argc, char **argv) exit(1); } - if (read(fd, buf, filesize) < filesize) { + if (read(fd, buf, filesize) < (ssize_t) filesize) { perror("Can't load firmware"); free(buf); close(fd); diff --git a/tools/hciattach_tialt.c b/tools/hciattach_tialt.c index 8ddda359..aa63190a 100644 --- a/tools/hciattach_tialt.c +++ b/tools/hciattach_tialt.c @@ -142,7 +142,7 @@ static int texas_load_firmware(int fd, const char *firmware) { iov_cmd[1].iov_base = data; iov_cmd[1].iov_len = cmd->plen; nw = writev(fd, iov_cmd, 2); - FAILIF(nw != sizeof(cmd) + cmd->plen, + FAILIF(nw != (int) sizeof(cmd) + cmd->plen, "Could not send entire command (sent only %d bytes)!\n", nw); } diff --git a/tools/hciconfig.c b/tools/hciconfig.c index 46ca1693..960f450b 100644 --- a/tools/hciconfig.c +++ b/tools/hciconfig.c @@ -688,12 +688,13 @@ static void cmd_class(int ctl, int hdev, char *opt) printf("\tClass: 0x%02x%02x%02x\n", cls[2], cls[1], cls[0]); printf("\tService Classes: "); if (cls[2]) { + unsigned int i; int first = 1; - for (s = 0; s < (sizeof(services) / sizeof(*services)); s++) - if (cls[2] & (1 << s)) { + for (i = 0; i < (sizeof(services) / sizeof(*services)); i++) + if (cls[2] & (1 << i)) { if (!first) printf(", "); - printf("%s", services[s]); + printf("%s", services[i]); first = 0; } } else diff --git a/tools/hcitool.c b/tools/hcitool.c index f62f3161..73fbc839 100644 --- a/tools/hcitool.c +++ b/tools/hcitool.c @@ -1098,7 +1098,7 @@ static void cmd_cmd(int dev_id, int argc, char **argv) return; } - for (i = 2, len = 0; i < argc && len < sizeof(buf); i++, len++) + for (i = 2, len = 0; i < argc && len < (int) sizeof(buf); i++, len++) *ptr++ = (uint8_t) strtol(argv[i], NULL, 16); dd = hci_open_dev(dev_id); diff --git a/tools/hid2hci.c b/tools/hid2hci.c index 76b3766b..cd38aac7 100644 --- a/tools/hid2hci.c +++ b/tools/hid2hci.c @@ -129,7 +129,8 @@ static int send_report(int fd, const char *buf, size_t size) { struct hiddev_report_info rinfo; struct hiddev_usage_ref uref; - int i, err; + unsigned int i; + int err; for (i = 0; i < size; i++) { memset(&uref, 0, sizeof(uref)); @@ -179,8 +180,8 @@ static int switch_logitech(struct device_info *devinfo) memset(&dinfo, 0, sizeof(dinfo)); err = ioctl(fd, HIDIOCGDEVINFO, &dinfo); - if (err < 0 || dinfo.busnum != atoi(devinfo->dev->bus->dirname) || - dinfo.devnum != atoi(devinfo->dev->filename)) { + if (err < 0 || (int) dinfo.busnum != atoi(devinfo->dev->bus->dirname) || + (int) dinfo.devnum != atoi(devinfo->dev->filename)) { close(fd); continue; } @@ -288,7 +289,7 @@ static int find_devices(int mode, struct device_info *devinfo, size_t size) struct usb_bus *bus; struct usb_device *dev; struct device_id *id; - int count = 0; + unsigned int count = 0; usb_find_busses(); usb_find_devices(); diff --git a/tools/sdptool.c b/tools/sdptool.c index 39e193aa..4707f4cd 100644 --- a/tools/sdptool.c +++ b/tools/sdptool.c @@ -477,7 +477,7 @@ static void sdp_data_printf(sdp_data_t *sdpdata, struct attrib_context *context, case SDP_TEXT_STR8: case SDP_TEXT_STR16: case SDP_TEXT_STR32: - if (sdpdata->unitSize > strlen(sdpdata->val.str)) { + if (sdpdata->unitSize > (int) strlen(sdpdata->val.str)) { int i; printf("%.*sData :", indent, indent_spaces); for (i = 0; i < sdpdata->unitSize; i++) @@ -1754,7 +1754,7 @@ static int add_opush(sdp_session_t *session, svc_info_t *si) uint8_t formats[] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 }; //uint8_t formats[] = { 0xff }; void *dtds[sizeof(formats)], *values[sizeof(formats)]; - int i; + unsigned int i; uint8_t dtd = SDP_UINT8; sdp_data_t *sflist; int ret = 0; @@ -2164,7 +2164,7 @@ static int add_hid_keyb(sdp_session_t *session, svc_info_t *si) sdp_profile_desc_t profile[1]; sdp_list_t *aproto, *proto[3]; sdp_data_t *psm, *lang_lst, *lang_lst2, *hid_spec_lst, *hid_spec_lst2; - int i; + unsigned int i; uint8_t dtd = SDP_UINT16; uint8_t dtd2 = SDP_UINT8; uint8_t dtd_data = SDP_TEXT_STR8; @@ -2327,7 +2327,7 @@ static int add_hid_wiimote(sdp_session_t *session, svc_info_t *si) sdp_profile_desc_t profile[1]; sdp_list_t *aproto, *proto[3]; sdp_data_t *psm, *lang_lst, *lang_lst2, *hid_spec_lst, *hid_spec_lst2; - int i; + unsigned int i; uint8_t dtd = SDP_UINT16; uint8_t dtd2 = SDP_UINT8; uint8_t dtd_data = SDP_TEXT_STR8; @@ -3940,7 +3940,8 @@ static int cmd_records(int argc, char **argv) 0x4000000, 0x100000, 0x1000000, 0x4f491100, 0x4f491200 }; bdaddr_t bdaddr; - int i, n, opt, err = 0, num = 32; + unsigned int i, n, num = 32; + int opt, err = 0; /* Initialise context */ memset(&context, '\0', sizeof(struct search_context)); -- cgit