Switch to using portabl gsize/gssize instead of size_t/ssize_t
authorEdward Hervey <bilboed@bilboed.com>
Mon, 3 Mar 2008 18:42:04 +0000 (18:42 +0000)
committerEdward Hervey <bilboed@bilboed.com>
Mon, 3 Mar 2008 18:42:04 +0000 (18:42 +0000)
Original commit message from CVS:
* 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

ChangeLog
common
gst/gstregistrybinary.c
gst/gstregistryxml.c
gst/gsturi.c
plugins/elements/gstfilesink.c
plugins/elements/gstfilesrc.c

index ae49da0..b24d779 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 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.
diff --git a/common b/common
index 668c3f0..081a00a 160000 (submodule)
--- a/common
+++ b/common
@@ -1 +1 @@
-Subproject commit 668c3f0b72d50813c30eb04be7048f638037c571
+Subproject commit 081a00a5e25d069b15bb7f6092c8f951462cd8eb
index fc7ebd1..8fdce5b 100644 (file)
@@ -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
  */
 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;
index ab3f3b1..d70fc57 100644 (file)
@@ -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;
 
index 33727c3..7475894 100644 (file)
@@ -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);
 }
 
 /**
index 38c8b40..86cc5ca 100644 (file)
@@ -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);
index 814cf70..3b323cd 100644 (file)
@@ -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);