summaryrefslogtreecommitdiffstats
path: root/src/modules/bluetooth
diff options
context:
space:
mode:
authorSiarhei Siamashka <siarhei.siamashka@nokia.com>2011-03-14 15:21:53 -0300
committerLuiz Augusto von Dentz <luiz.dentz-von@nokia.com>2011-03-14 15:21:53 -0300
commit177948a6f23cbc58530ae394f791ba9fd764899a (patch)
treeb2d25597cc7de7ca55068ef1ac40f73dee0a39c1 /src/modules/bluetooth
parentfd7dc68ded44bd307802c24c3d02366984d829a3 (diff)
sbc: fix signedness of parameters
The written parameter of sbc_encode can be negative so it should be ssize_t instead of size_t.
Diffstat (limited to 'src/modules/bluetooth')
-rw-r--r--src/modules/bluetooth/sbc/sbc.c9
-rw-r--r--src/modules/bluetooth/sbc/sbc.h2
2 files changed, 6 insertions, 5 deletions
diff --git a/src/modules/bluetooth/sbc/sbc.c b/src/modules/bluetooth/sbc/sbc.c
index bebca41e..ae744296 100644
--- a/src/modules/bluetooth/sbc/sbc.c
+++ b/src/modules/bluetooth/sbc/sbc.c
@@ -742,7 +742,7 @@ static int sbc_analyze_audio(struct sbc_encoder_state *state,
* -99 not implemented
*/
-static SBC_ALWAYS_INLINE int sbc_pack_frame_internal(
+static SBC_ALWAYS_INLINE ssize_t sbc_pack_frame_internal(
uint8_t *data, struct sbc_frame *frame, size_t len,
int frame_subbands, int frame_channels, int joint)
{
@@ -858,7 +858,7 @@ static SBC_ALWAYS_INLINE int sbc_pack_frame_internal(
return data_ptr - data;
}
-static int sbc_pack_frame(uint8_t *data, struct sbc_frame *frame, size_t len,
+static ssize_t sbc_pack_frame(uint8_t *data, struct sbc_frame *frame, size_t len,
int joint)
{
if (frame->subbands == 4) {
@@ -1004,10 +1004,11 @@ ssize_t sbc_decode(sbc_t *sbc, const void *input, size_t input_len,
}
ssize_t sbc_encode(sbc_t *sbc, const void *input, size_t input_len,
- void *output, size_t output_len, size_t *written)
+ void *output, size_t output_len, ssize_t *written)
{
struct sbc_priv *priv;
- int framelen, samples;
+ int samples;
+ ssize_t framelen;
int (*sbc_enc_process_input)(int position,
const uint8_t *pcm, int16_t X[2][SBC_X_BUFFER_SIZE],
int nsamples, int nchannels);
diff --git a/src/modules/bluetooth/sbc/sbc.h b/src/modules/bluetooth/sbc/sbc.h
index 65435884..c9c56d38 100644
--- a/src/modules/bluetooth/sbc/sbc.h
+++ b/src/modules/bluetooth/sbc/sbc.h
@@ -90,7 +90,7 @@ ssize_t sbc_decode(sbc_t *sbc, const void *input, size_t input_len,
/* Encodes ONE input block into ONE output block */
ssize_t sbc_encode(sbc_t *sbc, const void *input, size_t input_len,
- void *output, size_t output_len, size_t *written);
+ void *output, size_t output_len, ssize_t *written);
/* Returns the output block size in bytes */
size_t sbc_get_frame_length(sbc_t *sbc);