int
mouse_tc_check(pTHX_ SV* const tc_code, SV* const sv) {
CV* const cv = (CV*)SvRV(tc_code);
- assert(SvTYPE(cv) == Svt_PVCV);
+ assert(SvTYPE(cv) == SVt_PVCV);
- if(CvISXSUB(cv)){ /* can be built-in tc */
- if(CvXSUB(cv) == XS_Mouse__Util__TypeConstraints_Item){
- assert(CvXSUBANY(cv).any_iv > 0);
+ 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){
- MAGIC* const mg = (MAGIC*)CvXSUBANY(cv).any_ptr;
+ return mouse_builtin_tc_check(aTHX_ CvXSUBANY(cv).any_iv, sv);
+ }
+ else if(CvXSUB(cv) == XS_Mouse_parameterized_check){ /* built-in, parameterizad */
+ MAGIC* const mg = (MAGIC*)CvXSUBANY(cv).any_ptr;
- assert(CvXSUBANY(cv).any_ptr != NULL);
+ assert(CvXSUBANY(cv).any_ptr != NULL);
- /* call the check function directly, skipping call_sv() */
- return CALL_FPTR((check_fptr_t)mg->mg_ptr)(aTHX_ mg->mg_obj, sv);
- }
+ /* call the check function directly, skipping call_sv() */
+ return CALL_FPTR((check_fptr_t)mg->mg_ptr)(aTHX_ mg->mg_obj, sv);
}
-
- /* user-defined type constraints */
- {
+ else { /* custom */
int ok;
dSP;