View | Details | Raw Unified | Return to bug 16932 | Differences between
and this patch

Collapse All | Expand All

(-)seq.c (-16 / +10 lines)
Lines 181-187 Link Here
181
    R_xlen_t i, j, nc, n;
181
    R_xlen_t i, j, nc, n;
182
    SEXP a, t;
182
    SEXP a, t;
183
183
184
#define R2_SWITCH_LOOP \
184
#define R2_SWITCH_LOOP(it) \
185
    switch (TYPEOF(s)) { \
185
    switch (TYPEOF(s)) { \
186
    case LGLSXP: \
186
    case LGLSXP: \
187
	for (i = 0; i < nc; i++) { \
187
	for (i = 0; i < nc; i++) { \
Lines 276-288 Link Here
276
	} */
276
	} */
277
    PROTECT(a = allocVector(TYPEOF(s), na));
277
    PROTECT(a = allocVector(TYPEOF(s), na));
278
    n = 0;
278
    n = 0;
279
    if (TYPEOF(t) == REALSXP) {
279
    if (TYPEOF(t) == REALSXP)
280
	double *it = REAL(t);
280
	R2_SWITCH_LOOP(REAL(t))
281
	R2_SWITCH_LOOP
281
    else
282
    } else {
282
	R2_SWITCH_LOOP(INTEGER(t))
283
	int *it = INTEGER(t);
284
	R2_SWITCH_LOOP
285
    }
286
    UNPROTECT(2);
283
    UNPROTECT(2);
287
    return a;
284
    return a;
288
}
285
}
Lines 474-480 Link Here
474
471
475
    PROTECT(a = allocVector(TYPEOF(x), len));
472
    PROTECT(a = allocVector(TYPEOF(x), len));
476
473
477
#define R4_SWITCH_LOOP \
474
#define R4_SWITCH_LOOP(itimes) \
478
    switch (TYPEOF(x)) { \
475
    switch (TYPEOF(x)) { \
479
    case LGLSXP: \
476
    case LGLSXP: \
480
	    for(i = 0, k = 0, k2 = 0; i < lx; i++) { \
477
	    for(i = 0, k = 0, k2 = 0; i < lx; i++) { \
Lines 599-611 Link Here
599
    default:
596
    default:
600
	UNIMPLEMENTED_TYPE("rep4", x);
597
	UNIMPLEMENTED_TYPE("rep4", x);
601
    }
598
    }
602
    else if(TYPEOF(times) == REALSXP) {
599
    else if(TYPEOF(times) == REALSXP)
603
	double *itimes = REAL(times);
600
	R4_SWITCH_LOOP(REAL(times))
604
	R4_SWITCH_LOOP
601
    else
605
    } else {
602
	R4_SWITCH_LOOP(INTEGER(times))
606
	int *itimes = INTEGER(times);
607
	R4_SWITCH_LOOP
608
    }
609
done:
603
done:
610
    UNPROTECT(1);
604
    UNPROTECT(1);
611
    return a;
605
    return a;

Return to bug 16932