[Vala] bug in Gee.ArrayList?




This Code:
    ...
     private Gee.ArrayList <int64> items;

    public void add (int64 id)
   {
     items.add(id);
   }

   ...


Produced this C-code:


void info_person_role_list_add (InfoPersonRoleList* self, gint64 id) {
       g_return_if_fail (INFO_IS_PERSON_ROLE_LIST (self));
gee_collection_add (GEE_COLLECTION (self->priv->items), GINT_TO_POINTER (id));
}

As You can see, int64 id casting by macro GINT_TO_POINTER (id)), but this macro intended only for 32 bit integer.


gcc print  warning on this cast.





namespace Info {
  public class PersonRoleList: GLib.Object, Gee.Iterable<int64> {
    private Gee.ArrayList <int64> items;
   
    construct {
     items = new  Gee.ArrayList <int64> ();   
    }
    
    public void clear() {
      items.clear();
    }
    
    public void add (int64 id)
    {
      items.add(id);
    }
    
    public Type get_element_type () {
      return typeof (int64);
    }

    public Gee.Iterator<int64> iterator () {
      return items.iterator();
    }
    
  
  }
}


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