@@ -11,7 +11,7 @@ SEXP transpose(SEXP l, SEXP fill, SEXP ignoreArg, SEXP keepNamesArg, SEXP listCo
1111 return (copyAsPlain (l ));
1212 if (!isLogical (ignoreArg ) || LOGICAL (ignoreArg )[0 ] == NA_LOGICAL )
1313 error (_ ("ignore.empty should be logical TRUE/FALSE." ));
14- bool ignore = LOGICAL (ignoreArg )[0 ];
14+ bool ignore = LOGICAL_RO (ignoreArg )[0 ];
1515 if (!(isNull (keepNamesArg ) || (isString (keepNamesArg ) && LENGTH (keepNamesArg ) == 1 )))
1616 error (_ ("keep.names should be either NULL, or the name of the first column of the result in which to place the names of the input" ));
1717 bool rn = !isNull (keepNamesArg );
@@ -20,7 +20,7 @@ SEXP transpose(SEXP l, SEXP fill, SEXP ignoreArg, SEXP keepNamesArg, SEXP listCo
2020 R_len_t ln = LENGTH (l );
2121 if (!IS_TRUE_OR_FALSE (listColsArg ))
2222 error (_ ("list.cols should be logical TRUE/FALSE." ));
23- bool listCol = LOGICAL (listColsArg )[0 ];
23+ bool listCol = LOGICAL_RO (listColsArg )[0 ];
2424
2525 // preprocessing
2626 int maxlen = 0 , zerolen = 0 ;
@@ -61,22 +61,22 @@ SEXP transpose(SEXP l, SEXP fill, SEXP ignoreArg, SEXP keepNamesArg, SEXP listCo
6161 } else PROTECT (li ); // extra PROTECT just to help rchk by avoiding two counter variables
6262 switch (maxtype ) {
6363 case LGLSXP : {
64- const int * ili = LOGICAL (li );
65- const int ifill = LOGICAL (fill )[0 ];
64+ const int * ili = LOGICAL_RO (li );
65+ const int ifill = LOGICAL_RO (fill )[0 ];
6666 for (int j = 0 ; j < maxlen ; j ++ ) {
6767 LOGICAL (ansp [j + rn ])[k ] = j < len ? ili [j ] : ifill ;
6868 }
6969 } break ;
7070 case INTSXP : {
71- const int * ili = INTEGER (li );
72- const int ifill = INTEGER (fill )[0 ];
71+ const int * ili = INTEGER_RO (li );
72+ const int ifill = INTEGER_RO (fill )[0 ];
7373 for (int j = 0 ; j < maxlen ; j ++ ) {
7474 INTEGER (ansp [j + rn ])[k ] = j < len ? ili [j ] : ifill ;
7575 }
7676 } break ;
7777 case REALSXP : {
78- const double * dli = REAL (li );
79- const double dfill = REAL (fill )[0 ];
78+ const double * dli = REAL_RO (li );
79+ const double dfill = REAL_RO (fill )[0 ];
8080 for (int j = 0 ; j < maxlen ; j ++ ) {
8181 REAL (ansp [j + rn ])[k ] = j < len ? dli [j ] : dfill ;
8282 }
0 commit comments