2008-03-03 Edward Hervey <edward.hervey@collabora.co.uk>
+ * 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 <edward.hervey@collabora.co.uk>
+
* gst/gstminiobject.c:
Import gst_private.h before any other header that might include other
glib headers. This fixes the build on windows using native compilers.
-Subproject commit 668c3f0b72d50813c30eb04be7048f638037c571
+Subproject commit 081a00a5e25d069b15bb7f6092c8f951462cd8eb
_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
*/
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 };
/* 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;
gst_registry_save (GstRegistry * registry, gchar * format, ...)
{
va_list var_args;
- size_t written, len;
+ gsize written, len;
gboolean ret;
char *str;
}
*out = '\0';
- g_assert ((size_t) (out - result) <= strlen (escaped_string));
+ g_assert ((gsize) (out - result) <= strlen (escaped_string));
return result;
}
if (colon == NULL)
return FALSE;
- return (strncmp (uri, protocol, (size_t) (colon - uri)) == 0);
+ return (strncmp (uri, protocol, (gsize) (colon - uri)) == 0);
}
/**
/* 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);
}
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;
}
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;
/* 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;
GstBuffer ** buffer)
{
GstBuffer *buf = NULL;
- size_t readsize, mapsize;
+ gsize readsize, mapsize;
off_t readend, mapstart, mapend;
int i;
/* 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);