From 136e5d254e37ac2854d396ef724d1f1344fe7134 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 10 Feb 2003 20:16:38 +0000 Subject: [PATCH] Small cleanups and portability fixes for GUINT64 Original commit message from CVS: Small cleanups and portability fixes for GUINT64 --- gst/gstclock.h | 8 ++++---- gst/gstformat.h | 4 ++-- gst/gstindex.c | 4 ++-- gst/gstquery.h | 4 ++-- gst/gstqueue.c | 10 +++++----- plugins/elements/gstqueue.c | 10 +++++----- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/gst/gstclock.h b/gst/gstclock.h index 8672818..2788f45 100644 --- a/gst/gstclock.h +++ b/gst/gstclock.h @@ -41,10 +41,10 @@ typedef gpointer GstClockID; #define GST_CLOCK_TIME_NONE ((guint64)-1) -#define GST_SECOND ((guint64) G_USEC_PER_SEC * 1000LL) -#define GST_MSECOND ((guint64) GST_SECOND / 1000LL) -#define GST_USECOND ((guint64) GST_SECOND / 1000000LL) -#define GST_NSECOND ((guint64) GST_SECOND / 1000000000LL) +#define GST_SECOND ((guint64) G_USEC_PER_SEC * G_GINT64_CONSTANT (1000)) +#define GST_MSECOND ((guint64) GST_SECOND / G_GINT64_CONSTANT (1000)) +#define GST_USECOND ((guint64) GST_SECOND / G_GINT64_CONSTANT (1000000)) +#define GST_NSECOND ((guint64) GST_SECOND / G_GINT64_CONSTANT (1000000000)) #define GST_CLOCK_DIFF(s, e) (GstClockTimeDiff)((s) - (e)) #define GST_TIMEVAL_TO_TIME(tv) ((tv).tv_sec * GST_SECOND + (tv).tv_usec * GST_USECOND) diff --git a/gst/gstformat.h b/gst/gstformat.h index 8616ce0..74347ec 100644 --- a/gst/gstformat.h +++ b/gst/gstformat.h @@ -41,8 +41,8 @@ typedef enum { } GstFormat; /* a percentage is always relative to 1000000 */ -#define GST_FORMAT_PERCENT_MAX 1000000LL -#define GST_FORMAT_PERCENT_SCALE 10000LL +#define GST_FORMAT_PERCENT_MAX G_GINT64_CONSTANT (1000000) +#define GST_FORMAT_PERCENT_SCALE G_GINT64_CONSTANT (10000) typedef struct _GstFormatDefinition GstFormatDefinition; diff --git a/gst/gstindex.c b/gst/gstindex.c index b95155d..b100b07 100644 --- a/gst/gstindex.c +++ b/gst/gstindex.c @@ -89,7 +89,7 @@ gst_index_resolver_get_type (void) } GType -gst_index_get_type(void) { +gst_index_get_type (void) { static GType index_type = 0; if (!index_type) { @@ -216,7 +216,7 @@ gst_index_group_new(guint groupnum) * Returns: a new index object */ GstIndex* -gst_index_new() +gst_index_new (void) { GstIndex *index; diff --git a/gst/gstquery.h b/gst/gstquery.h index dbe9fc3..e8b6c01 100644 --- a/gst/gstquery.h +++ b/gst/gstquery.h @@ -39,8 +39,8 @@ typedef enum { GST_QUERY_RATE } GstQueryType; -/* rate is relative to 1000000LL */ -#define GST_QUERY_TYPE_RATE_DEN 1000000LL +/* rate is relative to 1000000 */ +#define GST_QUERY_TYPE_RATE_DEN G_GINT64_CONSTANT (1000000) typedef struct _GstQueryTypeDefinition GstQueryTypeDefinition; diff --git a/gst/gstqueue.c b/gst/gstqueue.c index 040ecbb..588b656 100644 --- a/gst/gstqueue.c +++ b/gst/gstqueue.c @@ -229,10 +229,10 @@ gst_queue_init (GstQueue *queue) queue->queue = NULL; queue->level_buffers = 0; queue->level_bytes = 0; - queue->level_time = 0LL; - queue->size_buffers = 100; /* 100 buffers */ - queue->size_bytes = 100 * 1024; /* 100KB */ - queue->size_time = 1000000000LL; /* 1sec */ + queue->level_time = G_GINT64_CONSTANT (0); + queue->size_buffers = 100; /* 100 buffers */ + queue->size_bytes = 100 * 1024; /* 100KB */ + queue->size_time = G_GINT64_CONSTANT (1000000000); /* 1sec */ queue->may_deadlock = TRUE; queue->block_timeout = -1; queue->interrupt = FALSE; @@ -293,7 +293,7 @@ gst_queue_locked_flush (GstQueue *queue) queue->timeval = NULL; queue->level_buffers = 0; queue->level_bytes = 0; - queue->level_time = 0LL; + queue->level_time = G_GINT64_CONSTANT (0); /* make sure any pending buffers to be added are flushed too */ queue->flush = TRUE; } diff --git a/plugins/elements/gstqueue.c b/plugins/elements/gstqueue.c index 040ecbb..588b656 100644 --- a/plugins/elements/gstqueue.c +++ b/plugins/elements/gstqueue.c @@ -229,10 +229,10 @@ gst_queue_init (GstQueue *queue) queue->queue = NULL; queue->level_buffers = 0; queue->level_bytes = 0; - queue->level_time = 0LL; - queue->size_buffers = 100; /* 100 buffers */ - queue->size_bytes = 100 * 1024; /* 100KB */ - queue->size_time = 1000000000LL; /* 1sec */ + queue->level_time = G_GINT64_CONSTANT (0); + queue->size_buffers = 100; /* 100 buffers */ + queue->size_bytes = 100 * 1024; /* 100KB */ + queue->size_time = G_GINT64_CONSTANT (1000000000); /* 1sec */ queue->may_deadlock = TRUE; queue->block_timeout = -1; queue->interrupt = FALSE; @@ -293,7 +293,7 @@ gst_queue_locked_flush (GstQueue *queue) queue->timeval = NULL; queue->level_buffers = 0; queue->level_bytes = 0; - queue->level_time = 0LL; + queue->level_time = G_GINT64_CONSTANT (0); /* make sure any pending buffers to be added are flushed too */ queue->flush = TRUE; } -- 2.7.4