summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2004-10-01 11:38:41 +0000
committerMarcel Holtmann <marcel@holtmann.org>2004-10-01 11:38:41 +0000
commit6153da844acccec9519301e3e15743643c096e09 (patch)
treed8a801420367b39a2f5e29559249b441d7bd4926
parenta82f59ecd2f6fa37d679e4430163c0189193deb5 (diff)
Fix class display and some compile warnings for 64 bit userland
-rw-r--r--tools/hciconfig.c26
-rw-r--r--tools/sdptool.c2
2 files changed, 14 insertions, 14 deletions
diff --git a/tools/hciconfig.c b/tools/hciconfig.c
index 78c56ce7..862deeb9 100644
--- a/tools/hciconfig.c
+++ b/tools/hciconfig.c
@@ -397,10 +397,10 @@ void cmd_name(int ctl, int hdev, char *opt)
*/
static char *get_minor_device_name(int major, int minor)
{
- switch(major) {
- case 0:/* misc */
+ switch (major) {
+ case 0: /* misc */
return "";
- case 1:/* computer */
+ case 1: /* computer */
switch(minor) {
case 0:
return "Uncategorized";
@@ -418,7 +418,7 @@ static char *get_minor_device_name(int major, int minor)
return "Wearable";
}
break;
- case 2:/* phone */
+ case 2: /* phone */
switch(minor) {
case 0:
return "Uncategorized";
@@ -436,7 +436,7 @@ static char *get_minor_device_name(int major, int minor)
return "Sim Card Reader";
}
break;
- case 3:/* lan access */
+ case 3: /* lan access */
if (minor == 0)
return "Uncategorized";
switch(minor / 8) {
@@ -458,7 +458,7 @@ static char *get_minor_device_name(int major, int minor)
return "No service available";
}
break;
- case 4:/* audio/video */
+ case 4: /* audio/video */
switch(minor) {
case 0:
return "Uncategorized";
@@ -498,7 +498,7 @@ static char *get_minor_device_name(int major, int minor)
return "Gaming/Toy";
}
break;
- case 5:/* peripheral */
+ case 5: /* peripheral */
switch(minor) {
case 16:
return "Keyboard";
@@ -508,7 +508,7 @@ static char *get_minor_device_name(int major, int minor)
return "Combo keyboard/pointing device";
}
break;
- case 6:/* imaging */
+ case 6: /* imaging */
if (minor & 4)
return "Display";
if (minor & 8)
@@ -518,7 +518,7 @@ static char *get_minor_device_name(int major, int minor)
if (minor & 32)
return "Printer";
break;
- case 63:/* uncategorised */
+ case 63: /* uncategorised */
return "";
}
return "Unknown (reserved) minor device class";
@@ -550,14 +550,14 @@ void cmd_class(int ctl, int hdev, char *opt)
}
if (opt) {
uint32_t cod = strtoul(opt, NULL, 16);
- if (0 > hci_write_class_of_dev(s, cod, 1000)) {
+ if (hci_write_class_of_dev(s, cod, 1000) < 0) {
printf("Can't write local class of device on hci%d. %s(%d)\n",
hdev, strerror(errno), errno);
exit(1);
}
} else {
uint8_t cls[3];
- if (0 > hci_read_class_of_dev(s, cls, 1000)) {
+ if (hci_read_class_of_dev(s, cls, 1000) < 0) {
printf("Can't read class of device on hci%d. %s(%d)\n",
hdev, strerror(errno), errno);
exit(1);
@@ -567,7 +567,7 @@ void cmd_class(int ctl, int hdev, char *opt)
printf("\tService Classes: ");
if (cls[2]) {
int first = 1;
- for(s=0; s < sizeof(services); s++)
+ for (s = 0; s < sizeof(*services); s++)
if (cls[2] & (1 << s)) {
if (!first)
printf(", ");
@@ -577,7 +577,7 @@ void cmd_class(int ctl, int hdev, char *opt)
} else
printf("Unspecified");
printf("\n\tDevice Class: ");
- if ((cls[1] & 0x1f) > sizeof(major_devices))
+ if ((cls[1] & 0x1f) > sizeof(*major_devices))
printf("Invalid Device Class!\n");
else
printf("%s, %s\n", major_devices[cls[1] & 0x1f],
diff --git a/tools/sdptool.c b/tools/sdptool.c
index 4f89491d..99684d9c 100644
--- a/tools/sdptool.c
+++ b/tools/sdptool.c
@@ -813,7 +813,7 @@ void print_lang_attr(void *value, void *user)
printf(" base_offset: 0x%02x\n", lang->base_offset);
}
-void print_access_protos(value, userData)
+void print_access_protos(void *value, void *userData)
{
sdp_list_t *protDescSeq = (sdp_list_t *)value;
sdp_list_foreach(protDescSeq, print_service_desc, 0);