Change TC hierarchy in XS
gfx [Sun, 1 Nov 2009 02:49:48 +0000 (11:49 +0900)]
mouse.h
xs-src/MouseTypeConstraints.xs

diff --git a/mouse.h b/mouse.h
index d198f38..2b75762 100644 (file)
--- a/mouse.h
+++ b/mouse.h
@@ -133,9 +133,9 @@ XS(mouse_xs_reader);
 XS(mouse_xs_writer);
 
 typedef enum mouse_tc{
-     MOUSE_TC_MAYBE,
      MOUSE_TC_ANY,
      MOUSE_TC_ITEM,
+     MOUSE_TC_MAYBE,
      MOUSE_TC_UNDEF,
      MOUSE_TC_DEFINED,
      MOUSE_TC_BOOL,
index 48fa08e..e5b2c21 100644 (file)
@@ -22,11 +22,9 @@ mouse_tc_check(pTHX_ SV* const tc_code, SV* const sv) {
     assert(SvTYPE(cv) == SVt_PVCV);
 
     if(CvXSUB(cv) == XS_Mouse__Util__TypeConstraints_Item){ /* built-in */
-        assert(CvXSUBANY(cv).any_iv > 0);
-
         return mouse_builtin_tc_check(aTHX_ CvXSUBANY(cv).any_iv, sv);
     }
-    else if(CvXSUB(cv) == XS_Mouse_parameterized_check){ /* built-in, parameterizad */
+    else if(CvXSUB(cv) == XS_Mouse_parameterized_check){ /* complex type constraints */
         MAGIC* const mg = (MAGIC*)CvXSUBANY(cv).any_ptr;
 
         assert(CvXSUBANY(cv).any_ptr != NULL);