diff --git a/ChangeLog b/ChangeLog index ae49da0199..b24d779559 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-03-03 Edward Hervey + + * gst/gstregistrybinary.c: (gst_registry_binary_write), + (gst_registry_binary_read_cache): + * gst/gstregistryxml.c: (gst_registry_save): + * gst/gsturi.c: (unescape_string), (gst_uri_has_protocol): + * plugins/elements/gstfilesink.c: (gst_file_sink_open_file): + * plugins/elements/gstfilesrc.c: (gst_file_src_map_region), + (gst_file_src_map_small_region), (gst_file_src_create_mmap): + Switch to using portabl gsize/gssize instead of size_t/ssize_t + Fixes #520152 + 2008-03-03 Edward Hervey * gst/gstminiobject.c: diff --git a/common b/common index 668c3f0b72..081a00a5e2 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 668c3f0b72d50813c30eb04be7048f638037c571 +Subproject commit 081a00a5e25d069b15bb7f6092c8f951462cd8eb diff --git a/gst/gstregistrybinary.c b/gst/gstregistrybinary.c index fc7ebd1ca3..8fdce5b814 100644 --- a/gst/gstregistrybinary.c +++ b/gst/gstregistrybinary.c @@ -85,7 +85,7 @@ _inptr += strlen(_outptr) + 1 #if !GST_HAVE_UNALIGNED_ACCESS -# define alignment32(_address) (size_t)_address%4 +# define alignment32(_address) (gsize)_address%4 # define align32(_ptr) _ptr += (( alignment32(_ptr) == 0) ? 0 : 4-alignment32(_ptr)) #else # define alignment32(_address) 0 @@ -104,7 +104,7 @@ */ inline static gboolean gst_registry_binary_write (GstRegistry * registry, const void *mem, - const ssize_t size, unsigned long *file_position, gboolean align) + const gssize size, unsigned long *file_position, gboolean align) { #if !GST_HAVE_UNALIGNED_ACCESS gchar padder[] = { 0, 0, 0, 0 }; @@ -942,17 +942,17 @@ gst_registry_binary_read_cache (GstRegistry * registry, const char *location) /* check if there are plugins in the file */ - if (!(((size_t) in + sizeof (GstBinaryPluginElement)) < - (size_t) contents + size)) { + if (!(((gsize) in + sizeof (GstBinaryPluginElement)) < + (gsize) contents + size)) { GST_INFO ("No binary plugins structure to read"); /* empty file, this is not an error */ } else { for (; - ((size_t) in + sizeof (GstBinaryPluginElement)) < - (size_t) contents + size;) { + ((gsize) in + sizeof (GstBinaryPluginElement)) < + (gsize) contents + size;) { GST_DEBUG ("reading binary registry %" G_GSIZE_FORMAT "(%x)/%" - G_GSIZE_FORMAT, (size_t) in - (size_t) contents, - (guint) ((size_t) in - (size_t) contents), size); + G_GSIZE_FORMAT, (gsize) in - (gsize) contents, + (guint) ((gsize) in - (gsize) contents), size); if (!gst_registry_binary_load_plugin (registry, &in)) { GST_ERROR ("Problem while reading binary registry"); goto Error; diff --git a/gst/gstregistryxml.c b/gst/gstregistryxml.c index ab3f3b1ca5..d70fc57d6b 100644 --- a/gst/gstregistryxml.c +++ b/gst/gstregistryxml.c @@ -59,7 +59,7 @@ static gboolean gst_registry_save (GstRegistry * registry, gchar * format, ...) { va_list var_args; - size_t written, len; + gsize written, len; gboolean ret; char *str; diff --git a/gst/gsturi.c b/gst/gsturi.c index 33727c3cd2..7475894514 100644 --- a/gst/gsturi.c +++ b/gst/gsturi.c @@ -285,7 +285,7 @@ unescape_string (const gchar * escaped_string, const gchar * illegal_characters) } *out = '\0'; - g_assert ((size_t) (out - result) <= strlen (escaped_string)); + g_assert ((gsize) (out - result) <= strlen (escaped_string)); return result; } @@ -397,7 +397,7 @@ gst_uri_has_protocol (const gchar * uri, const gchar * protocol) if (colon == NULL) return FALSE; - return (strncmp (uri, protocol, (size_t) (colon - uri)) == 0); + return (strncmp (uri, protocol, (gsize) (colon - uri)) == 0); } /** diff --git a/plugins/elements/gstfilesink.c b/plugins/elements/gstfilesink.c index 38c8b409af..86cc5caeff 100644 --- a/plugins/elements/gstfilesink.c +++ b/plugins/elements/gstfilesink.c @@ -302,7 +302,7 @@ gst_file_sink_open_file (GstFileSink * sink) /* see if we are asked to perform a specific kind of buffering */ if ((mode = sink->buffer_mode) != -1) { - size_t buffer_size; + gsize buffer_size; /* free previous buffer if any */ g_free (sink->buffer); diff --git a/plugins/elements/gstfilesrc.c b/plugins/elements/gstfilesrc.c index 814cf701bf..3b323cdf8b 100644 --- a/plugins/elements/gstfilesrc.c +++ b/plugins/elements/gstfilesrc.c @@ -530,7 +530,7 @@ gst_mmap_buffer_finalize (GstMmapBuffer * mmap_buffer) } static GstBuffer * -gst_file_src_map_region (GstFileSrc * src, off_t offset, size_t size, +gst_file_src_map_region (GstFileSrc * src, off_t offset, gsize size, gboolean testonly) { GstBuffer *buf; @@ -586,7 +586,7 @@ mmap_failed: } static GstBuffer * -gst_file_src_map_small_region (GstFileSrc * src, off_t offset, size_t size) +gst_file_src_map_small_region (GstFileSrc * src, off_t offset, gsize size) { GstBuffer *ret; off_t mod; @@ -602,7 +602,7 @@ gst_file_src_map_small_region (GstFileSrc * src, off_t offset, size_t size) /* if the offset starts at a non-page boundary, we have to special case */ if (mod != 0) { - size_t mapsize; + gsize mapsize; off_t mapbase; GstBuffer *map; @@ -633,7 +633,7 @@ gst_file_src_create_mmap (GstFileSrc * src, guint64 offset, guint length, GstBuffer ** buffer) { GstBuffer *buf = NULL; - size_t readsize, mapsize; + gsize readsize, mapsize; off_t readend, mapstart, mapend; int i; @@ -703,7 +703,7 @@ gst_file_src_create_mmap (GstFileSrc * src, guint64 offset, guint length, /* otherwise we will create a new mmap region and set it to the default */ } else { - size_t mapsize; + gsize mapsize; off_t nextmap = offset - (offset % src->mapsize);