From bd16d69148e91a8eecf9c2564289af8826e34701 Mon Sep 17 00:00:00 2001 From: Jan David Mol Date: Thu, 2 Nov 2006 13:00:38 +0000 Subject: [PATCH] plugins/elements/: Printf fixes for gsize parameters on PPC/OSX (#369366). Also, don't cast to long long for portabil... Original commit message from CVS: Based on patch by: Jan David Mol * plugins/elements/gstfilesink.c: (gst_file_sink_class_init): * plugins/elements/gstfilesrc.c: (gst_file_src_class_init), (gst_file_src_map_small_region), (gst_file_src_create_mmap): Printf fixes for gsize parameters on PPC/OSX (#369366). Also, don't cast to long long for portability reasons, but use GLib's types instead. --- ChangeLog | 11 +++++++++++ plugins/elements/gstfilesink.c | 3 ++- plugins/elements/gstfilesrc.c | 31 +++++++++++++++---------------- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 07f3aef..6d1e634 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2006-11-02 Tim-Philipp Müller + + Based on patch by: Jan David Mol + + * plugins/elements/gstfilesink.c: (gst_file_sink_class_init): + * plugins/elements/gstfilesrc.c: (gst_file_src_class_init), + (gst_file_src_map_small_region), (gst_file_src_create_mmap): + Printf fixes for gsize parameters on PPC/OSX (#369366). Also, + don't cast to long long for portability reasons, but use + GLib's types instead. + 2006-10-30 Michael Smith * plugins/elements/gstfdsrc.c: (gst_fd_src_update_fd): diff --git a/plugins/elements/gstfilesink.c b/plugins/elements/gstfilesink.c index 5637539..14d4439 100644 --- a/plugins/elements/gstfilesink.c +++ b/plugins/elements/gstfilesink.c @@ -140,7 +140,8 @@ gst_file_sink_class_init (GstFileSinkClass * klass) gstbasesink_class->event = GST_DEBUG_FUNCPTR (gst_file_sink_event); if (sizeof (off_t) < 8) { - GST_LOG ("No large file support, sizeof (off_t) = %u", sizeof (off_t)); + GST_LOG ("No large file support, sizeof (off_t) = %" G_GSIZE_FORMAT "!", + sizeof (off_t)); } } diff --git a/plugins/elements/gstfilesrc.c b/plugins/elements/gstfilesrc.c index f450f60..0511154 100644 --- a/plugins/elements/gstfilesrc.c +++ b/plugins/elements/gstfilesrc.c @@ -260,7 +260,8 @@ gst_file_src_class_init (GstFileSrcClass * klass) gstbasesrc_class->create = GST_DEBUG_FUNCPTR (gst_file_src_create); if (sizeof (off_t) < 8) { - GST_LOG ("No large file support, sizeof (off_t) = %u!", sizeof (off_t)); + GST_LOG ("No large file support, sizeof (off_t) = %" G_GSIZE_FORMAT "!", + sizeof (off_t)); } } @@ -590,8 +591,8 @@ gst_file_src_map_small_region (GstFileSrc * src, off_t offset, size_t size) guint pagesize; GST_LOG_OBJECT (src, - "attempting to map a small buffer at %llu+%d", - (unsigned long long) offset, (gint) size); + "attempting to map a small buffer at %" G_GUINT64_FORMAT "+%d", + (guint64) offset, (gint) size); pagesize = src->pagesize; @@ -607,8 +608,8 @@ gst_file_src_map_small_region (GstFileSrc * src, off_t offset, size_t size) mapsize = ((size + mod + pagesize - 1) / pagesize) * pagesize; GST_LOG_OBJECT (src, - "not on page boundaries, resizing to map to %llu+%d", - (unsigned long long) mapbase, (gint) mapsize); + "not on page boundaries, resizing to map to %" G_GUINT64_FORMAT "+%d", + (guint64) mapbase, (gint) mapsize); map = gst_file_src_map_region (src, mapbase, mapsize, FALSE); if (map == NULL) @@ -651,18 +652,17 @@ gst_file_src_create_mmap (GstFileSrc * src, guint64 offset, guint length, /* if the end is before the mapend, the buffer is in current mmap region... */ /* ('cause by definition if readend is in the buffer, so's readstart) */ if (readend <= mapend) { - GST_LOG_OBJECT (src, - "read buf %llu+%d lives in current mapbuf %lld+%d, creating subbuffer of mapbuf", - offset, (int) readsize, mapstart, mapsize); + GST_LOG_OBJECT (src, "read buf %" G_GUINT64_FORMAT "+%u lives in " + "current mapbuf %u+%u, creating subbuffer of mapbuf", + offset, (guint) readsize, (guint) mapstart, (guint) mapsize); buf = gst_buffer_create_sub (src->mapbuf, offset - mapstart, readsize); GST_BUFFER_OFFSET (buf) = offset; /* if the start actually is within the current mmap region, map an overlap buffer */ } else if (offset < mapend) { - GST_LOG_OBJECT (src, - "read buf %llu+%d starts in mapbuf %d+%d but ends outside, creating new mmap", - (unsigned long long) offset, (gint) readsize, (gint) mapstart, - (gint) mapsize); + GST_LOG_OBJECT (src, "read buf %" G_GUINT64_FORMAT "+%u starts in " + "mapbuf %u+%u but ends outside, creating new mmap", + offset, (guint) readsize, (guint) mapstart, (guint) mapsize); buf = gst_file_src_map_small_region (src, offset, readsize); if (buf == NULL) goto could_not_mmap; @@ -676,10 +676,9 @@ gst_file_src_create_mmap (GstFileSrc * src, guint64 offset, guint length, /* either the read buffer overlaps the start of the mmap region */ /* or the read buffer fully contains the current mmap region */ /* either way, it's really not relevant, we just create a new region anyway */ - GST_LOG_OBJECT (src, - "read buf %llu+%d starts before mapbuf %d+%d, but overlaps it", - (unsigned long long) offset, (gint) readsize, (gint) mapstart, - (gint) mapsize); + GST_LOG_OBJECT (src, "read buf %" G_GUINT64_FORMAT "+%d starts before " + "mapbuf %d+%d, but overlaps it", (guint64) offset, (gint) readsize, + (gint) mapstart, (gint) mapsize); buf = gst_file_src_map_small_region (src, offset, readsize); if (buf == NULL) goto could_not_mmap; -- 2.7.4