Set len.
[ruby-edje.git] / src / rb_edje.c
index 8e0f0b6cc0ea219ae659bf1d817a43b46b9d1e93..700a4de6a8c3e64e895ed119ee4428c5002e6323 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: rb_edje.c 332 2005-04-28 18:37:16Z tilman $
+ * $Id: rb_edje.c 334 2005-04-28 19:06:12Z tilman $
  *
  * Copyright (C) 2004 Tilman Sauerbeck (tilman at code-monkey de)
  *
@@ -515,11 +515,12 @@ static VALUE c_send_message (VALUE self, VALUE msg)
 
        CHECK_CLASS (msg, cMsg);
 
-       id = NUM2INT (rb_iv_get (msg, "@id"));
+       id = FIX2INT (rb_iv_get (msg, "@id"));
        v = rb_iv_get (msg, "@value");
 
        type = get_msg_type (v);
-       ary = rb_check_array_type (v);
+       if (!NIL_P (ary = rb_check_array_type (v)))
+               len = RARRAY (ary)->len;
 
        switch (type) {
                case EDJE_MESSAGE_NONE:
@@ -649,7 +650,7 @@ static VALUE c_msg_init (int argc, VALUE *argv, VALUE self)
 
        Check_Type (id, T_FIXNUM);
 
-       rb_iv_set (self, "@id", UINT2NUM (id));
+       rb_iv_set (self, "@id", id);
        rb_iv_set (self, "@value", val);
 
        return self;