mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 11:11:08 +00:00
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:
parent
6148f05b6e
commit
fdeea4f9dc
7 changed files with 30 additions and 18 deletions
12
ChangeLog
12
ChangeLog
|
@ -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>
|
||||
|
||||
* gst/gstminiobject.c:
|
||||
|
|
2
common
2
common
|
@ -1 +1 @@
|
|||
Subproject commit 668c3f0b72d50813c30eb04be7048f638037c571
|
||||
Subproject commit 081a00a5e25d069b15bb7f6092c8f951462cd8eb
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue