#include "perl.h"
#include "XSUB.h"
-#define __PACKAGE__ "Scalar::Vec::Util"
+#define __PACKAGE__ "Scalar::Vec::Util"
+#define __PACKAGE_LEN__ (sizeof(__PACKAGE__)-1)
#include "bitvect.h"
BOOT:
{
- HV *stash = gv_stashpv(__PACKAGE__, 1);
+ HV *stash = gv_stashpvn(__PACKAGE__, __PACKAGE_LEN__, 1);
newCONSTSUB(stash, "SVU_PP", newSVuv(0));
newCONSTSUB(stash, "SVU_SIZE", newSVuv(SVU_SIZE));
}
size_t s, l, n, o;
char f, *v;
CODE:
- if (!SvOK(sv) || !SvOK(ss) || !SvOK(sl) || !SvOK(sf)) {
+ if (!SvOK(sv) || !SvOK(ss) || !SvOK(sl) || !SvOK(sf))
croak(svu_error_invarg);
- }
l = SvUV(sl);
- if (!l) { XSRETURN(0); }
+ if (!l)
+ XSRETURN(0);
s = SvUV(ss);
f = SvTRUE(sf);
- if (SvTYPE(sv) < SVt_PV) { SvUPGRADE(sv, SVt_PV); }
+ SvUPGRADE(sv, SVt_PV);
n = BV_SIZE(s + l);
o = SvLEN(sv);
} else {
v = SvPVX(sv);
}
- if (SvCUR(sv) < n) {
+ if (SvCUR(sv) < n)
SvCUR_set(sv, n);
- }
bv_fill(v, s, l, f);
size_t fs, ts, l, lf = 0, n, o;
char *t, *f;
CODE:
- if (!SvOK(sf) || !SvOK(sfs) || !SvOK(st) || !SvOK(sts) || !SvOK(sl)) {
+ if (!SvOK(sf) || !SvOK(sfs) || !SvOK(st) || !SvOK(sts) || !SvOK(sl))
croak(svu_error_invarg);
- }
l = SvUV(sl);
- if (!l) { XSRETURN(0); }
+ if (!l)
+ XSRETURN(0);
fs = SvUV(sfs);
ts = SvUV(sts);
- if (SvTYPE(sf) < SVt_PV) { SvUPGRADE(sf, SVt_PV); }
- if (SvTYPE(st) < SVt_PV) { SvUPGRADE(st, SVt_PV); }
+ SvUPGRADE(sf, SVt_PV);
+ SvUPGRADE(st, SVt_PV);
n = BV_SIZE(ts + l);
o = SvLEN(st);
} else {
t = SvPVX(st);
}
- if (SvCUR(st) < n) {
+ if (SvCUR(st) < n)
SvCUR_set(st, n);
- }
f = SvPVX(sf); /* We do it there in case st == sf. */
n = BV_SIZE(fs + l);
size_t s1, s2, l, o, n;
char *v1, *v2;
CODE:
- if (!SvOK(sv1) || !SvOK(ss1) || !SvOK(sv2) || !SvOK(ss2) || !SvOK(sl)) {
+ if (!SvOK(sv1) || !SvOK(ss1) || !SvOK(sv2) || !SvOK(ss2) || !SvOK(sl))
croak(svu_error_invarg);
- }
l = SvUV(sl);
s1 = SvUV(ss1);
s2 = SvUV(ss2);
- if (SvTYPE(sv1) < SVt_PV) { SvUPGRADE(sv1, SVt_PV); }
- if (SvTYPE(sv2) < SVt_PV) { SvUPGRADE(sv2, SVt_PV); }
+ SvUPGRADE(sv1, SVt_PV);
+ SvUPGRADE(sv2, SVt_PV);
n = BV_SIZE(s1 + l);
o = SvLEN(sv1);