test creation of new fundamental types.

Sat Oct 12 22:02:32 2002  Tim Janik  <timj@gtk.org>

        * testgobject.c: test creation of new fundamental types.

        * gtype.c (g_type_fundamental_next), (type_node_fundamental_new_W):
        account for static_fundamental_next storing non-shifted fundamental
        IDs. this fixes g_type_fundamental_next() not returning a new usable
        fundamental ID.
This commit is contained in:
Tim Janik
2002-10-12 20:01:36 +00:00
committed by Tim Janik
parent e33442beb1
commit deb9510cf6
3 changed files with 24 additions and 3 deletions

View File

@@ -383,8 +383,8 @@ type_node_fundamental_new_W (GType ftype,
g_assert ((ftype & TYPE_ID_MASK) == 0);
g_assert (ftype <= G_TYPE_FUNDAMENTAL_MAX);
if (ftype == static_fundamental_next)
static_fundamental_next += 1 << G_TYPE_FUNDAMENTAL_SHIFT;
if (ftype >> G_TYPE_FUNDAMENTAL_SHIFT == static_fundamental_next)
static_fundamental_next++;
type_flags &= TYPE_FUNDAMENTAL_FLAG_MASK;
@@ -2581,7 +2581,7 @@ g_type_fundamental_next (void)
G_READ_LOCK (&type_rw_lock);
type = static_fundamental_next;
G_READ_UNLOCK (&type_rw_lock);
type = G_TYPE_MAKE_FUNDAMENTAL (type);
return type <= G_TYPE_FUNDAMENTAL_MAX ? type : 0;
}