#define sv_cmp_static Perl_sv_cmp
#define sv_cmp_locale_static Perl_sv_cmp_locale
-#define SORTHINTS(hintsv) \
- (((hintsv) = GvSV(gv_fetchpv("sort::hints", GV_ADDMULTI, SVt_IV))), \
- (SvIOK(hintsv) ? ((I32)SvIV(hintsv)) : 0))
+#define dSORTHINTS SV *hintsv = GvSV(gv_fetchpv("sort::hints", GV_ADDMULTI, SVt_IV))
+#define SORTHINTS (SvIOK(hintsv) ? ((I32)SvIV(hintsv)) : 0)
#ifndef SMALLSORT
#define SMALLSORT (200)
}
if (nmemb <= SMALLSORT) aux = small; /* use stack for aux array */
- else { New(799,aux,nmemb,gptr); } /* allocate auxilliary array */
+ else { Newx(aux,nmemb,gptr); } /* allocate auxilliary array */
level = 0;
stackp = stack;
stackp->runs = dynprep(aTHX_ base, aux, nmemb, cmp);
STATIC void
S_qsortsv(pTHX_ gptr *list1, size_t nmemb, SVCOMPARE_t cmp, U32 flags)
{
- SV *hintsv;
- if (SORTHINTS(hintsv) & HINT_SORT_STABLE) {
+ dSORTHINTS;
+
+ if (SORTHINTS & HINT_SORT_STABLE) {
register gptr **pp, *q;
register size_t n, j, i;
gptr *small[SMALLSORT], **indir, tmp;
/* Small arrays can use the stack, big ones must be allocated */
if (nmemb <= SMALLSORT) indir = small;
- else { New(1799, indir, nmemb, gptr *); }
+ else { Newx(indir, nmemb, gptr *); }
/* Copy pointers to original array elements into indirect array */
for (n = nmemb, pp = indir, q = list1; n--; ) *pp++ = q++;
{
void (*sortsvp)(pTHX_ SV **array, size_t nmemb, SVCOMPARE_t cmp, U32 flags)
= S_mergesortsv;
- SV *hintsv;
-
- /* Sun's Compiler (cc: WorkShop Compilers 4.2 30 Oct 1996 C 4.2) used
- to miscompile this function under optimization -O. If you get test
- errors related to picking the correct sort() function, try recompiling
- this file without optimiziation. -- A.D. 4/2002.
- */
- const I32 hints = SORTHINTS(hintsv);
+ dSORTHINTS;
+ const I32 hints = SORTHINTS;
if (hints & HINT_SORT_QUICKSORT) {
sortsvp = S_qsortsv;
}
{
void (*sortsvp)(pTHX_ SV **array, size_t nmemb, SVCOMPARE_t cmp, U32 flags)
= S_mergesortsv;
- SV *hintsv;
-
- /* Sun's Compiler (cc: WorkShop Compilers 4.2 30 Oct 1996 C 4.2) used
- to miscompile this function under optimization -O. If you get test
- errors related to picking the correct sort() function, try recompiling
- this file without optimiziation. -- A.D. 4/2002.
- */
- const I32 hints = SORTHINTS(hintsv);
+ dSORTHINTS;
+ const I32 hints = SORTHINTS;
if (hints & HINT_SORT_QUICKSORT) {
sortsvp = S_qsortsv;
}
SAVEVPTR(CvROOT(cv)->op_ppaddr);
CvROOT(cv)->op_ppaddr = PL_ppaddr[OP_NULL];
- PAD_SET_CUR(CvPADLIST(cv), 1);
+ SAVECOMPPAD();
+ PAD_SET_CUR_NOSAVE(CvPADLIST(cv), 1);
}
}
}