fontconfig: Branch 'master'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 src/fcobjs.c |   16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

New commits:
commit 4c9101f7044b68aa121557c796384e4bdf08f73f
Author: Akira TAGOH <akira@xxxxxxxxx>
Date:   Mon May 25 21:41:05 2015 +0900

    Revert the previous change
    
    and just abort if the object id is overflowed.

diff --git a/src/fcobjs.c b/src/fcobjs.c
index 5e6b091..16ff31c 100644
--- a/src/fcobjs.c
+++ b/src/fcobjs.c
@@ -70,8 +70,6 @@ static FcObjectType *
 _FcObjectLookupOtherTypeByName (const char *str, FcObject *id)
 {
     struct FcObjectOtherTypeInfo *ots, *ot;
-    static fc_atomic_int_t first_id = 0;
-    static FcBool overflow = FcFalse;
 
 retry:
     ots = fc_atomic_ptr_get (&other_types);
@@ -80,11 +78,6 @@ retry:
 	if (0 == strcmp (ot->object.object, str))
 	    break;
 
-    if (!ots)
-    {
-	first_id = fc_atomic_int_add (next_id, 0);
-	overflow = FcFalse;
-    }
     if (!ot)
     {
 	ot = malloc (sizeof (*ot));
@@ -93,19 +86,12 @@ retry:
 
 	ot->object.object = (char *) FcStrdup (str);
 	ot->object.type = FcTypeUnknown;
-    retry_id:
 	ot->id = fc_atomic_int_add (next_id, +1);
-	if (overflow && ot->id == first_id)
+	if (ot->id < (FC_MAX_BASE_OBJECT + FC_EXT_OBJ_INDEX))
 	{
 	    fprintf (stderr, "Fontconfig error: No object ID to assign\n");
 	    abort ();
 	}
-	if (ot->id < (FC_MAX_BASE_OBJECT + FC_EXT_OBJ_INDEX))
-	{
-	    overflow = FcTrue;
-	    fc_atomic_ptr_cmpexch (&next_id, ot->id + 1, FC_MAX_BASE_OBJECT + FC_EXT_OBJ_INDEX + 1);
-	    goto retry_id;
-	}
 	ot->next = ots;
 
 	if (!fc_atomic_ptr_cmpexch (&other_types, ots, ot)) {
_______________________________________________
Fontconfig mailing list
Fontconfig@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/fontconfig





[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux