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)
downloadgnunet-e8cf81fdb3fdaef59b49da8f6e952a3225ab326e.tar.gz
gnunet-e8cf81fdb3fdaef59b49da8f6e952a3225ab326e.zip
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 7b9589181..77529e3b5 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)
173 dec = opus_decoder_create (SAMPLING_RATE, channels, &err); 173 dec = opus_decoder_create (SAMPLING_RATE, channels, &err);
174 if (OPUS_OK != err) 174 if (OPUS_OK != err)
175 { 175 {
176 fprintf (stderr, 176 fprintf (stderr,
177 "Cannot create encoder: %s\n", 177 "Cannot create encoder: %s\n",
178 opus_strerror (err)); 178 opus_strerror (err));
179 return NULL; 179 return NULL;
180 } 180 }
181 if (! dec) 181 if (! dec)
182 { 182 {
183 fprintf (stderr, 183 fprintf (stderr,
184 "Decoder initialization failed: %s\n", 184 "Decoder initialization failed: %s\n",
185 opus_strerror (err)); 185 opus_strerror (err));
186 return NULL; 186 return NULL;
187 } 187 }
@@ -209,7 +209,7 @@ process_header (ogg_packet *op)
209 209
210 210
211#ifdef DEBUG_DUMP_DECODED_OGG 211#ifdef DEBUG_DUMP_DECODED_OGG
212static size_t 212static size_t
213fwrite_le32(opus_int32 i32, FILE *file) 213fwrite_le32(opus_int32 i32, FILE *file)
214{ 214{
215 unsigned char buf[4]; 215 unsigned char buf[4];
@@ -221,7 +221,7 @@ fwrite_le32(opus_int32 i32, FILE *file)
221} 221}
222 222
223 223
224static size_t 224static size_t
225fwrite_le16(int i16, FILE *file) 225fwrite_le16(int i16, FILE *file)
226{ 226{
227 unsigned char buf[2]; 227 unsigned char buf[2];
@@ -292,9 +292,11 @@ audio_write (int64_t maxout)
292 int64_t wrote = 0; 292 int64_t wrote = 0;
293 wrote = to_write; 293 wrote = to_write;
294 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 294 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
295 "Writing %u * %u * %u = %u bytes into PA\n", 295 "Writing %u * %u * %u = %llu bytes into PA\n",
296 to_write, channels, sizeof (float), 296 to_write,
297 to_write * channels * sizeof (float)); 297 channels,
298 (unsigned int) sizeof (float),
299 (unsigned long long) (to_write * channels * sizeof (float)));
298#ifdef DEBUG_DUMP_DECODED_OGG 300#ifdef DEBUG_DUMP_DECODED_OGG
299 if (dump_to_stdout) 301 if (dump_to_stdout)
300 { 302 {
@@ -453,12 +455,14 @@ ogg_demux_and_decode ()
453 so that we can adjust the timestamp counting.*/ 455 so that we can adjust the timestamp counting.*/
454 gran_offset = preskip; 456 gran_offset = preskip;
455 457
456 if (!pcm_buffer) 458 if (! pcm_buffer)
457 { 459 {
458 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 460 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
459 "Allocating %u * %u * %u = %u bytes of buffer space\n", 461 "Allocating %u * %u * %u = %llu bytes of buffer space\n",
460 MAX_FRAME_SIZE, channels, sizeof (float), 462 MAX_FRAME_SIZE,
461 MAX_FRAME_SIZE * channels * sizeof (float)); 463 channels,
464 (unsigned int) sizeof (float),
465 (unsigned long long) (MAX_FRAME_SIZE * channels * sizeof (float)));
462 pcm_buffer = pa_xmalloc (sizeof (float) * MAX_FRAME_SIZE * channels); 466 pcm_buffer = pa_xmalloc (sizeof (float) * MAX_FRAME_SIZE * channels);
463 } 467 }
464 } 468 }
@@ -501,7 +505,9 @@ ogg_demux_and_decode ()
501 frame_size = ret; 505 frame_size = ret;
502 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 506 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
503 "Decoded %d bytes/channel (%d bytes) from %u compressed bytes\n", 507 "Decoded %d bytes/channel (%d bytes) from %u compressed bytes\n",
504 ret, ret * channels, op.bytes); 508 ret,
509 ret * channels,
510 (unsigned int) op.bytes);
505 511
506 /*Apply header gain, if we're not using an opus library new 512 /*Apply header gain, if we're not using an opus library new
507 enough to do this internally.*/ 513 enough to do this internally.*/
diff --git a/src/conversation/gnunet-helper-audio-record.c b/src/conversation/gnunet-helper-audio-record.c
index 31943810f..73f4cfda3 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,
405 const void *data; 405 const void *data;
406 406
407 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 407 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
408 "Got %u/%u bytes of PCM data\n", 408 "Got %u/%d bytes of PCM data\n",
409 length, 409 (unsigned int) length,
410 pcm_length); 410 pcm_length);
411 411
412 GNUNET_assert (NULL != s); 412 GNUNET_assert (NULL != s);
@@ -718,8 +718,8 @@ ogg_init ()
718 if (NULL == commentspacket) 718 if (NULL == commentspacket)
719 { 719 {
720 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 720 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
721 _("Failed to allocate %d bytes for second packet\n"), 721 _("Failed to allocate %u bytes for second packet\n"),
722 commentspacket_len); 722 (unsigned int) commentspacket_len);
723 exit (5); 723 exit (5);
724 } 724 }
725 725
diff --git a/src/conversation/gnunet-service-conversation.c b/src/conversation/gnunet-service-conversation.c
index 10f169105..d12fbdc56 100644
--- a/src/conversation/gnunet-service-conversation.c
+++ b/src/conversation/gnunet-service-conversation.c
@@ -779,7 +779,9 @@ transmit_line_audio (void *cls,
779 ch->audio_data = NULL; 779 ch->audio_data = NULL;
780 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 780 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
781 "Sending %u bytes of audio data from line %u to remote line %u via cadet\n", 781 "Sending %u bytes of audio data from line %u to remote line %u via cadet\n",
782 ch->audio_size, ch->line->local_line, ch->remote_line); 782 (unsigned int) ch->audio_size,
783 ch->line->local_line,
784 ch->remote_line);
783 return sizeof (struct CadetAudioMessage) + ch->audio_size; 785 return sizeof (struct CadetAudioMessage) + ch->audio_size;
784} 786}
785 787
@@ -1291,21 +1293,25 @@ handle_cadet_audio_message (void *cls,
1291 { 1293 {
1292 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1294 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1293 "Received %u bytes of AUDIO data for non-existing line %u, dropping.\n", 1295 "Received %u bytes of AUDIO data for non-existing line %u, dropping.\n",
1294 msize, ntohl (msg->remote_line)); 1296 (unsigned int) msize,
1297 ntohl (msg->remote_line));
1295 return GNUNET_SYSERR; 1298 return GNUNET_SYSERR;
1296 } 1299 }
1297 if (NULL == ch) 1300 if (NULL == ch)
1298 { 1301 {
1299 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1302 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1300 "Received %u bytes of AUDIO data for unknown sender.\n", 1303 "Received %u bytes of AUDIO data for unknown sender.\n",
1301 msize); 1304 (unsigned int) msize);
1302 return GNUNET_SYSERR; 1305 return GNUNET_SYSERR;
1303 } 1306 }
1304 if ((GNUNET_YES == ch->suspended_local) || (GNUNET_YES == ch->suspended_remote)) 1307 if ((GNUNET_YES == ch->suspended_local) || (GNUNET_YES == ch->suspended_remote))
1305 { 1308 {
1306 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1309 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1307 "Received %u bytes of AUDIO data on suspended channel CID %u:(%u:%u); dropping\n", 1310 "Received %u bytes of AUDIO data on suspended channel CID %u:(%u:%u); dropping\n",
1308 msize, ch->cid, ch->remote_line, line->local_line); 1311 (unsigned int) msize,
1312 ch->cid,
1313 ch->remote_line,
1314 line->local_line);
1309 GNUNET_CADET_receive_done (channel); 1315 GNUNET_CADET_receive_done (channel);
1310 return GNUNET_OK; 1316 return GNUNET_OK;
1311 } 1317 }
@@ -1315,7 +1321,10 @@ handle_cadet_audio_message (void *cls,
1315 GNUNET_CADET_receive_done (channel); 1321 GNUNET_CADET_receive_done (channel);
1316 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1322 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1317 "Forwarding %u bytes of AUDIO data to client CID %u:(%u:%u)\n", 1323 "Forwarding %u bytes of AUDIO data to client CID %u:(%u:%u)\n",
1318 msize, ch->cid, ch->remote_line, ch->line->local_line); 1324 (unsigned int) msize,
1325 ch->cid,
1326 ch->remote_line,
1327 ch->line->local_line);
1319 cam = (struct ClientAudioMessage *) buf; 1328 cam = (struct ClientAudioMessage *) buf;
1320 cam->header.size = htons (sizeof (buf)); 1329 cam->header.size = htons (sizeof (buf));
1321 cam->header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO); 1330 cam->header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO);