The R Project SVN R

Rev

Rev 28254 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 28254 Rev 28362
Line 81... Line 81...
81
 
81
 
82
/* EnlargeVector() takes a vector "x" and changes its length to "newlen".  
82
/* EnlargeVector() takes a vector "x" and changes its length to "newlen".  
83
   This allows to assign values "past the end" of the vector or list.
83
   This allows to assign values "past the end" of the vector or list.
84
   Note that, unlike S, we only extend as much as is necessary. 
84
   Note that, unlike S, we only extend as much as is necessary. 
85
*/
85
*/
86
static SEXP EnlargeVector(SEXP x, int newlen)
86
static SEXP EnlargeVector(SEXP x, R_len_t newlen)
87
{
87
{
88
    int i, len;
88
    R_len_t i, len;
89
    SEXP newx, names, newnames;
89
    SEXP newx, names, newnames;
90
 
90
 
91
    /* Sanity Checks */
91
    /* Sanity Checks */
92
    if (!isVector(x))
92
    if (!isVector(x))
93
	error("attempt to enlarge non-vector");
93
	error("attempt to enlarge non-vector");
Line 290... Line 290...
290
}
290
}
291
 
291
 
292
static SEXP DeleteListElements(SEXP x, SEXP which)
292
static SEXP DeleteListElements(SEXP x, SEXP which)
293
{
293
{
294
    SEXP include, xnew, xnames, xnewnames;
294
    SEXP include, xnew, xnames, xnewnames;
295
    int i, ii, len, lenw;
295
    R_len_t i, ii, len, lenw;
296
    len = length(x);
296
    len = length(x);
297
    lenw = length(which);
297
    lenw = length(which);
298
    /* calculate the length of the result */
298
    /* calculate the length of the result */
299
    PROTECT(include = allocVector(INTSXP, len));
299
    PROTECT(include = allocVector(INTSXP, len));
300
    for (i = 0; i < len; i++)
300
    for (i = 0; i < len; i++)