[Swfdec] libswfdec/swfdec_audio_event.c libswfdec/swfdec_bits.c libswfdec/swfdec_sound.c libswfdec/swfdec_sprite.c libswfdec/swfdec_swf_decoder.c

Pekka Lampila medar at kemper.freedesktop.org
Wed Jan 9 04:16:06 PST 2008


 libswfdec/swfdec_audio_event.c |    4 ++--
 libswfdec/swfdec_bits.c        |    2 +-
 libswfdec/swfdec_sound.c       |    8 ++++----
 libswfdec/swfdec_sprite.c      |    2 +-
 libswfdec/swfdec_swf_decoder.c |    2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 8f85e939022fc9d5ea4e09c21635c51e472068f5
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date:   Wed Jan 9 14:08:04 2008 +0200

    Fix warnings in prints caused by the change of Buffer.size from guint to gsize

diff --git a/libswfdec/swfdec_audio_event.c b/libswfdec/swfdec_audio_event.c
index fc05dcd..fa43359 100644
--- a/libswfdec/swfdec_audio_event.c
+++ b/libswfdec/swfdec_audio_event.c
@@ -188,7 +188,7 @@ swfdec_audio_event_decode (SwfdecAudioEvent *event)
     }
     skip = bytes_per_sample * (event->start_sample / granule);
     if (skip >= event->decoded->length) {
-      SWFDEC_WARNING ("start sample %u > total number of samples %u",
+      SWFDEC_WARNING ("start sample %u > total number of samples %"G_GSIZE_FORMAT,
 	  event->start_sample / granule, event->decoded->length / bytes_per_sample);
       swfdec_buffer_unref (event->decoded);
       event->decoded = swfdec_buffer_new ();
@@ -206,7 +206,7 @@ swfdec_audio_event_decode (SwfdecAudioEvent *event)
     }
     keep = bytes_per_sample * (event->stop_sample / granule - event->start_sample / granule);
     if (keep > event->decoded->length) {
-      SWFDEC_WARNING ("stop sample %u outside of decoded number of samples %u",
+      SWFDEC_WARNING ("stop sample %u outside of decoded number of samples %"G_GSIZE_FORMAT,
 	  event->stop_sample / granule, event->decoded->length / bytes_per_sample +
 	  event->start_sample / granule);
     } else if (keep < event->decoded->length) {
diff --git a/libswfdec/swfdec_bits.c b/libswfdec/swfdec_bits.c
index 5298012..4faaa0b 100644
--- a/libswfdec/swfdec_bits.c
+++ b/libswfdec/swfdec_bits.c
@@ -742,7 +742,7 @@ out:
     buffer->length = z.total_out;
   } else {
     if (buffer->length < z.total_out) {
-      SWFDEC_WARNING ("Not enough data decompressed: %lu instead of %u expected",
+      SWFDEC_WARNING ("Not enough data decompressed: %lu instead of %"G_GSIZE_FORMAT" expected",
 	  z.total_out, buffer->length);
       memset (buffer->data + z.total_out, 0, buffer->length - z.total_out);
     }
diff --git a/libswfdec/swfdec_sound.c b/libswfdec/swfdec_sound.c
index ef0641e..cb1e97c 100644
--- a/libswfdec/swfdec_sound.c
+++ b/libswfdec/swfdec_sound.c
@@ -105,7 +105,7 @@ tag_func_sound_stream_block (SwfdecSwfDecoder * s, guint tag)
       SWFDEC_ERROR ("empty sound chunk");
       return SWFDEC_STATUS_OK;
     }
-    SWFDEC_LOG ("got a buffer with %u samples, %d skip and %u bytes mp3 data", n_samples, skip,
+    SWFDEC_LOG ("got a buffer with %u samples, %d skip and %"G_GSIZE_FORMAT" bytes mp3 data", n_samples, skip,
 	chunk->length);
     /* use this to write out the stream data to stdout - nice way to get an mp3 file :) */
     //write (1, (void *) chunk->data, chunk->length);
@@ -208,7 +208,7 @@ swfdec_sound_get_decoded (SwfdecSound *sound, SwfdecAudioFormat *format)
   sample_bytes = swfdec_audio_format_get_bytes_per_sample (sound->decoded_format);
   n_samples = sound->n_samples / swfdec_audio_format_get_granularity (sound->decoded_format);
 
-  SWFDEC_LOG ("after decoding, got %u samples, should get %u and skip %u", 
+  SWFDEC_LOG ("after decoding, got %"G_GSIZE_FORMAT" samples, should get %u and skip %u", 
       tmp->length / sample_bytes, n_samples, sound->skip);
   if (sound->skip) {
     SwfdecBuffer *tmp2 = swfdec_buffer_new_subbuffer (tmp, sound->skip * sample_bytes, 
@@ -218,7 +218,7 @@ swfdec_sound_get_decoded (SwfdecSound *sound, SwfdecAudioFormat *format)
   }
   if (tmp->length > n_samples * sample_bytes) {
     SwfdecBuffer *tmp2 = swfdec_buffer_new_subbuffer (tmp, 0, n_samples * sample_bytes);
-    SWFDEC_DEBUG ("%u samples in %u bytes should be available, but %u bytes are, cutting them off",
+    SWFDEC_DEBUG ("%u samples in %u bytes should be available, but %"G_GSIZE_FORMAT" bytes are, cutting them off",
 	n_samples, n_samples * sample_bytes, tmp->length);
     swfdec_buffer_unref (tmp);
     tmp = tmp2;
@@ -226,7 +226,7 @@ swfdec_sound_get_decoded (SwfdecSound *sound, SwfdecAudioFormat *format)
     /* we handle this case in swfdec_sound_render */
     /* FIXME: this message is important when writing new codecs, so I made it a warning.
      * It's probably not worth more than INFO for the usual case though */
-    SWFDEC_WARNING ("%u samples in %u bytes should be available, but only %u bytes are",
+    SWFDEC_WARNING ("%u samples in %u bytes should be available, but only %"G_GSIZE_FORMAT" bytes are",
 	n_samples, n_samples * sample_bytes, tmp->length);
   }
   /* only assign here, the decoding code checks this variable */
diff --git a/libswfdec/swfdec_sprite.c b/libswfdec/swfdec_sprite.c
index ae61642..f7bc576 100644
--- a/libswfdec/swfdec_sprite.c
+++ b/libswfdec/swfdec_sprite.c
@@ -87,7 +87,7 @@ swfdec_sprite_add_sound_chunk (SwfdecSprite * sprite, guint frame,
     swfdec_buffer_unref (chunk);
     return;
   }
-  SWFDEC_LOG ("adding %u samples in %u bytes to frame %u", n_samples, 
+  SWFDEC_LOG ("adding %u samples in %"G_GSIZE_FORMAT" bytes to frame %u", n_samples, 
       chunk ? chunk->length : 0, frame);
   sprite->frames[frame].sound_skip = skip;
   sprite->frames[frame].sound_block = chunk;
diff --git a/libswfdec/swfdec_swf_decoder.c b/libswfdec/swfdec_swf_decoder.c
index 28223f0..5f3b2e0 100644
--- a/libswfdec/swfdec_swf_decoder.c
+++ b/libswfdec/swfdec_swf_decoder.c
@@ -134,7 +134,7 @@ swfdec_swf_decoder_deflate (SwfdecSwfDecoder * s, SwfdecBuffer *buffer)
     guint max = buffer->length;
 
     if (dec->bytes_loaded + max > s->buffer->length) {
-      SWFDEC_WARNING ("%u bytes more than declared filesize", 
+      SWFDEC_WARNING ("%"G_GSIZE_FORMAT" bytes more than declared filesize", 
 	  dec->bytes_loaded + max - s->buffer->length);
       max = s->buffer->length - dec->bytes_loaded;
     }


More information about the Swfdec mailing list