Merge branch 'master' into metadata
[p5sagit/Function-Parameters.git] / Parameters.xs
index 9418c07..f2ac0da 100644 (file)
@@ -147,39 +147,6 @@ static SV *sentinel_mortalize(Sentinel sen, SV *sv) {
        return sv;
 }
 
-static void my_safefree(void *p) {
-       Safefree(p);
-}
-
-#define SENTINEL_ALLOC(SEN, P, N, T) STMT_START { \
-       Newx(P, N, T); \
-       sentinel_register(SEN, P, my_safefree); \
-} STMT_END
-
-#define SENTINEL_MDUP(SEN, P, O, N, T) STMT_START { \
-       void *const _sentinel_mdup_tmp_ = (P); \
-       SENTINEL_ALLOC(SEN, P, N, T); \
-       memcpy(P, _sentinel_mdup_tmp_, O * sizeof (T)); \
-} STMT_END
-
-#define SENTINEL_REALLOC(SEN, P, N, T) STMT_START { \
-       assert((N) > 0); \
-       if (!(P)) { \
-               SENTINEL_ALLOC(SEN, P, N, T); \
-       } else { \
-               Resource **_sentinel_realloc_tmp_ = (SEN); \
-               for (;;) { \
-                       assert(*_sentinel_realloc_tmp_ != NULL); \
-                       if ((*_sentinel_realloc_tmp_)->data == (P)) { \
-                               Renew((*_sentinel_realloc_tmp_)->data, N, T); \
-                               (P) = (*_sentinel_realloc_tmp_)->data; \
-                               break; \
-                       } \
-                       _sentinel_realloc_tmp_ = &(*_sentinel_realloc_tmp_)->next; \
-               } \
-       } \
-} STMT_END
-
 static int kw_flags(pTHX_ Sentinel sen, const char *kw_ptr, STRLEN kw_len, KWSpec *spec) {
        HV *hints;
        SV *sv, **psv;
@@ -802,7 +769,7 @@ static void register_info(pTHX_ UV key, SV *declarator, const KWSpec *kws, const
                size_t n;
                char *p = SvPV(declarator, n);
                char *q = memchr(p, ' ', n);
-               mPUSHp(p, q ? q - p : n);
+               mPUSHp(p, q ? (size_t)(q - p) : n);
        }
        if (!ps) {
                if (SvTRUE(kws->shift)) {
@@ -1709,12 +1676,12 @@ UV
 fp__cv_root(sv)
        SV * sv
        PREINIT:
-               CV *cv;
+               CV *xcv;
                HV *hv;
                GV *gv;
        CODE:
-               cv = sv_2cv(sv, &hv, &gv, 0);
-               RETVAL = PTR2UV(cv ? CvROOT(cv) : NULL);
+               xcv = sv_2cv(sv, &hv, &gv, 0);
+               RETVAL = PTR2UV(xcv ? CvROOT(xcv) : NULL);
        OUTPUT:
                RETVAL