info: use macros to check types
authorWim Taymans <wtaymans@redhat.com>
Tue, 3 Jun 2014 12:45:22 +0000 (14:45 +0200)
committerWim Taymans <wtaymans@redhat.com>
Tue, 3 Jun 2014 12:45:22 +0000 (14:45 +0200)
Use the macros to check the type of objects instead of directly poking
at the first field.

gst/gstinfo.c

index 0b36abe..3b1db65 100644 (file)
@@ -671,16 +671,16 @@ gst_debug_print_object (gpointer ptr)
   if (object == NULL) {
     return g_strdup ("(NULL)");
   }
-  if (*(GType *) ptr == GST_TYPE_CAPS) {
+  if (GST_IS_CAPS (ptr)) {
     return gst_caps_to_string ((const GstCaps *) ptr);
   }
-  if (*(GType *) ptr == GST_TYPE_STRUCTURE) {
+  if (GST_IS_STRUCTURE (ptr)) {
     return gst_info_structure_to_string ((const GstStructure *) ptr);
   }
   if (*(GType *) ptr == GST_TYPE_CAPS_FEATURES) {
     return gst_caps_features_to_string ((const GstCapsFeatures *) ptr);
   }
-  if (*(GType *) ptr == GST_TYPE_TAG_LIST) {
+  if (GST_IS_TAG_LIST (ptr)) {
     gchar *str = gst_tag_list_to_string ((GstTagList *) ptr);
     if (G_UNLIKELY (pretty_tags))
       return prettify_structure_string (str);