Commit 393033c6 authored by David Schleef's avatar David Schleef
Browse files

Convert %lld and %llu in printf formats to G_G[U]INT64_FORMAT. Fix...

Convert %lld and %llu in printf formats to G_G[U]INT64_FORMAT.  Fix pointer<->int conversion.  Fixes warnings on alpha.

Original commit message from CVS:
Convert %lld and %llu in printf formats to G_G[U]INT64_FORMAT.  Fix
pointer<->int conversion.  Fixes warnings on alpha.
parent 2c4d0a7e
......@@ -45,7 +45,7 @@ property_change_callback (GObject *object, GstObject *orig, GParamSpec *pspec)
else if (G_IS_PARAM_SPEC_ENUM (pspec))
str = g_strdup_printf ("%d", g_value_get_enum (&value));
else if (G_IS_PARAM_SPEC_INT64 (pspec))
str = g_strdup_printf ("%lld", g_value_get_int64 (&value));
str = g_strdup_printf ("%" G_GINT64_FORMAT, g_value_get_int64 (&value));
else
str = g_strdup_value_contents (&value);
......
......@@ -597,7 +597,8 @@ cothread_switch (cothread_state *cothread)
ctx->current, cothread->cothreadnum);
ctx->current = cothread->cothreadnum;
g_static_private_set (&_gst_debug_cothread_index, (void *)ctx->current, NULL);
g_static_private_set (&_gst_debug_cothread_index,
GINT_TO_POINTER(ctx->current), NULL);
/* save the current stack pointer, frame pointer, and pc */
#ifdef GST_ARCH_PRESETJMP
......
......@@ -268,7 +268,8 @@ gst_aggregator_push (GstAggregator *aggregator, GstPad *pad, GstBuffer *buf, guc
if (!aggregator->silent) {
g_free (aggregator->last_message);
aggregator->last_message = g_strdup_printf ("%10.10s ******* (%s:%s)a (%d bytes, %llu)",
aggregator->last_message = g_strdup_printf ("%10.10s ******* (%s:%s)a (%d bytes, %"
G_GUINT64_FORMAT ")",
debug, GST_DEBUG_PAD_NAME (pad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
g_object_notify (G_OBJECT (aggregator), "last_message");
......
......@@ -291,7 +291,8 @@ gst_fakesink_chain (GstPad *pad, GstBuffer *buf)
if (!fakesink->silent) {
g_free (fakesink->last_message);
fakesink->last_message = g_strdup_printf ("chain ******* (%s:%s)< (%d bytes, %lld, %d) %p",
fakesink->last_message = g_strdup_printf ("chain ******* (%s:%s)< (%d bytes, %"
G_GINT64_FORMAT ", %d) %p",
GST_DEBUG_PAD_NAME (pad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf),
GST_BUFFER_FLAGS (buf), buf);
......
......@@ -763,7 +763,8 @@ gst_fakesrc_get(GstPad *pad)
if (!src->silent) {
g_free (src->last_message);
src->last_message = g_strdup_printf ("get ******* (%s:%s)> (%d bytes, %llu) %p",
src->last_message = g_strdup_printf ("get ******* (%s:%s)> (%d bytes, %"
G_GUINT64_FORMAT " ) %p",
GST_DEBUG_PAD_NAME (pad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf), buf);
g_object_notify (G_OBJECT (src), "last_message");
......
......@@ -367,8 +367,11 @@ gst_filesrc_free_parent_mmap (GstBuffer *buf)
#endif
/* now unmap the memory */
munmap (GST_BUFFER_DATA (buf), GST_BUFFER_MAXSIZE (buf));
GST_DEBUG (0, "unmapped region %08llx+%08llx at %p",
GST_BUFFER_OFFSET (buf), GST_BUFFER_MAXSIZE (buf),
/* cast to unsigned long, since there's no gportable way to print
* guint64 as hex */
GST_DEBUG (0, "unmapped region %08lx+%08lx at %p",
(unsigned long) GST_BUFFER_OFFSET (buf),
(unsigned long) GST_BUFFER_MAXSIZE (buf),
GST_BUFFER_DATA (buf));
GST_BUFFER_DATA (buf) = NULL;
......@@ -397,8 +400,8 @@ gst_filesrc_map_region (GstFileSrc *src, off_t offset, size_t size)
size, src->fd, offset, strerror (errno));
return NULL;
}
GST_DEBUG (0, "mapped region %08llx+%08x from file into memory at %p",
offset, size, mmapregion);
GST_DEBUG (0, "mapped region %08lx+%08lx from file into memory at %p",
(unsigned long)offset, (unsigned long)size, mmapregion);
/* time to allocate a new mapbuf */
buf = gst_buffer_new ();
......@@ -514,7 +517,8 @@ gst_filesrc_get (GstPad *pad)
/* check for EOF */
if (src->curoffset == src->filelen) {
GST_DEBUG (0, "filesrc eos %lld %lld", src->curoffset, src->filelen);
GST_DEBUG (0, "filesrc eos %" G_GINT64_FORMAT
" %" G_GINT64_FORMAT, src->curoffset, src->filelen);
gst_element_set_eos (GST_ELEMENT (src));
return GST_BUFFER (gst_event_new (GST_EVENT_EOS));
}
......@@ -531,8 +535,9 @@ gst_filesrc_get (GstPad *pad)
readend = src->curoffset + readsize;
}
GST_DEBUG (0, "attempting to read %08x, %08llx, %08llx, %08llx",
readsize, readend, mapstart, mapend);
GST_DEBUG (0, "attempting to read %08lx, %08lx, %08lx, %08lx",
(unsigned long)readsize, (unsigned long)readend,
(unsigned long)mapstart, (unsigned long)mapend);
/* if the start is past the mapstart */
if (src->curoffset >= mapstart) {
......@@ -787,19 +792,19 @@ gst_filesrc_srcpad_event (GstPad *pad, GstEvent *event)
if (offset > src->filelen)
goto error;
src->curoffset = offset;
GST_DEBUG(0, "seek set pending to %lld", src->curoffset);
GST_DEBUG(0, "seek set pending to %" G_GINT64_FORMAT, src->curoffset);
break;
case GST_SEEK_METHOD_CUR:
if (offset + src->curoffset > src->filelen)
goto error;
src->curoffset += offset;
GST_DEBUG(0, "seek cur pending to %lld", src->curoffset);
GST_DEBUG(0, "seek cur pending to %" G_GINT64_FORMAT, src->curoffset);
break;
case GST_SEEK_METHOD_END:
if (ABS (offset) > src->filelen)
goto error;
src->curoffset = src->filelen - ABS (offset);
GST_DEBUG(0, "seek end pending to %lld", src->curoffset);
GST_DEBUG(0, "seek end pending to %" G_GINT64_FORMAT, src->curoffset);
break;
default:
goto error;
......
......@@ -220,7 +220,8 @@ gst_identity_chain (GstPad *pad, GstBuffer *buf)
if (identity->last_message != NULL) {
g_free (identity->last_message);
}
identity->last_message = g_strdup_printf ("dropping ******* (%s:%s)i (%d bytes, %llu)",
identity->last_message = g_strdup_printf ("dropping ******* (%s:%s)i (%d bytes, %"
G_GINT64_FORMAT ")",
GST_DEBUG_PAD_NAME (identity->sinkpad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
g_object_notify (G_OBJECT (identity), "last-message");
gst_buffer_unref (buf);
......@@ -234,7 +235,8 @@ gst_identity_chain (GstPad *pad, GstBuffer *buf)
for (i = identity->duplicate; i; i--) {
if (!identity->silent) {
g_free (identity->last_message);
identity->last_message = g_strdup_printf ("chain ******* (%s:%s)i (%d bytes, %llu)",
identity->last_message = g_strdup_printf ("chain ******* (%s:%s)i (%d bytes, %"
G_GINT64_FORMAT ")",
GST_DEBUG_PAD_NAME (identity->sinkpad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
g_object_notify (G_OBJECT (identity), "last-message");
}
......
......@@ -208,7 +208,9 @@ print_stats(gboolean first, const gchar *name, const gchar *type, stats *base, s
delta.bytes = final->bytes - base->bytes;
delta.events = final->events - base->events;
g_print("%s: (%s) %s: s:%g buffers:%lld bytes:%lld events:%lld\n",
g_print("%s: (%s) %s: s:%g buffers:%" G_GINT64_FORMAT
" bytes:%" G_GINT64_FORMAT
" events:%" G_GINT64_FORMAT "\n",
first ? header0 : headerN,
name, type, time,
final->buffers,
......
......@@ -301,7 +301,8 @@ gst_tee_chain (GstPad *pad, GstBuffer *buf)
if (!tee->silent) {
g_free (tee->last_message);
tee->last_message = g_strdup_printf ("chain ******* (%s:%s)t (%d bytes, %llu) %p",
tee->last_message = g_strdup_printf ("chain ******* (%s:%s)t (%d bytes, %"
G_GUINT64_FORMAT ") %p",
GST_DEBUG_PAD_NAME (outpad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf), buf);
g_object_notify (G_OBJECT (tee), "last_message");
}
......
......@@ -195,7 +195,7 @@ gst_default_debug_handler (gint category, gboolean incore,
gchar *empty = "";
gchar *elementname = empty,*location = empty;
int pid = getpid();
int cothread_id = (int) g_static_private_get(&_gst_debug_cothread_index);
int cothread_id = GPOINTER_TO_INT(g_static_private_get(&_gst_debug_cothread_index));
#ifdef GST_DEBUG_COLOR
int pid_color = pid%6 + 31;
int cothread_color = (cothread_id < 0) ? 37 : (cothread_id%6 + 31);
......@@ -307,7 +307,7 @@ gst_default_info_handler (gint category, gboolean incore,
gchar *empty = "";
gchar *elementname = empty,*location = empty;
int pid = getpid();
int cothread_id = (int) g_static_private_get(&_gst_debug_cothread_index);
int cothread_id = GPOINTER_TO_INT(g_static_private_get(&_gst_debug_cothread_index));
#ifdef GST_DEBUG_COLOR
int pid_color = pid%6 + 31;
int cothread_color = (cothread_id < 0) ? 37 : (cothread_id%6 + 31);
......
......@@ -143,7 +143,8 @@ gst_system_clock_wait (GstClock *clock, GstClockEntry *entry)
diff = GST_CLOCK_ENTRY_TIME (entry) - current;
if (ABS (diff) > clock->max_diff) {
g_warning ("abnormal clock request diff: ABS(%lld) > %lld", diff, clock->max_diff);
g_warning ("abnormal clock request diff: ABS(%" G_GINT64_FORMAT
") > %" G_GINT64_FORMAT, diff, clock->max_diff);
return GST_CLOCK_ENTRY_EARLY;
}
......
......@@ -118,7 +118,7 @@ gst_trace_text_flush (GstTrace * trace)
}
for (i = 0; i < trace->bufoffset; i++) {
snprintf (str, strsize, "%20lld %10d %10d %s\n",
snprintf (str, strsize, "%20" G_GINT64_FORMAT " %10d %10d %s\n",
trace->buf[i].timestamp,
trace->buf[i].sequence, trace->buf[i].data, trace->buf[i].message);
write (trace->fd, str, strlen (str));
......
......@@ -184,7 +184,10 @@ gst_dparam_set_property (GObject *object, guint prop_id, const GValue *value, GP
break;
case ARG_VALUE_INT64:
GST_DEBUG(GST_CAT_PARAMS, "setting value from %lld to %lld", dparam->value_int64, g_value_get_int64 (value));
GST_DEBUG(GST_CAT_PARAMS, "setting value from %"
G_GINT64_FORMAT " to %"
G_GINT64_FORMAT,
dparam->value_int64, g_value_get_int64 (value));
dparam->value_int64 = g_value_get_int (value);
GST_DPARAM_NEXT_UPDATE_TIMESTAMP(dparam) = GST_DPARAM_LAST_UPDATE_TIMESTAMP(dparam);
GST_DPARAM_READY_FOR_UPDATE(dparam) = TRUE;
......
......@@ -157,7 +157,9 @@ gst_dpsmooth_set_property (GObject *object, guint prop_id, const GValue *value,
case ARG_SLOPE_TIME:
dpsmooth->slope_time = g_value_get_int64 (value);
GST_DEBUG(GST_CAT_PARAMS, "dpsmooth->slope_time:%lld",dpsmooth->slope_time);
GST_DEBUG(GST_CAT_PARAMS, "dpsmooth->slope_time:%"
G_GINT64_FORMAT,
dpsmooth->slope_time);
GST_DPARAM_READY_FOR_UPDATE(dparam) = TRUE;
break;
......@@ -219,7 +221,8 @@ gst_dpsmooth_value_changed_float (GstDParam *dparam)
dpsmooth->need_interp_times = TRUE;
GST_DEBUG(GST_CAT_PARAMS, "%f to %f ratio:%f duration:%lld\n",
GST_DEBUG(GST_CAT_PARAMS, "%f to %f ratio:%f duration:%"
G_GINT64_FORMAT "\n",
dpsmooth->start_float, dparam->value_float, time_ratio, dpsmooth->duration_interp);
}
......@@ -246,7 +249,8 @@ gst_dpsmooth_do_update_float (GstDParam *dparam, gint64 timestamp, GValue *value
}
dpsmooth->current_float = dparam->value_float;
GST_DEBUG(GST_CAT_PARAMS, "interp finished at %lld", timestamp);
GST_DEBUG(GST_CAT_PARAMS, "interp finished at %"
G_GINT64_FORMAT, timestamp);
GST_DPARAM_LAST_UPDATE_TIMESTAMP(dparam) = timestamp;
GST_DPARAM_NEXT_UPDATE_TIMESTAMP(dparam) = timestamp;
......@@ -266,7 +270,7 @@ gst_dpsmooth_do_update_float (GstDParam *dparam, gint64 timestamp, GValue *value
GST_DPARAM_LAST_UPDATE_TIMESTAMP(dparam) = timestamp;
GST_DPARAM_NEXT_UPDATE_TIMESTAMP(dparam) = dpsmooth->start_interp + dpsmooth->update_period;
GST_DEBUG(GST_CAT_PARAMS, "interp started at %lld", timestamp);
GST_DEBUG(GST_CAT_PARAMS, "interp started at %" G_GINT64_FORMAT, timestamp);
GST_DPARAM_UNLOCK(dparam);
return;
......@@ -275,7 +279,7 @@ gst_dpsmooth_do_update_float (GstDParam *dparam, gint64 timestamp, GValue *value
time_ratio = (gfloat)(timestamp - dpsmooth->start_interp) / (gfloat)dpsmooth->duration_interp;
GST_DEBUG(GST_CAT_PARAMS, "start:%lld current:%lld end:%lld ratio%f", dpsmooth->start_interp, timestamp, dpsmooth->end_interp, time_ratio);
GST_DEBUG(GST_CAT_PARAMS, "start:%" G_GINT64_FORMAT " current:%" G_GINT64_FORMAT " end:%" G_GINT64_FORMAT " ratio%f", dpsmooth->start_interp, timestamp, dpsmooth->end_interp, time_ratio);
GST_DEBUG(GST_CAT_PARAMS, "pre start:%f current:%f target:%f", dpsmooth->start_float, dpsmooth->current_float, dparam->value_float);
dpsmooth->current_float = dpsmooth->start_float + (dpsmooth->diff_float * time_ratio);
......
......@@ -810,7 +810,10 @@ gst_dpman_preprocess_asynchronous(GstDParamManager *dpman, guint frames, gint64
dpwrap->next_update_frame = (guint)(current_time - timestamp) / dpman->rate_ratio;
updates_pending = TRUE;
GST_DEBUG(GST_CAT_PARAMS, "timestamp start: %lld end: %lld current: %lld",
GST_DEBUG(GST_CAT_PARAMS, "timestamp start: %"
G_GINT64_FORMAT " end: %"
G_GINT64_FORMAT " current: %"
G_GINT64_FORMAT,
timestamp, dpman->time_buffer_ends, current_time);
}
......
......@@ -268,7 +268,8 @@ gst_aggregator_push (GstAggregator *aggregator, GstPad *pad, GstBuffer *buf, guc
if (!aggregator->silent) {
g_free (aggregator->last_message);
aggregator->last_message = g_strdup_printf ("%10.10s ******* (%s:%s)a (%d bytes, %llu)",
aggregator->last_message = g_strdup_printf ("%10.10s ******* (%s:%s)a (%d bytes, %"
G_GUINT64_FORMAT ")",
debug, GST_DEBUG_PAD_NAME (pad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
g_object_notify (G_OBJECT (aggregator), "last_message");
......
......@@ -291,7 +291,8 @@ gst_fakesink_chain (GstPad *pad, GstBuffer *buf)
if (!fakesink->silent) {
g_free (fakesink->last_message);
fakesink->last_message = g_strdup_printf ("chain ******* (%s:%s)< (%d bytes, %lld, %d) %p",
fakesink->last_message = g_strdup_printf ("chain ******* (%s:%s)< (%d bytes, %"
G_GINT64_FORMAT ", %d) %p",
GST_DEBUG_PAD_NAME (pad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf),
GST_BUFFER_FLAGS (buf), buf);
......
......@@ -763,7 +763,8 @@ gst_fakesrc_get(GstPad *pad)
if (!src->silent) {
g_free (src->last_message);
src->last_message = g_strdup_printf ("get ******* (%s:%s)> (%d bytes, %llu) %p",
src->last_message = g_strdup_printf ("get ******* (%s:%s)> (%d bytes, %"
G_GUINT64_FORMAT " ) %p",
GST_DEBUG_PAD_NAME (pad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf), buf);
g_object_notify (G_OBJECT (src), "last_message");
......
......@@ -367,8 +367,11 @@ gst_filesrc_free_parent_mmap (GstBuffer *buf)
#endif
/* now unmap the memory */
munmap (GST_BUFFER_DATA (buf), GST_BUFFER_MAXSIZE (buf));
GST_DEBUG (0, "unmapped region %08llx+%08llx at %p",
GST_BUFFER_OFFSET (buf), GST_BUFFER_MAXSIZE (buf),
/* cast to unsigned long, since there's no gportable way to print
* guint64 as hex */
GST_DEBUG (0, "unmapped region %08lx+%08lx at %p",
(unsigned long) GST_BUFFER_OFFSET (buf),
(unsigned long) GST_BUFFER_MAXSIZE (buf),
GST_BUFFER_DATA (buf));
GST_BUFFER_DATA (buf) = NULL;
......@@ -397,8 +400,8 @@ gst_filesrc_map_region (GstFileSrc *src, off_t offset, size_t size)
size, src->fd, offset, strerror (errno));
return NULL;
}
GST_DEBUG (0, "mapped region %08llx+%08x from file into memory at %p",
offset, size, mmapregion);
GST_DEBUG (0, "mapped region %08lx+%08lx from file into memory at %p",
(unsigned long)offset, (unsigned long)size, mmapregion);
/* time to allocate a new mapbuf */
buf = gst_buffer_new ();
......@@ -514,7 +517,8 @@ gst_filesrc_get (GstPad *pad)
/* check for EOF */
if (src->curoffset == src->filelen) {
GST_DEBUG (0, "filesrc eos %lld %lld", src->curoffset, src->filelen);
GST_DEBUG (0, "filesrc eos %" G_GINT64_FORMAT
" %" G_GINT64_FORMAT, src->curoffset, src->filelen);
gst_element_set_eos (GST_ELEMENT (src));
return GST_BUFFER (gst_event_new (GST_EVENT_EOS));
}
......@@ -531,8 +535,9 @@ gst_filesrc_get (GstPad *pad)
readend = src->curoffset + readsize;
}
GST_DEBUG (0, "attempting to read %08x, %08llx, %08llx, %08llx",
readsize, readend, mapstart, mapend);
GST_DEBUG (0, "attempting to read %08lx, %08lx, %08lx, %08lx",
(unsigned long)readsize, (unsigned long)readend,
(unsigned long)mapstart, (unsigned long)mapend);
/* if the start is past the mapstart */
if (src->curoffset >= mapstart) {
......@@ -787,19 +792,19 @@ gst_filesrc_srcpad_event (GstPad *pad, GstEvent *event)
if (offset > src->filelen)
goto error;
src->curoffset = offset;
GST_DEBUG(0, "seek set pending to %lld", src->curoffset);
GST_DEBUG(0, "seek set pending to %" G_GINT64_FORMAT, src->curoffset);
break;
case GST_SEEK_METHOD_CUR:
if (offset + src->curoffset > src->filelen)
goto error;
src->curoffset += offset;
GST_DEBUG(0, "seek cur pending to %lld", src->curoffset);
GST_DEBUG(0, "seek cur pending to %" G_GINT64_FORMAT, src->curoffset);
break;
case GST_SEEK_METHOD_END:
if (ABS (offset) > src->filelen)
goto error;
src->curoffset = src->filelen - ABS (offset);
GST_DEBUG(0, "seek end pending to %lld", src->curoffset);
GST_DEBUG(0, "seek end pending to %" G_GINT64_FORMAT, src->curoffset);
break;
default:
goto error;
......
......@@ -220,7 +220,8 @@ gst_identity_chain (GstPad *pad, GstBuffer *buf)
if (identity->last_message != NULL) {
g_free (identity->last_message);
}
identity->last_message = g_strdup_printf ("dropping ******* (%s:%s)i (%d bytes, %llu)",
identity->last_message = g_strdup_printf ("dropping ******* (%s:%s)i (%d bytes, %"
G_GINT64_FORMAT ")",
GST_DEBUG_PAD_NAME (identity->sinkpad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
g_object_notify (G_OBJECT (identity), "last-message");
gst_buffer_unref (buf);
......@@ -234,7 +235,8 @@ gst_identity_chain (GstPad *pad, GstBuffer *buf)
for (i = identity->duplicate; i; i--) {
if (!identity->silent) {
g_free (identity->last_message);
identity->last_message = g_strdup_printf ("chain ******* (%s:%s)i (%d bytes, %llu)",
identity->last_message = g_strdup_printf ("chain ******* (%s:%s)i (%d bytes, %"
G_GINT64_FORMAT ")",
GST_DEBUG_PAD_NAME (identity->sinkpad), GST_BUFFER_SIZE (buf), GST_BUFFER_TIMESTAMP (buf));
g_object_notify (G_OBJECT (identity), "last-message");
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment