The R Project SVN R

Rev

Rev 64247 | Rev 64252 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 64247 Rev 64249
Line 659... Line 659...
659
		cnt++;
659
		cnt++;
660
	    } else if ((R_xlen_t) ds != 0) cnt++;
660
	    } else if ((R_xlen_t) ds != 0) cnt++;
661
#else
661
#else
662
	    if (R_FINITE(ds) && ds > INT_MAX) 
662
	    if (R_FINITE(ds) && ds > INT_MAX) 
663
		int_ok = FALSE;
663
		int_ok = FALSE;
-
 
664
	    // FIXME: what about non-finite values?
664
	    if ((R_xlen_t) ds != 0) cnt++;
665
	    if ((R_xlen_t) ds != 0) cnt++;
665
#endif
666
#endif
666
	}
667
	}
667
	if (int_ok) {
668
	if (int_ok) {
668
	    indx = allocVector(INTSXP, cnt);
669
	    indx = allocVector(INTSXP, cnt);
Line 674... Line 675...
674
		if (ia != 0) INTEGER(indx)[cnt++] = ia;
675
		if (ia != 0) INTEGER(indx)[cnt++] = ia;
675
	    }
676
	    }
676
	} else {
677
	} else {
677
	    indx = allocVector(REALSXP, cnt);
678
	    indx = allocVector(REALSXP, cnt);
678
	    for (i = 0, cnt = 0; i < ns; i++) {
679
	    for (i = 0, cnt = 0; i < ns; i++) {
-
 
680
		// FIXME: what about non-finite values?
679
		R_xlen_t ia = (R_xlen_t) REAL(s)[i];
681
		R_xlen_t ia = (R_xlen_t) REAL(s)[i];
680
		if (ia != 0) REAL(indx)[cnt++] = REAL(s)[i];
682
		if (ia != 0) REAL(indx)[cnt++] = REAL(s)[i];
681
	    }
683
	    }
682
	}
684
	}
683
	return indx;
685
	return indx;