From b81ac0d33896fe10eb36662a4dfa5a7ef516e097 Mon Sep 17 00:00:00 2001 From: Holger Hoefling Date: Sun, 7 Jan 2024 15:43:57 +0100 Subject: [PATCH] Fix various check issues that appear in the newest version --- DESCRIPTION | 2 +- Makefile | 6 ++++-- R/convert.R | 8 +++----- R/high_level_UI.R | 2 +- inst/CWrappers_1.10.0/datatype_export_c.brew | 2 +- inst/CWrappers_1.10.0/identify_prototypes.R | 2 +- inst/CWrappers_1.10.2/datatype_export_c.brew | 2 +- inst/CWrappers_1.10.2/identify_prototypes.R | 2 +- inst/CWrappers_1.10.3/datatype_export_c.brew | 2 +- inst/CWrappers_1.10.3/identify_prototypes.R | 2 +- inst/CWrappers_1.12.0/datatype_export_c.brew | 2 +- inst/CWrappers_1.12.0/identify_prototypes.R | 2 +- inst/CWrappers_1.8.12/datatype_export_c.brew | 2 +- inst/CWrappers_1.8.12/identify_prototypes.R | 2 +- inst/CWrappers_1.8.14/datatype_export_c.brew | 2 +- inst/CWrappers_1.8.14/identify_prototypes.R | 2 +- inst/CWrappers_1.8.16/datatype_export_c.brew | 2 +- inst/CWrappers_1.8.16/identify_prototypes.R | 2 +- man/check_arg_for_hyperslab_func.Rd | 4 ++-- man/extract_dim.Rd | 8 +++----- src/1_10_0/datatype_export.c | 2 +- src/1_10_2/datatype_export.c | 2 +- src/1_10_3/datatype_export.c | 2 +- src/1_12_0/datatype_export.c | 2 +- src/1_8_12/datatype_export.c | 2 +- src/1_8_14/datatype_export.c | 2 +- src/1_8_16/datatype_export.c | 2 +- src/Wrapper_manual_H5T.c | 2 +- src/convert.c | 2 +- 29 files changed, 37 insertions(+), 39 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 7d5b029..b487fb0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: hdf5r Type: Package Title: Interface to the 'HDF5' Binary Data Format -Version: 1.3.8 +Version: 1.3.9 Authors@R: c( person("Holger", "Hoefling", email = "hhoeflin@gmail.com", role = c("aut", "cre")), person("Mario", "Annau", email = "mario.annau@gmail.com", role = "aut"), diff --git a/Makefile b/Makefile index a4f442c..cbc7cee 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ .ONESHELL: +SHELL:=/bin/bash -R_REVISION?=83640 +R_REVISION?=85786 HDF5_VERSION?=System DOCKER_CRAN_CHECK_ARG='' # DOCKER_CRAN_CHECK_ARG='--as-cran' @@ -14,7 +15,7 @@ PKG_NAME := $(shell grep -i ^package DESCRIPTION | cut -d : -d \ -f 2) #DATA_FILES := $(wildcard data/*.rda) R_FILES := $(wildcard R/*.R) TEST_FILES := $(wildcard tests/*.R) $(wildcard tests/testthat/*.R) -ALL_SRC_FILES := $(wildcard src/*.cpp) $(wildcard src/*.h) src/Makevars.in +ALL_SRC_FILES := $(wildcard src/*.c) $(wildcard src/*.h) src/Makevars.in RMD_FILES := README.Rmd MD_FILES := $(RMD_FILES:.Rmd=.md) SRC_FILES := $(filter-out src/RcppExports.cpp, $(ALL_SRC_FILES)) @@ -71,6 +72,7 @@ check: $(BUILD_OUTPUT) check-docker: $(BUILD_OUTPUT) if [[ "${HDF5_VERSION}" = "System" ]]; then + echo HDF is System $(MAKE) -C docker build-system R_REVISION=${R_REVISION} HDF5_VERSION=${HDF5_VERSION} else $(MAKE) -C docker build-custom R_REVISION=${R_REVISION} HDF5_VERSION=${HDF5_VERSION} diff --git a/R/convert.R b/R/convert.R index cc2ee7b..2c9bc89 100644 --- a/R/convert.R +++ b/R/convert.R @@ -372,22 +372,20 @@ guess_chunks <- function(space_maxdims, dtype_size, chunk_size=getOption("hdf5r. return(chunk_dim) } -##' Set the correct dimension attribute for an object +##' Get the correct dimensions for a space and datatype ##' -##' This function uses the space and the selection in it to set the correct dimension +##' This function uses the space and the selection in it to get the correct dimension ##' for the resulting object (but without dropping dimensions). Furthermore, if the ##' datatype is an array, those dimensions are correctly determined as well. ##' ##' Internal use only; currently unused -##' @title Set the correct dimension attribute for an object -##' @param x an object that was read from an HDF5 dataset or attribute +##' @title Extract the dimension of a space and datatype ##' @param space The space with the selection that was used to read the dataset ##' @param dtype The datatype of the dataset ##' @return \code{x}, but with a new dimension attribute ##' @author Holger Hoefling ##' @keywords internal extract_dim <- function(space, dtype) { - ## apply the right dimension attribute to x that is implied by the space and the data-type dtype_dim <- NULL if(inherits(dtype, "H5T")) { if(dtype$get_class() == h5const$H5T_ARRAY) { diff --git a/R/high_level_UI.R b/R/high_level_UI.R index e36a742..6c3a3e9 100644 --- a/R/high_level_UI.R +++ b/R/high_level_UI.R @@ -348,7 +348,7 @@ are_args_scalar <- function(args) { ##' ##' Checks for the functions \code{:}, \code{seq} and \code{seq_len} ##' @title Check argument for known functions that encode a hyperslab -##' @param cur_arg The argument to check +##' @param x The argument to check ##' @param envir The environment in which to evaluate the argument ##' @return A vector of length 4 describing start, count, stride and block if appropriate ##' @author Holger Hoefling diff --git a/inst/CWrappers_1.10.0/datatype_export_c.brew b/inst/CWrappers_1.10.0/datatype_export_c.brew index 6a84363..1f56c17 100755 --- a/inst/CWrappers_1.10.0/datatype_export_c.brew +++ b/inst/CWrappers_1.10.0/datatype_export_c.brew @@ -64,7 +64,7 @@ hid_t get_h5_equiv(int size, bool sign) { SEXP print_dtypes_array(void) { Rprintf("New -------------------------------------\n"); for(int i=0; i < DT_LAST_ITEM; ++i) { - Rprintf("%d: %I64d\n", i, h5_datatype[i]); + Rprintf("%d: %ld\n", i, h5_datatype[i]); } return(R_NilValue); } diff --git a/inst/CWrappers_1.10.0/identify_prototypes.R b/inst/CWrappers_1.10.0/identify_prototypes.R index 27b2fa4..26e2af6 100755 --- a/inst/CWrappers_1.10.0/identify_prototypes.R +++ b/inst/CWrappers_1.10.0/identify_prototypes.R @@ -318,7 +318,7 @@ struct_all_elements_rtype$all_rtype[struct_all_elements_rtype$category_name=="H5 struct_all_elements_rtype <- subset(struct_all_elements_rtype, all_rtype) -all_types_with_complete_rtype <- rbind.fill(subset(struct_enum_types, !category %in% c("struct", "union") || +all_types_with_complete_rtype <- rbind.fill(subset(struct_enum_types, !category %in% c("struct", "union") | category_name %in% struct_all_elements_rtype$category_name), all_other) all_types_with_complete_rtype <- subset(all_types_with_complete_rtype, has_rtype) diff --git a/inst/CWrappers_1.10.2/datatype_export_c.brew b/inst/CWrappers_1.10.2/datatype_export_c.brew index 6a84363..1f56c17 100755 --- a/inst/CWrappers_1.10.2/datatype_export_c.brew +++ b/inst/CWrappers_1.10.2/datatype_export_c.brew @@ -64,7 +64,7 @@ hid_t get_h5_equiv(int size, bool sign) { SEXP print_dtypes_array(void) { Rprintf("New -------------------------------------\n"); for(int i=0; i < DT_LAST_ITEM; ++i) { - Rprintf("%d: %I64d\n", i, h5_datatype[i]); + Rprintf("%d: %ld\n", i, h5_datatype[i]); } return(R_NilValue); } diff --git a/inst/CWrappers_1.10.2/identify_prototypes.R b/inst/CWrappers_1.10.2/identify_prototypes.R index 27b2fa4..26e2af6 100755 --- a/inst/CWrappers_1.10.2/identify_prototypes.R +++ b/inst/CWrappers_1.10.2/identify_prototypes.R @@ -318,7 +318,7 @@ struct_all_elements_rtype$all_rtype[struct_all_elements_rtype$category_name=="H5 struct_all_elements_rtype <- subset(struct_all_elements_rtype, all_rtype) -all_types_with_complete_rtype <- rbind.fill(subset(struct_enum_types, !category %in% c("struct", "union") || +all_types_with_complete_rtype <- rbind.fill(subset(struct_enum_types, !category %in% c("struct", "union") | category_name %in% struct_all_elements_rtype$category_name), all_other) all_types_with_complete_rtype <- subset(all_types_with_complete_rtype, has_rtype) diff --git a/inst/CWrappers_1.10.3/datatype_export_c.brew b/inst/CWrappers_1.10.3/datatype_export_c.brew index 6a84363..1f56c17 100755 --- a/inst/CWrappers_1.10.3/datatype_export_c.brew +++ b/inst/CWrappers_1.10.3/datatype_export_c.brew @@ -64,7 +64,7 @@ hid_t get_h5_equiv(int size, bool sign) { SEXP print_dtypes_array(void) { Rprintf("New -------------------------------------\n"); for(int i=0; i < DT_LAST_ITEM; ++i) { - Rprintf("%d: %I64d\n", i, h5_datatype[i]); + Rprintf("%d: %ld\n", i, h5_datatype[i]); } return(R_NilValue); } diff --git a/inst/CWrappers_1.10.3/identify_prototypes.R b/inst/CWrappers_1.10.3/identify_prototypes.R index 27b2fa4..26e2af6 100755 --- a/inst/CWrappers_1.10.3/identify_prototypes.R +++ b/inst/CWrappers_1.10.3/identify_prototypes.R @@ -318,7 +318,7 @@ struct_all_elements_rtype$all_rtype[struct_all_elements_rtype$category_name=="H5 struct_all_elements_rtype <- subset(struct_all_elements_rtype, all_rtype) -all_types_with_complete_rtype <- rbind.fill(subset(struct_enum_types, !category %in% c("struct", "union") || +all_types_with_complete_rtype <- rbind.fill(subset(struct_enum_types, !category %in% c("struct", "union") | category_name %in% struct_all_elements_rtype$category_name), all_other) all_types_with_complete_rtype <- subset(all_types_with_complete_rtype, has_rtype) diff --git a/inst/CWrappers_1.12.0/datatype_export_c.brew b/inst/CWrappers_1.12.0/datatype_export_c.brew index 6a84363..1f56c17 100755 --- a/inst/CWrappers_1.12.0/datatype_export_c.brew +++ b/inst/CWrappers_1.12.0/datatype_export_c.brew @@ -64,7 +64,7 @@ hid_t get_h5_equiv(int size, bool sign) { SEXP print_dtypes_array(void) { Rprintf("New -------------------------------------\n"); for(int i=0; i < DT_LAST_ITEM; ++i) { - Rprintf("%d: %I64d\n", i, h5_datatype[i]); + Rprintf("%d: %ld\n", i, h5_datatype[i]); } return(R_NilValue); } diff --git a/inst/CWrappers_1.12.0/identify_prototypes.R b/inst/CWrappers_1.12.0/identify_prototypes.R index 75eb4cc..c3c6dd9 100755 --- a/inst/CWrappers_1.12.0/identify_prototypes.R +++ b/inst/CWrappers_1.12.0/identify_prototypes.R @@ -321,7 +321,7 @@ struct_all_elements_rtype$all_rtype[struct_all_elements_rtype$category_name=="H5 struct_all_elements_rtype <- subset(struct_all_elements_rtype, all_rtype) -all_types_with_complete_rtype <- rbind.fill(subset(struct_enum_types, !category %in% c("struct", "union") || +all_types_with_complete_rtype <- rbind.fill(subset(struct_enum_types, !category %in% c("struct", "union") | category_name %in% struct_all_elements_rtype$category_name), all_other) all_types_with_complete_rtype <- subset(all_types_with_complete_rtype, has_rtype) diff --git a/inst/CWrappers_1.8.12/datatype_export_c.brew b/inst/CWrappers_1.8.12/datatype_export_c.brew index 6a84363..1f56c17 100755 --- a/inst/CWrappers_1.8.12/datatype_export_c.brew +++ b/inst/CWrappers_1.8.12/datatype_export_c.brew @@ -64,7 +64,7 @@ hid_t get_h5_equiv(int size, bool sign) { SEXP print_dtypes_array(void) { Rprintf("New -------------------------------------\n"); for(int i=0; i < DT_LAST_ITEM; ++i) { - Rprintf("%d: %I64d\n", i, h5_datatype[i]); + Rprintf("%d: %ld\n", i, h5_datatype[i]); } return(R_NilValue); } diff --git a/inst/CWrappers_1.8.12/identify_prototypes.R b/inst/CWrappers_1.8.12/identify_prototypes.R index 27b2fa4..26e2af6 100755 --- a/inst/CWrappers_1.8.12/identify_prototypes.R +++ b/inst/CWrappers_1.8.12/identify_prototypes.R @@ -318,7 +318,7 @@ struct_all_elements_rtype$all_rtype[struct_all_elements_rtype$category_name=="H5 struct_all_elements_rtype <- subset(struct_all_elements_rtype, all_rtype) -all_types_with_complete_rtype <- rbind.fill(subset(struct_enum_types, !category %in% c("struct", "union") || +all_types_with_complete_rtype <- rbind.fill(subset(struct_enum_types, !category %in% c("struct", "union") | category_name %in% struct_all_elements_rtype$category_name), all_other) all_types_with_complete_rtype <- subset(all_types_with_complete_rtype, has_rtype) diff --git a/inst/CWrappers_1.8.14/datatype_export_c.brew b/inst/CWrappers_1.8.14/datatype_export_c.brew index 6a84363..1f56c17 100755 --- a/inst/CWrappers_1.8.14/datatype_export_c.brew +++ b/inst/CWrappers_1.8.14/datatype_export_c.brew @@ -64,7 +64,7 @@ hid_t get_h5_equiv(int size, bool sign) { SEXP print_dtypes_array(void) { Rprintf("New -------------------------------------\n"); for(int i=0; i < DT_LAST_ITEM; ++i) { - Rprintf("%d: %I64d\n", i, h5_datatype[i]); + Rprintf("%d: %ld\n", i, h5_datatype[i]); } return(R_NilValue); } diff --git a/inst/CWrappers_1.8.14/identify_prototypes.R b/inst/CWrappers_1.8.14/identify_prototypes.R index c57408e..a3b8d54 100755 --- a/inst/CWrappers_1.8.14/identify_prototypes.R +++ b/inst/CWrappers_1.8.14/identify_prototypes.R @@ -319,7 +319,7 @@ struct_all_elements_rtype$all_rtype[struct_all_elements_rtype$category_name=="H5 struct_all_elements_rtype <- subset(struct_all_elements_rtype, all_rtype) -all_types_with_complete_rtype <- rbind.fill(subset(struct_enum_types, !category %in% c("struct", "union") || +all_types_with_complete_rtype <- rbind.fill(subset(struct_enum_types, !category %in% c("struct", "union") | category_name %in% struct_all_elements_rtype$category_name), all_other) all_types_with_complete_rtype <- subset(all_types_with_complete_rtype, has_rtype) diff --git a/inst/CWrappers_1.8.16/datatype_export_c.brew b/inst/CWrappers_1.8.16/datatype_export_c.brew index 6a84363..1f56c17 100755 --- a/inst/CWrappers_1.8.16/datatype_export_c.brew +++ b/inst/CWrappers_1.8.16/datatype_export_c.brew @@ -64,7 +64,7 @@ hid_t get_h5_equiv(int size, bool sign) { SEXP print_dtypes_array(void) { Rprintf("New -------------------------------------\n"); for(int i=0; i < DT_LAST_ITEM; ++i) { - Rprintf("%d: %I64d\n", i, h5_datatype[i]); + Rprintf("%d: %ld\n", i, h5_datatype[i]); } return(R_NilValue); } diff --git a/inst/CWrappers_1.8.16/identify_prototypes.R b/inst/CWrappers_1.8.16/identify_prototypes.R index 27b2fa4..26e2af6 100755 --- a/inst/CWrappers_1.8.16/identify_prototypes.R +++ b/inst/CWrappers_1.8.16/identify_prototypes.R @@ -318,7 +318,7 @@ struct_all_elements_rtype$all_rtype[struct_all_elements_rtype$category_name=="H5 struct_all_elements_rtype <- subset(struct_all_elements_rtype, all_rtype) -all_types_with_complete_rtype <- rbind.fill(subset(struct_enum_types, !category %in% c("struct", "union") || +all_types_with_complete_rtype <- rbind.fill(subset(struct_enum_types, !category %in% c("struct", "union") | category_name %in% struct_all_elements_rtype$category_name), all_other) all_types_with_complete_rtype <- subset(all_types_with_complete_rtype, has_rtype) diff --git a/man/check_arg_for_hyperslab_func.Rd b/man/check_arg_for_hyperslab_func.Rd index 89caf26..e067fe7 100644 --- a/man/check_arg_for_hyperslab_func.Rd +++ b/man/check_arg_for_hyperslab_func.Rd @@ -7,9 +7,9 @@ check_arg_for_hyperslab_func(x, envir) } \arguments{ -\item{envir}{The environment in which to evaluate the argument} +\item{x}{The argument to check} -\item{cur_arg}{The argument to check} +\item{envir}{The environment in which to evaluate the argument} } \value{ A vector of length 4 describing start, count, stride and block if appropriate diff --git a/man/extract_dim.Rd b/man/extract_dim.Rd index 805822a..275eabe 100644 --- a/man/extract_dim.Rd +++ b/man/extract_dim.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/convert.R \name{extract_dim} \alias{extract_dim} -\title{Set the correct dimension attribute for an object} +\title{Extract the dimension of a space and datatype} \usage{ extract_dim(space, dtype) } @@ -10,17 +10,15 @@ extract_dim(space, dtype) \item{space}{The space with the selection that was used to read the dataset} \item{dtype}{The datatype of the dataset} - -\item{x}{an object that was read from an HDF5 dataset or attribute} } \value{ \code{x}, but with a new dimension attribute } \description{ -Set the correct dimension attribute for an object +Get the correct dimensions for a space and datatype } \details{ -This function uses the space and the selection in it to set the correct dimension +This function uses the space and the selection in it to get the correct dimension for the resulting object (but without dropping dimensions). Furthermore, if the datatype is an array, those dimensions are correctly determined as well. diff --git a/src/1_10_0/datatype_export.c b/src/1_10_0/datatype_export.c index e6b8af9..4e64c63 100644 --- a/src/1_10_0/datatype_export.c +++ b/src/1_10_0/datatype_export.c @@ -64,7 +64,7 @@ hid_t get_h5_equiv(int size, bool sign) { SEXP print_dtypes_array(void) { Rprintf("New -------------------------------------\n"); for(int i=0; i < DT_LAST_ITEM; ++i) { - Rprintf("%d: %I64d\n", i, h5_datatype[i]); + Rprintf("%d: %ld\n", i, h5_datatype[i]); } return(R_NilValue); } diff --git a/src/1_10_2/datatype_export.c b/src/1_10_2/datatype_export.c index 2ff700f..5a599f1 100644 --- a/src/1_10_2/datatype_export.c +++ b/src/1_10_2/datatype_export.c @@ -64,7 +64,7 @@ hid_t get_h5_equiv(int size, bool sign) { SEXP print_dtypes_array(void) { Rprintf("New -------------------------------------\n"); for(int i=0; i < DT_LAST_ITEM; ++i) { - Rprintf("%d: %I64d\n", i, h5_datatype[i]); + Rprintf("%d: %ld\n", i, h5_datatype[i]); } return(R_NilValue); } diff --git a/src/1_10_3/datatype_export.c b/src/1_10_3/datatype_export.c index ef4aad3..764ab46 100644 --- a/src/1_10_3/datatype_export.c +++ b/src/1_10_3/datatype_export.c @@ -64,7 +64,7 @@ hid_t get_h5_equiv(int size, bool sign) { SEXP print_dtypes_array(void) { Rprintf("New -------------------------------------\n"); for(int i=0; i < DT_LAST_ITEM; ++i) { - Rprintf("%d: %I64d\n", i, h5_datatype[i]); + Rprintf("%d: %ld\n", i, h5_datatype[i]); } return(R_NilValue); } diff --git a/src/1_12_0/datatype_export.c b/src/1_12_0/datatype_export.c index 905b3d6..ee602c3 100644 --- a/src/1_12_0/datatype_export.c +++ b/src/1_12_0/datatype_export.c @@ -64,7 +64,7 @@ hid_t get_h5_equiv(int size, bool sign) { SEXP print_dtypes_array(void) { Rprintf("New -------------------------------------\n"); for(int i=0; i < DT_LAST_ITEM; ++i) { - Rprintf("%d: %I64d\n", i, h5_datatype[i]); + Rprintf("%d: %ld\n", i, h5_datatype[i]); } return(R_NilValue); } diff --git a/src/1_8_12/datatype_export.c b/src/1_8_12/datatype_export.c index 5593cfa..dde16f0 100644 --- a/src/1_8_12/datatype_export.c +++ b/src/1_8_12/datatype_export.c @@ -64,7 +64,7 @@ hid_t get_h5_equiv(int size, bool sign) { SEXP print_dtypes_array(void) { Rprintf("New -------------------------------------\n"); for(int i=0; i < DT_LAST_ITEM; ++i) { - Rprintf("%d: %I64d\n", i, h5_datatype[i]); + Rprintf("%d: %ld\n", i, h5_datatype[i]); } return(R_NilValue); } diff --git a/src/1_8_14/datatype_export.c b/src/1_8_14/datatype_export.c index 43fcc92..d03d4ac 100644 --- a/src/1_8_14/datatype_export.c +++ b/src/1_8_14/datatype_export.c @@ -64,7 +64,7 @@ hid_t get_h5_equiv(int size, bool sign) { SEXP print_dtypes_array(void) { Rprintf("New -------------------------------------\n"); for(int i=0; i < DT_LAST_ITEM; ++i) { - Rprintf("%d: %I64d\n", i, h5_datatype[i]); + Rprintf("%d: %ld\n", i, h5_datatype[i]); } return(R_NilValue); } diff --git a/src/1_8_16/datatype_export.c b/src/1_8_16/datatype_export.c index 7471b81..02e3404 100644 --- a/src/1_8_16/datatype_export.c +++ b/src/1_8_16/datatype_export.c @@ -64,7 +64,7 @@ hid_t get_h5_equiv(int size, bool sign) { SEXP print_dtypes_array(void) { Rprintf("New -------------------------------------\n"); for(int i=0; i < DT_LAST_ITEM; ++i) { - Rprintf("%d: %I64d\n", i, h5_datatype[i]); + Rprintf("%d: %ld\n", i, h5_datatype[i]); } return(R_NilValue); } diff --git a/src/Wrapper_manual_H5T.c b/src/Wrapper_manual_H5T.c index 43297f5..0dcfb39 100755 --- a/src/Wrapper_manual_H5T.c +++ b/src/Wrapper_manual_H5T.c @@ -73,7 +73,7 @@ SEXP h5create_enum_type(SEXP _labels, SEXP _values, SEXP _dtype_id) { H5Tconvert(H5T_NATIVE_LLONG, dtype_id, 1, &buf, NULL, H5P_DEFAULT); status = H5Tenum_insert(datatype, CHAR(STRING_ELT(_labels, i)), &buf); if(status < 0) { - error("Could not insert value into enum %s value %d with status %d\n", CHAR(STRING_ELT(_labels, i)), buf, status); + error("Could not insert value into enum %s value %lld with status %d\n", CHAR(STRING_ELT(_labels, i)), buf, status); } } diff --git a/src/convert.c b/src/convert.c index f1f65fc..5a63c1b 100755 --- a/src/convert.c +++ b/src/convert.c @@ -258,7 +258,7 @@ SEXP RToH5_INTEGER(SEXP _Robj, hid_t dtype_id, R_xlen_t nelem) { SEXP Rval; if(nelem != XLENGTH(_Robj)) { - error("Length of integer vector not as expected: Actual: %d; Expected %d\n", XLENGTH(_Robj), nelem); + error("Length of integer vector not as expected: Actual: %ld; Expected %ld\n", XLENGTH(_Robj), nelem); } switch(TYPEOF(_Robj)) {