aboutsummaryrefslogtreecommitdiff
path: root/src/conversation
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-05-06 14:44:08 +0000
committerChristian Grothoff <christian@grothoff.org>2016-05-06 14:44:08 +0000
commite8cf81fdb3fdaef59b49da8f6e952a3225ab326e (patch)
tree4e5f75d44a9121b32895fdfc5a4177052a7d923d /src/conversation
parentae8cb91d9961899075a892a3110204bc139c2eb6 (diff)
fixing compiler warnings
Diffstat (limited to 'src/conversation')
-rw-r--r--src/conversation/gnunet-helper-audio-playback.c32
-rw-r--r--src/conversation/gnunet-helper-audio-record.c8
-rw-r--r--src/conversation/gnunet-service-conversation.c19
3 files changed, 37 insertions, 22 deletions
diff --git a/src/conversation/gnunet-helper-audio-playback.c b/src/conversation/gnunet-helper-audio-playback.c
index 7b95891816..77529e3b50 100644
--- a/src/conversation/gnunet-helper-audio-playback.c
+++ b/src/conversation/gnunet-helper-audio-playback.c
@@ -173,15 +173,15 @@ process_header (ogg_packet *op)
dec = opus_decoder_create (SAMPLING_RATE, channels, &err);
if (OPUS_OK != err)
{
- fprintf (stderr,
- "Cannot create encoder: %s\n",
+ fprintf (stderr,
+ "Cannot create encoder: %s\n",
opus_strerror (err));
return NULL;
}
if (! dec)
{
fprintf (stderr,
- "Decoder initialization failed: %s\n",
+ "Decoder initialization failed: %s\n",
opus_strerror (err));
return NULL;
}
@@ -209,7 +209,7 @@ process_header (ogg_packet *op)
#ifdef DEBUG_DUMP_DECODED_OGG
-static size_t
+static size_t
fwrite_le32(opus_int32 i32, FILE *file)
{
unsigned char buf[4];
@@ -221,7 +221,7 @@ fwrite_le32(opus_int32 i32, FILE *file)
}
-static size_t
+static size_t
fwrite_le16(int i16, FILE *file)
{
unsigned char buf[2];
@@ -292,9 +292,11 @@ audio_write (int64_t maxout)
int64_t wrote = 0;
wrote = to_write;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Writing %u * %u * %u = %u bytes into PA\n",
- to_write, channels, sizeof (float),
- to_write * channels * sizeof (float));
+ "Writing %u * %u * %u = %llu bytes into PA\n",
+ to_write,
+ channels,
+ (unsigned int) sizeof (float),
+ (unsigned long long) (to_write * channels * sizeof (float)));
#ifdef DEBUG_DUMP_DECODED_OGG
if (dump_to_stdout)
{
@@ -453,12 +455,14 @@ ogg_demux_and_decode ()
so that we can adjust the timestamp counting.*/
gran_offset = preskip;
- if (!pcm_buffer)
+ if (! pcm_buffer)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Allocating %u * %u * %u = %u bytes of buffer space\n",
- MAX_FRAME_SIZE, channels, sizeof (float),
- MAX_FRAME_SIZE * channels * sizeof (float));
+ "Allocating %u * %u * %u = %llu bytes of buffer space\n",
+ MAX_FRAME_SIZE,
+ channels,
+ (unsigned int) sizeof (float),
+ (unsigned long long) (MAX_FRAME_SIZE * channels * sizeof (float)));
pcm_buffer = pa_xmalloc (sizeof (float) * MAX_FRAME_SIZE * channels);
}
}
@@ -501,7 +505,9 @@ ogg_demux_and_decode ()
frame_size = ret;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Decoded %d bytes/channel (%d bytes) from %u compressed bytes\n",
- ret, ret * channels, op.bytes);
+ ret,
+ ret * channels,
+ (unsigned int) op.bytes);
/*Apply header gain, if we're not using an opus library new
enough to do this internally.*/
diff --git a/src/conversation/gnunet-helper-audio-record.c b/src/conversation/gnunet-helper-audio-record.c
index 31943810fc..73f4cfda3a 100644
--- a/src/conversation/gnunet-helper-audio-record.c
+++ b/src/conversation/gnunet-helper-audio-record.c
@@ -405,8 +405,8 @@ stream_read_callback (pa_stream * s,
const void *data;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Got %u/%u bytes of PCM data\n",
- length,
+ "Got %u/%d bytes of PCM data\n",
+ (unsigned int) length,
pcm_length);
GNUNET_assert (NULL != s);
@@ -718,8 +718,8 @@ ogg_init ()
if (NULL == commentspacket)
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- _("Failed to allocate %d bytes for second packet\n"),
- commentspacket_len);
+ _("Failed to allocate %u bytes for second packet\n"),
+ (unsigned int) commentspacket_len);
exit (5);
}
diff --git a/src/conversation/gnunet-service-conversation.c b/src/conversation/gnunet-service-conversation.c
index 10f1691053..d12fbdc566 100644
--- a/src/conversation/gnunet-service-conversation.c
+++ b/src/conversation/gnunet-service-conversation.c
@@ -779,7 +779,9 @@ transmit_line_audio (void *cls,
ch->audio_data = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Sending %u bytes of audio data from line %u to remote line %u via cadet\n",
- ch->audio_size, ch->line->local_line, ch->remote_line);
+ (unsigned int) ch->audio_size,
+ ch->line->local_line,
+ ch->remote_line);
return sizeof (struct CadetAudioMessage) + ch->audio_size;
}
@@ -1291,21 +1293,25 @@ handle_cadet_audio_message (void *cls,
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Received %u bytes of AUDIO data for non-existing line %u, dropping.\n",
- msize, ntohl (msg->remote_line));
+ (unsigned int) msize,
+ ntohl (msg->remote_line));
return GNUNET_SYSERR;
}
if (NULL == ch)
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Received %u bytes of AUDIO data for unknown sender.\n",
- msize);
+ (unsigned int) msize);
return GNUNET_SYSERR;
}
if ((GNUNET_YES == ch->suspended_local) || (GNUNET_YES == ch->suspended_remote))
{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Received %u bytes of AUDIO data on suspended channel CID %u:(%u:%u); dropping\n",
- msize, ch->cid, ch->remote_line, line->local_line);
+ (unsigned int) msize,
+ ch->cid,
+ ch->remote_line,
+ line->local_line);
GNUNET_CADET_receive_done (channel);
return GNUNET_OK;
}
@@ -1315,7 +1321,10 @@ handle_cadet_audio_message (void *cls,
GNUNET_CADET_receive_done (channel);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Forwarding %u bytes of AUDIO data to client CID %u:(%u:%u)\n",
- msize, ch->cid, ch->remote_line, ch->line->local_line);
+ (unsigned int) msize,
+ ch->cid,
+ ch->remote_line,
+ ch->line->local_line);
cam = (struct ClientAudioMessage *) buf;
cam->header.size = htons (sizeof (buf));
cam->header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO);