summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-12-23 04:25:37 +0100
committerMarcel Holtmann <marcel@holtmann.org>2008-12-23 04:25:37 +0100
commit6a0330d53af24f0f5f0d41fd6ff6cf230379870e (patch)
tree8af0fc864757d3c8aa2dc3f9924a61716a858e35 /audio
parent250964b29f8daa350fd17299c0848a181ba735f2 (diff)
Convert sizeof to int before comparison against < 0
Diffstat (limited to 'audio')
-rw-r--r--audio/unix.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/audio/unix.c b/audio/unix.c
index 4378bb24..ed7df0b7 100644
--- a/audio/unix.c
+++ b/audio/unix.c
@@ -382,7 +382,7 @@ static int a2dp_append_codec(struct bt_get_capabilities_rsp *rsp,
struct sbc_codec_cap *sbc_cap = (void *) codec_cap;
sbc_capabilities_t *sbc = (void *) codec;
- if (space_left - sizeof(sbc_capabilities_t) < 0)
+ if ((space_left - (int) sizeof(sbc_capabilities_t)) < 0)
return -ENOMEM;
codec->length = sizeof(sbc_capabilities_t);
@@ -398,7 +398,7 @@ static int a2dp_append_codec(struct bt_get_capabilities_rsp *rsp,
struct mpeg_codec_cap *mpeg_cap = (void *) codec_cap;
mpeg_capabilities_t *mpeg = (void *) codec;
- if (space_left - sizeof(mpeg_capabilities_t) < 0)
+ if ((space_left - (int) sizeof(mpeg_capabilities_t)) < 0)
return -ENOMEM;
codec->length = sizeof(mpeg_capabilities_t);
@@ -415,7 +415,7 @@ static int a2dp_append_codec(struct bt_get_capabilities_rsp *rsp,
codec_length = cap->length - (sizeof(struct avdtp_service_capability)
+ sizeof(struct avdtp_media_codec_capability));
- if (space_left - (codec_length + sizeof(codec_capabilities_t)) < 0)
+ if ((space_left - codec_length - (int) sizeof(codec_capabilities_t)) < 0)
return -ENOMEM;
codec->length = codec_length + sizeof(codec_capabilities_t);