Switch to using portabl gsize/gssize instead of size_t/ssize_t

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
This commit is contained in:
Edward Hervey 2008-03-03 18:42:04 +00:00
parent 6148f05b6e
commit fdeea4f9dc
7 changed files with 30 additions and 18 deletions

View file

@ -1,3 +1,15 @@
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> 2008-03-03 Edward Hervey <edward.hervey@collabora.co.uk>
* gst/gstminiobject.c: * gst/gstminiobject.c:

2
common

@ -1 +1 @@
Subproject commit 668c3f0b72d50813c30eb04be7048f638037c571 Subproject commit 081a00a5e25d069b15bb7f6092c8f951462cd8eb

View file

@ -85,7 +85,7 @@
_inptr += strlen(_outptr) + 1 _inptr += strlen(_outptr) + 1
#if !GST_HAVE_UNALIGNED_ACCESS #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)) # define align32(_ptr) _ptr += (( alignment32(_ptr) == 0) ? 0 : 4-alignment32(_ptr))
#else #else
# define alignment32(_address) 0 # define alignment32(_address) 0
@ -104,7 +104,7 @@
*/ */
inline static gboolean inline static gboolean
gst_registry_binary_write (GstRegistry * registry, const void *mem, 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 #if !GST_HAVE_UNALIGNED_ACCESS
gchar padder[] = { 0, 0, 0, 0 }; 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 */ /* check if there are plugins in the file */
if (!(((size_t) in + sizeof (GstBinaryPluginElement)) < if (!(((gsize) in + sizeof (GstBinaryPluginElement)) <
(size_t) contents + size)) { (gsize) contents + size)) {
GST_INFO ("No binary plugins structure to read"); GST_INFO ("No binary plugins structure to read");
/* empty file, this is not an error */ /* empty file, this is not an error */
} else { } else {
for (; for (;
((size_t) in + sizeof (GstBinaryPluginElement)) < ((gsize) in + sizeof (GstBinaryPluginElement)) <
(size_t) contents + size;) { (gsize) contents + size;) {
GST_DEBUG ("reading binary registry %" G_GSIZE_FORMAT "(%x)/%" GST_DEBUG ("reading binary registry %" G_GSIZE_FORMAT "(%x)/%"
G_GSIZE_FORMAT, (size_t) in - (size_t) contents, G_GSIZE_FORMAT, (gsize) in - (gsize) contents,
(guint) ((size_t) in - (size_t) contents), size); (guint) ((gsize) in - (gsize) contents), size);
if (!gst_registry_binary_load_plugin (registry, &in)) { if (!gst_registry_binary_load_plugin (registry, &in)) {
GST_ERROR ("Problem while reading binary registry"); GST_ERROR ("Problem while reading binary registry");
goto Error; goto Error;

View file

@ -59,7 +59,7 @@ static gboolean
gst_registry_save (GstRegistry * registry, gchar * format, ...) gst_registry_save (GstRegistry * registry, gchar * format, ...)
{ {
va_list var_args; va_list var_args;
size_t written, len; gsize written, len;
gboolean ret; gboolean ret;
char *str; char *str;

View file

@ -285,7 +285,7 @@ unescape_string (const gchar * escaped_string, const gchar * illegal_characters)
} }
*out = '\0'; *out = '\0';
g_assert ((size_t) (out - result) <= strlen (escaped_string)); g_assert ((gsize) (out - result) <= strlen (escaped_string));
return result; return result;
} }
@ -397,7 +397,7 @@ gst_uri_has_protocol (const gchar * uri, const gchar * protocol)
if (colon == NULL) if (colon == NULL)
return FALSE; return FALSE;
return (strncmp (uri, protocol, (size_t) (colon - uri)) == 0); return (strncmp (uri, protocol, (gsize) (colon - uri)) == 0);
} }
/** /**

View file

@ -302,7 +302,7 @@ gst_file_sink_open_file (GstFileSink * sink)
/* see if we are asked to perform a specific kind of buffering */ /* see if we are asked to perform a specific kind of buffering */
if ((mode = sink->buffer_mode) != -1) { if ((mode = sink->buffer_mode) != -1) {
size_t buffer_size; gsize buffer_size;
/* free previous buffer if any */ /* free previous buffer if any */
g_free (sink->buffer); g_free (sink->buffer);

View file

@ -530,7 +530,7 @@ gst_mmap_buffer_finalize (GstMmapBuffer * mmap_buffer)
} }
static GstBuffer * 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) gboolean testonly)
{ {
GstBuffer *buf; GstBuffer *buf;
@ -586,7 +586,7 @@ mmap_failed:
} }
static GstBuffer * 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; GstBuffer *ret;
off_t mod; 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 the offset starts at a non-page boundary, we have to special case */
if (mod != 0) { if (mod != 0) {
size_t mapsize; gsize mapsize;
off_t mapbase; off_t mapbase;
GstBuffer *map; GstBuffer *map;
@ -633,7 +633,7 @@ gst_file_src_create_mmap (GstFileSrc * src, guint64 offset, guint length,
GstBuffer ** buffer) GstBuffer ** buffer)
{ {
GstBuffer *buf = NULL; GstBuffer *buf = NULL;
size_t readsize, mapsize; gsize readsize, mapsize;
off_t readend, mapstart, mapend; off_t readend, mapstart, mapend;
int i; 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 */ /* otherwise we will create a new mmap region and set it to the default */
} else { } else {
size_t mapsize; gsize mapsize;
off_t nextmap = offset - (offset % src->mapsize); off_t nextmap = offset - (offset % src->mapsize);