hook gvariant vectors up to kdbus
[platform/upstream/glib.git] / glib / gvarianttypeinfo.c
index 7252459..48d25df 100644 (file)
@@ -13,9 +13,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  *
  * Author: Ryan Lortie <desrt@desrt.ca>
  */
@@ -117,7 +115,7 @@ static const GVariantTypeInfo g_variant_type_info_basic_table[24] = {
   /* 'c' */ { not_a_type },
   /* 'd' */ { fixed_aligned(8) },   /* double */
   /* 'e' */ { not_a_type },
-  /* 'f' */ { not_a_type },
+  /* 'f' */ { fixed_aligned(4) },   /* float */
   /* 'g' */ { unaligned        },   /* signature string */
   /* 'h' */ { fixed_aligned(4) },   /* file handle (int32) */
   /* 'i' */ { fixed_aligned(4) },   /* int32 */
@@ -149,7 +147,7 @@ static const GVariantTypeInfo g_variant_type_info_basic_table[24] = {
  * GVariantTypeInfo itself, we save a bunch of relocations.
  */
 static const char g_variant_type_info_basic_chars[24][2] = {
-  "b", " ", "d", " ", " ", "g", "h", "i", " ", " ", " ", " ",
+  "b", " ", "d", " ", "f", "g", "h", "i", " ", " ", " ", " ",
   "n", "o", " ", "q", " ", "s", "t", "u", "v", " ", "x", "y"
 };
 
@@ -222,8 +220,8 @@ g_variant_type_info_get_type_string (GVariantTypeInfo *info)
 /* < private >
  * g_variant_type_info_query:
  * @info: a #GVariantTypeInfo
- * @alignment: the location to store the alignment, or %NULL
- * @fixed_size: the location to store the fixed size, or %NULL
+ * @alignment: (allow-none): the location to store the alignment, or %NULL
+ * @fixed_size: (allow-none): the location to store the fixed size, or %NULL
  *
  * Queries @info to determine the alignment requirements and fixed size
  * (if any) of the type.
@@ -306,8 +304,8 @@ g_variant_type_info_element (GVariantTypeInfo *info)
 /* < private >
  * g_variant_type_query_element:
  * @info: a #GVariantTypeInfo for an array or maybe type
- * @alignment: the location to store the alignment, or %NULL
- * @fixed_size: the location to store the fixed size, or %NULL
+ * @alignment: (allow-none): the location to store the alignment, or %NULL
+ * @fixed_size: (allow-none): the location to store the fixed size, or %NULL
  *
  * Returns the alignment requires and fixed size (if any) for the
  * element type of the array.  This call is a convenience wrapper around
@@ -709,7 +707,7 @@ g_variant_type_info_member_info (GVariantTypeInfo *info,
 }
 
 /* == new/ref/unref == */
-static GStaticRecMutex g_variant_type_info_lock = G_STATIC_REC_MUTEX_INIT;
+static GRecMutex g_variant_type_info_lock;
 static GHashTable *g_variant_type_info_table;
 
 /* < private >
@@ -742,7 +740,7 @@ g_variant_type_info_get (const GVariantType *type)
 
       type_string = g_variant_type_dup_string (type);
 
-      g_static_rec_mutex_lock (&g_variant_type_info_lock);
+      g_rec_mutex_lock (&g_variant_type_info_lock);
 
       if (g_variant_type_info_table == NULL)
         g_variant_type_info_table = g_hash_table_new (g_str_hash,
@@ -773,7 +771,7 @@ g_variant_type_info_get (const GVariantType *type)
       else
         g_variant_type_info_ref (info);
 
-      g_static_rec_mutex_unlock (&g_variant_type_info_lock);
+      g_rec_mutex_unlock (&g_variant_type_info_lock);
       g_variant_type_info_check (info, 0);
       g_free (type_string);
 
@@ -834,7 +832,7 @@ g_variant_type_info_unref (GVariantTypeInfo *info)
     {
       ContainerInfo *container = (ContainerInfo *) info;
 
-      g_static_rec_mutex_lock (&g_variant_type_info_lock);
+      g_rec_mutex_lock (&g_variant_type_info_lock);
       if (g_atomic_int_dec_and_test (&container->ref_count))
         {
           g_hash_table_remove (g_variant_type_info_table,
@@ -844,7 +842,7 @@ g_variant_type_info_unref (GVariantTypeInfo *info)
               g_hash_table_unref (g_variant_type_info_table);
               g_variant_type_info_table = NULL;
             }
-          g_static_rec_mutex_unlock (&g_variant_type_info_lock);
+          g_rec_mutex_unlock (&g_variant_type_info_lock);
 
           g_free (container->type_string);
 
@@ -858,7 +856,7 @@ g_variant_type_info_unref (GVariantTypeInfo *info)
             g_assert_not_reached ();
         }
       else
-        g_static_rec_mutex_unlock (&g_variant_type_info_lock);
+        g_rec_mutex_unlock (&g_variant_type_info_lock);
     }
 }