Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mllg committed Aug 4, 2015
1 parent 369af7c commit 7a4e6e2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/all_missing.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Rboolean all_missing_atomic(SEXP);
Rboolean all_missing_list(SEXP);
Rboolean all_missing_matrix(SEXP);
Rboolean all_missing_frame(SEXP);
Rboolean all_missing(SEXP);
SEXP c_all_missing(SEXP);

#endif
23 changes: 12 additions & 11 deletions src/any_missing.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,19 @@ Rboolean any_missing_frame(SEXP x) {
return FALSE;
}

SEXP c_any_missing(SEXP x) {
Rboolean res;
Rboolean any_missing(SEXP x) {
switch(TYPEOF(x)) {
case LGLSXP: res = any_missing_logical(x); break;
case INTSXP: res = any_missing_integer(x); break;
case REALSXP: res = any_missing_double(x); break;
case CPLXSXP: res = any_missing_complex(x); break;
case STRSXP: res = any_missing_string(x); break;
case NILSXP: res = FALSE; break;
case VECSXP: res = isFrame(x) ? any_missing_frame(x) : any_missing_list(x); break;
case RAWSXP: res = FALSE; break;
case LGLSXP: return any_missing_logical(x);
case INTSXP: return any_missing_integer(x);
case REALSXP: return any_missing_double(x);
case CPLXSXP: return any_missing_complex(x);
case STRSXP: return any_missing_string(x);
case NILSXP: return FALSE;
case VECSXP: return isFrame(x) ? any_missing_frame(x) : any_missing_list(x);
case RAWSXP: return FALSE;
default: error("Object of type '%s' not supported", type2char(TYPEOF(x)));
}
return ScalarLogical(res);
}
SEXP c_any_missing(SEXP x) {
return ScalarLogical(any_missing(x));
}
1 change: 1 addition & 0 deletions src/any_missing.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Rboolean any_missing_atomic(SEXP);
Rboolean any_missing_list(SEXP);
Rboolean any_missing_matrix(SEXP);
Rboolean any_missing_frame(SEXP);
Rboolean any_missing(SEXP);
SEXP c_any_missing(SEXP);

#endif

0 comments on commit 7a4e6e2

Please sign in to comment.