Add G_UNLIKELY in type registration.
authorWim Taymans <wim.taymans@gmail.com>
Mon, 12 Jun 2006 08:55:21 +0000 (08:55 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Mon, 12 Jun 2006 08:55:21 +0000 (08:55 +0000)
Original commit message from CVS:
* gst/gsterror.c: (gst_g_error_get_type):
* gst/gstpadtemplate.c: (gst_pad_template_get_type),
(gst_static_pad_template_get_type):
* gst/gsttaglist.c: (gst_tag_list_get_type):
* gst/gsttagsetter.c: (gst_tag_setter_get_type):
* gst/gsttypefindfactory.c: (gst_type_find_factory_get_type):
* gst/gsturi.c: (gst_uri_handler_get_type):
* gst/gstvalue.c: (gst_date_get_type):
* gst/gstxml.c: (gst_xml_get_type):
* libs/gst/base/gstbasesink.c: (gst_base_sink_get_type),
(gst_base_sink_preroll_object), (gst_base_sink_get_position):
* libs/gst/base/gstbasesrc.c: (gst_base_src_get_type):
Add G_UNLIKELY in type registration.

ChangeLog
gst/gsterror.c
gst/gstpadtemplate.c
gst/gsttaglist.c
gst/gsttagsetter.c
gst/gsttypefindfactory.c
gst/gsturi.c
gst/gstvalue.c
gst/gstxml.c
libs/gst/base/gstbasesink.c
libs/gst/base/gstbasesrc.c

index 6582872..02966a2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,21 @@
 2006-06-12  Wim Taymans  <wim@fluendo.com>
 
+       * gst/gsterror.c: (gst_g_error_get_type):
+       * gst/gstpadtemplate.c: (gst_pad_template_get_type),
+       (gst_static_pad_template_get_type):
+       * gst/gsttaglist.c: (gst_tag_list_get_type):
+       * gst/gsttagsetter.c: (gst_tag_setter_get_type):
+       * gst/gsttypefindfactory.c: (gst_type_find_factory_get_type):
+       * gst/gsturi.c: (gst_uri_handler_get_type):
+       * gst/gstvalue.c: (gst_date_get_type):
+       * gst/gstxml.c: (gst_xml_get_type):
+       * libs/gst/base/gstbasesink.c: (gst_base_sink_get_type),
+       (gst_base_sink_preroll_object), (gst_base_sink_get_position):
+       * libs/gst/base/gstbasesrc.c: (gst_base_src_get_type):
+       Add G_UNLIKELY in type registration.
+
+2006-06-12  Wim Taymans  <wim@fluendo.com>
+
        * tools/gst-inspect.c: (print_signal_info):
        Properly print enum values.
 
index 3c09446..a4f75a0 100644 (file)
@@ -111,7 +111,7 @@ gst_g_error_get_type (void)
 {
   static GType type = 0;
 
-  if (!type)
+  if (G_UNLIKELY (type == 0))
     type = g_boxed_type_register_static ("GstGError",
         (GBoxedCopyFunc) g_error_copy, (GBoxedFreeFunc) g_error_free);
   return type;
index bff35fb..2f12f1c 100644 (file)
@@ -128,7 +128,7 @@ gst_pad_template_get_type (void)
 {
   static GType padtemplate_type = 0;
 
-  if (!padtemplate_type) {
+  if (G_UNLIKELY (padtemplate_type == 0)) {
     static const GTypeInfo padtemplate_info = {
       sizeof (GstPadTemplateClass), NULL, NULL,
       (GClassInitFunc) gst_pad_template_class_init, NULL, NULL,
@@ -246,7 +246,7 @@ gst_static_pad_template_get_type (void)
 {
   static GType staticpadtemplate_type = 0;
 
-  if (!staticpadtemplate_type) {
+  if (G_UNLIKELY (staticpadtemplate_type == 0)) {
     staticpadtemplate_type =
         g_pointer_type_register_static ("GstStaticPadTemplate");
   }
index 48246d9..de69934 100644 (file)
@@ -67,9 +67,9 @@ static GHashTable *__tags;
 GType
 gst_tag_list_get_type (void)
 {
-  static GType _gst_tag_list_type;
+  static GType _gst_tag_list_type = 0;
 
-  if (_gst_tag_list_type == 0) {
+  if (G_UNLIKELY (_gst_tag_list_type == 0)) {
     _gst_tag_list_type = g_boxed_type_register_static ("GstTagList",
         (GBoxedCopyFunc) gst_tag_list_copy, (GBoxedFreeFunc) gst_tag_list_free);
 
index 10301a4..afa5a9e 100644 (file)
@@ -98,7 +98,7 @@ gst_tag_setter_get_type (void)
 {
   static GType tag_setter_type = 0;
 
-  if (!tag_setter_type) {
+  if (G_UNLIKELY (tag_setter_type == 0)) {
     static const GTypeInfo tag_setter_info = {
       sizeof (GstTagSetterIFace),       /* class_size */
       NULL,                     /* base_init */
index b414ef2..0a1cf15 100644 (file)
@@ -102,7 +102,7 @@ gst_type_find_factory_get_type (void)
 {
   static GType typefind_type = 0;
 
-  if (!typefind_type) {
+  if (G_UNLIKELY (typefind_type == 0)) {
     static const GTypeInfo typefind_info = {
       sizeof (GstTypeFindFactoryClass),
       NULL,
index 24eaa28..7092c8b 100644 (file)
@@ -58,7 +58,7 @@ gst_uri_handler_get_type (void)
 {
   static GType urihandler_type = 0;
 
-  if (!urihandler_type) {
+  if (G_UNLIKELY (urihandler_type == 0)) {
     static const GTypeInfo urihandler_info = {
       sizeof (GstURIHandlerInterface),
       gst_uri_handler_base_init,
index 0a06290..62b8c30 100644 (file)
@@ -3802,7 +3802,7 @@ gst_date_get_type (void)
 {
   static GType gst_date_type = 0;
 
-  if (!gst_date_type) {
+  if (G_UNLIKELY (gst_date_type == 0)) {
     /* Not using G_TYPE_DATE here on purpose, even if we could
      * if GLIB_CHECK_VERSION(2,8,0) was true: we don't want the
      * serialised strings to have different type strings depending
index ba1a0ef..61ae6ee 100644 (file)
@@ -61,7 +61,7 @@ gst_xml_get_type (void)
 {
   static GType xml_type = 0;
 
-  if (!xml_type) {
+  if (G_UNLIKELY (xml_type == 0)) {
     static const GTypeInfo xml_info = {
       sizeof (GstXMLClass),
       NULL,
index b109db2..db2c896 100644 (file)
@@ -237,7 +237,7 @@ gst_base_sink_get_type (void)
 {
   static GType base_sink_type = 0;
 
-  if (!base_sink_type) {
+  if (G_UNLIKELY (base_sink_type == 0)) {
     static const GTypeInfo base_sink_info = {
       sizeof (GstBaseSinkClass),
       (GBaseInitFunc) gst_base_sink_base_init,
@@ -1573,7 +1573,6 @@ gst_base_sink_preroll_object (GstBaseSink * basesink, GstPad * pad,
     if (bclass->preroll)
       if ((ret = bclass->preroll (basesink, buf)) != GST_FLOW_OK)
         goto preroll_failed;
-  } else {
   }
 
   /* commit state */
index 004891c..7102cf5 100644 (file)
@@ -237,7 +237,7 @@ gst_base_src_get_type (void)
 {
   static GType base_src_type = 0;
 
-  if (!base_src_type) {
+  if (G_UNLIKELY (base_src_type == 0)) {
     static const GTypeInfo base_src_info = {
       sizeof (GstBaseSrcClass),
       (GBaseInitFunc) gst_base_src_base_init,