The R Project SVN R

Rev

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

Rev 47664 Rev 48257
Line 262... Line 262...
262
    case INTSXP:
262
    case INTSXP:
263
	n = LENGTH(x);
263
	n = LENGTH(x);
264
	for (i = 0; i < n; i++)
264
	for (i = 0; i < n; i++)
265
	    LOGICAL(data->ans_ptr)[data->ans_length++] = INTEGER(x)[i];
265
	    LOGICAL(data->ans_ptr)[data->ans_length++] = INTEGER(x)[i];
266
	break;
266
	break;
-
 
267
    case RAWSXP:
-
 
268
	n = LENGTH(x);
-
 
269
	for (i = 0; i < n; i++)
-
 
270
	    LOGICAL(data->ans_ptr)[data->ans_length++] = (int)RAW(x)[i];
-
 
271
	break;
267
    default:
272
    default:
268
	errorcall(call, _("type '%s' is unimplemented in '%s'"),
273
	errorcall(call, _("type '%s' is unimplemented in '%s'"),
269
		  type2char(TYPEOF(x)), "LogicalAnswer");
274
		  type2char(TYPEOF(x)), "LogicalAnswer");
270
    }
275
    }
271
}
276
}
Line 297... Line 302...
297
    case INTSXP:
302
    case INTSXP:
298
	n = LENGTH(x);
303
	n = LENGTH(x);
299
	for (i = 0; i < n; i++)
304
	for (i = 0; i < n; i++)
300
	    INTEGER(data->ans_ptr)[data->ans_length++] = INTEGER(x)[i];
305
	    INTEGER(data->ans_ptr)[data->ans_length++] = INTEGER(x)[i];
301
	break;
306
	break;
-
 
307
    case RAWSXP:
-
 
308
	n = LENGTH(x);
-
 
309
	for (i = 0; i < n; i++)
-
 
310
	    INTEGER(data->ans_ptr)[data->ans_length++] = (int)RAW(x)[i];
-
 
311
	break;
302
    default:
312
    default:
303
	errorcall(call, _("type '%s' is unimplemented in '%s'"),
313
	errorcall(call, _("type '%s' is unimplemented in '%s'"),
304
		  type2char(TYPEOF(x)), "IntegerAnswer");
314
		  type2char(TYPEOF(x)), "IntegerAnswer");
305
    }
315
    }
306
}
316
}
Line 345... Line 355...
345
	    if (xi == NA_INTEGER)
355
	    if (xi == NA_INTEGER)
346
		REAL(data->ans_ptr)[data->ans_length++] = NA_REAL;
356
		REAL(data->ans_ptr)[data->ans_length++] = NA_REAL;
347
	    else REAL(data->ans_ptr)[data->ans_length++] = xi;
357
	    else REAL(data->ans_ptr)[data->ans_length++] = xi;
348
	}
358
	}
349
	break;
359
	break;
-
 
360
    case RAWSXP:
-
 
361
	n = LENGTH(x);
-
 
362
	for (i = 0; i < n; i++)
-
 
363
	    REAL(data->ans_ptr)[data->ans_length++] = (int)RAW(x)[i];
-
 
364
	break;
350
    default:
365
    default:
351
	errorcall(call, _("type '%s' is unimplemented in '%s'"),
366
	errorcall(call, _("type '%s' is unimplemented in '%s'"),
352
		  type2char(TYPEOF(x)), "RealAnswer");
367
		  type2char(TYPEOF(x)), "RealAnswer");
353
    }
368
    }
354
}
369
}
Line 413... Line 428...
413
		COMPLEX(data->ans_ptr)[data->ans_length].i = 0.0;
428
		COMPLEX(data->ans_ptr)[data->ans_length].i = 0.0;
414
	    }
429
	    }
415
	    data->ans_length++;
430
	    data->ans_length++;
416
	}
431
	}
417
	break;
432
	break;
-
 
433
 
-
 
434
    case RAWSXP:
-
 
435
	n = LENGTH(x);
-
 
436
	for (i = 0; i < n; i++) {
-
 
437
	    COMPLEX(data->ans_ptr)[data->ans_length].r = (int)RAW(x)[i];
-
 
438
	    COMPLEX(data->ans_ptr)[data->ans_length].i = 0.0;
-
 
439
	    data->ans_length++;
-
 
440
	}
-
 
441
	break;
-
 
442
 
418
    default:
443
    default:
419
	errorcall(call, _("type '%s' is unimplemented in '%s'"),
444
	errorcall(call, _("type '%s' is unimplemented in '%s'"),
420
		  type2char(TYPEOF(x)), "ComplexAnswer");
445
		  type2char(TYPEOF(x)), "ComplexAnswer");
421
    }
446
    }
422
}
447
}