X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FFunction-Parameters.git;a=blobdiff_plain;f=Parameters.xs;h=ba28c0e3dc04771a6cf79d664e016ef8ab08b4af;hp=bcff6ab51aea2ad35cd7eff0b33d5f4859d969c6;hb=5cf69cd2971747fcdf9118fcfdf5b6d1869ad508;hpb=0175ff9a8975c8f41006fe3cb4ccd5a44b4758dc diff --git a/Parameters.xs b/Parameters.xs index bcff6ab..ba28c0e 100644 --- a/Parameters.xs +++ b/Parameters.xs @@ -283,7 +283,7 @@ enum { static void my_sv_cat_c(pTHX_ SV *sv, U32 c) { char ds[UTF8_MAXBYTES + 1], *d; - d = uvchr_to_utf8(ds, c); + d = (char *)uvchr_to_utf8((U8 *)ds, c); if (d - ds > 1) { sv_utf8_upgrade(sv); } @@ -1322,11 +1322,13 @@ static int parse_fun(pTHX_ Sentinel sen, OP **pop, const char *keyword_ptr, STRL *init_sentinel = NULL; param_spec->named_optional.used++; } else { + Param *p; + if (param_spec->positional_optional.used) { croak("In %"SVf": can't combine optional positional (%"SVf") and required named (%"SVf") parameters", SVfARG(declarator), SVfARG(param_spec->positional_optional.data[0].param.name), SVfARG(name)); } - Param *p = pv_extend(¶m_spec->named_required); + p = pv_extend(¶m_spec->named_required); p->name = name; p->padoff = padoff; p->type = type; @@ -1490,7 +1492,6 @@ static int parse_fun(pTHX_ Sentinel sen, OP **pop, const char *keyword_ptr, STRL /* check number of arguments */ if (spec->flags & FLAG_CHECK_NARGS) { int amin, amax; - size_t named; amin = args_min(aTHX_ param_spec, spec); if (amin > 0) {