Skip to content

Commit

Permalink
is* -> Rf_is*
Browse files Browse the repository at this point in the history
  • Loading branch information
gagolews committed May 6, 2024
1 parent 1bfae8d commit 1c413a3
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 33 deletions.
11 changes: 8 additions & 3 deletions .devel/sphinx/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
/* --------------------------------------------------------------------------
Copyleft (C) 2021-2023, Marek Gagolewski <https://www.gagolewski.com/>
Copyleft (C) 2021-2024, Marek Gagolewski <https://www.gagolewski.com/>
-------------------------------------------------------------------------- */

@import url("fonts/Alegreya-fontspec.css");
@import url("fonts/ubuntu-fontspec.css");

.katex {
font-size: inherit;
}

h1, h2, h3, h4, h5, h6 {
font-weight: 700;
font-family: Alegreya Sans,Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif;
}

body {
font-family: Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;
font-family: Alegreya Sans,Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;
font-weight: 400;
}

Expand Down Expand Up @@ -128,7 +132,8 @@ p code.notranslate, p code.literal, p tt.literal {

strong.command, strong.program, .rst-content code, .rst-content div[class^="highlight"] pre, .rst-content tt, .rst-content pre, pre, samp, kbd, code {
font-family: Ubuntu Mono,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;
/* font-size: 90%; */
letter-spacing: -0.15pt;
font-size: 95%;
/* font-style: normal; */
}

Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: stringi
Version: 1.8.3
Date: 2023-12-10
Version: 1.8.3.9001
Date: 2024-05-06
Title: Fast and Portable Character String Processing Facilities
Description: A collection of character string/text/natural language
processing tools for pattern searching (e.g., with 'Java'-like regular
Expand Down
4 changes: 2 additions & 2 deletions src/stri_container_charclass.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ class StriContainerCharClass : public StriContainerBase {
StriContainerCharClass(SEXP rvec, R_len_t _nrecycle, bool negate=false)
{
#ifndef NDEBUG
if (!isString(rvec))
throw StriException("DEBUG: !isString in StriContainerCharClass::StriContainerCharClass(SEXP rvec)");
if (!Rf_isString(rvec))
throw StriException("DEBUG: !Rf_isString in StriContainerCharClass::StriContainerCharClass(SEXP rvec)");
#endif
int _n = LENGTH(rvec);
this->init_Base(_n, _nrecycle, true);
Expand Down
4 changes: 2 additions & 2 deletions src/stri_container_double.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class StriContainerDouble : public StriContainerBase {
{
this->data = NULL;
#ifndef NDEBUG
if (!isReal(rvec))
throw StriException("DEBUG: !isReal in StriContainerDouble");
if (!Rf_isReal(rvec))
throw StriException("DEBUG: !Rf_isReal in StriContainerDouble");
#endif
R_len_t ndata = LENGTH(rvec);
this->init_Base(ndata, _nrecycle, true);
Expand Down
4 changes: 2 additions & 2 deletions src/stri_container_logical.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ class StriContainerLogical : public StriContainerBase {
{
this->data = NULL;
#ifndef NDEBUG
if (!isLogical(rvec))
throw StriException("DEBUG: !isLogical in StriContainerLogical");
if (!Rf_isLogical(rvec))
throw StriException("DEBUG: !Rf_isLogical in StriContainerLogical");
#endif
R_len_t ndata = LENGTH(rvec);
this->init_Base(ndata, _nrecycle, true);
Expand Down
4 changes: 2 additions & 2 deletions src/stri_container_utf16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ StriContainerUTF16::StriContainerUTF16(SEXP rstr, R_len_t _nrecycle, bool _shall
{
this->str = NULL;
#ifndef NDEBUG
if (!isString(rstr))
throw StriException("DEBUG: !isString in StriContainerUTF16::StriContainerUTF16(SEXP rstr)");
if (!Rf_isString(rstr))
throw StriException("DEBUG: !Rf_isString in StriContainerUTF16::StriContainerUTF16(SEXP rstr)");
#endif
R_len_t nrstr = LENGTH(rstr);
this->init_Base(nrstr, _nrecycle, _shallowrecycle); // calling LENGTH(rstr) fails on constructor call
Expand Down
4 changes: 2 additions & 2 deletions src/stri_container_utf8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ StriContainerUTF8::StriContainerUTF8(SEXP rstr, R_len_t _nrecycle, bool _shallow
this->str = NULL;

#ifndef NDEBUG
if (!isString(rstr))
throw StriException("DEBUG: !isString in StriContainerUTF8::StriContainerUTF8(SEXP rstr)");
if (!Rf_isString(rstr))
throw StriException("DEBUG: !Rf_isString in StriContainerUTF8::StriContainerUTF8(SEXP rstr)");
#endif
R_len_t nrstr = LENGTH(rstr);
this->init_Base(nrstr, _nrecycle, _shallowrecycle, rstr); // calling LENGTH(rstr) fails on constructor call
Expand Down
34 changes: 17 additions & 17 deletions src/stri_prepare_arg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ SEXP stri__prepare_arg_string(SEXP x, const char* argname, bool allow_error)
if ((SEXP*)argname == (SEXP*)R_NilValue)
argname = "<noname>";

if (Rf_isVectorList(x) || isObject(x)) // factor is an object too
if (Rf_isVectorList(x) || Rf_isObject(x)) // factor is an object too
{
if (Rf_isVectorList(x) && !stri__check_list_of_scalars(x))
Rf_warning(MSG__WARN_LIST_COERCION);
Expand All @@ -351,11 +351,11 @@ SEXP stri__prepare_arg_string(SEXP x, const char* argname, bool allow_error)
return stri__call_as_character((void*)x);
#endif
}
else if ((bool)isString(x))
else if ((bool)Rf_isString(x))
return x; // return as-is
else if (Rf_isVectorAtomic(x) || Rf_isNull(x))
return Rf_coerceVector(x, STRSXP);
else if ((bool)isSymbol(x))
else if ((bool)Rf_isSymbol(x))
return Rf_ScalarString(PRINTNAME(x));

Rf_error(MSG__ARG_EXPECTED_STRING, argname); // allowed here
Expand Down Expand Up @@ -430,7 +430,7 @@ SEXP stri__prepare_arg_double(SEXP x, const char* argname, bool factors_as_strin
UNPROTECT(2);
return x;
}
else if (Rf_isVectorList(x) || isObject(x)) // factor is an object too
else if (Rf_isVectorList(x) || Rf_isObject(x)) // factor is an object too
{
if (Rf_isVectorList(x) && !stri__check_list_of_scalars(x))
Rf_warning(MSG__WARN_LIST_COERCION);
Expand All @@ -444,7 +444,7 @@ SEXP stri__prepare_arg_double(SEXP x, const char* argname, bool factors_as_strin
return stri__call_as_double((void*)x);
#endif
}
else if ((bool)isReal(x))
else if ((bool)Rf_isReal(x))
return x; //return as-is
else if (Rf_isVectorAtomic(x) || Rf_isNull(x))
return Rf_coerceVector(x, REALSXP);
Expand Down Expand Up @@ -522,7 +522,7 @@ SEXP stri__prepare_arg_integer(SEXP x, const char* argname, bool factors_as_stri
UNPROTECT(2);
return x;
}
else if (Rf_isVectorList(x) || isObject(x)) // factor is an object too
else if (Rf_isVectorList(x) || Rf_isObject(x)) // factor is an object too
{
if (Rf_isVectorList(x) && !stri__check_list_of_scalars(x))
Rf_warning(MSG__WARN_LIST_COERCION);
Expand Down Expand Up @@ -606,7 +606,7 @@ SEXP stri__prepare_arg_logical(SEXP x, const char* argname, bool allow_error)
return stri__call_as_logical((void*)x);
#endif
}
else if (Rf_isVectorList(x) || isObject(x))
else if (Rf_isVectorList(x) || Rf_isObject(x))
{
if (Rf_isVectorList(x) && !stri__check_list_of_scalars(x))
Rf_warning(MSG__WARN_LIST_COERCION);
Expand All @@ -620,7 +620,7 @@ SEXP stri__prepare_arg_logical(SEXP x, const char* argname, bool allow_error)
return stri__call_as_logical((void*)x);
#endif
}
else if ((bool)isLogical(x))
else if ((bool)Rf_isLogical(x))
return x; // return as-is
else if (Rf_isVectorAtomic(x) || Rf_isNull(x))
return Rf_coerceVector(x, LGLSXP);
Expand Down Expand Up @@ -691,7 +691,7 @@ SEXP stri__prepare_arg_raw(SEXP x, const char* argname, bool factors_as_strings,
UNPROTECT(2);
return x;
}
else if (Rf_isVectorList(x) || isObject(x))
else if (Rf_isVectorList(x) || Rf_isObject(x))
{
if (Rf_isVectorList(x) && !stri__check_list_of_scalars(x))
Rf_warning(MSG__WARN_LIST_COERCION);
Expand Down Expand Up @@ -808,7 +808,7 @@ SEXP stri__prepare_arg_string_1(SEXP x, const char* argname)
// PROTECT(x = Rf_eval(call, R_GlobalEnv)); // this will mark its encoding manually
// nprotect = 2;
// }
// else if (Rf_isVectorList(x) || isObject(x))
// else if (Rf_isVectorList(x) || Rf_isObject(x))
// {
// if (Rf_isVectorList(x)) {
// R_len_t nv = LENGTH(x);
Expand All @@ -825,13 +825,13 @@ SEXP stri__prepare_arg_string_1(SEXP x, const char* argname)
// PROTECT(x = Rf_eval(call, R_GlobalEnv)); // this will mark its encoding manually
// nprotect = 2;
// }
// else if ((bool)isString(x))
// else if ((bool)Rf_isString(x))
// nprotect = 0;
// else if (Rf_isVectorAtomic(x) || Rf_isNull(x)) {
// PROTECT(x = Rf_coerceVector(x, STRSXP));
// nprotect = 1;
// }
// else if ((bool)isSymbol(x)) {
// else if ((bool)Rf_isSymbol(x)) {
// PROTECT(x = Rf_ScalarString(PRINTNAME(x)));
// nprotect = 1;
// }
Expand Down Expand Up @@ -910,7 +910,7 @@ SEXP stri__prepare_arg_double_1(SEXP x, const char* argname, bool factors_as_str
// PROTECT(x = Rf_coerceVector(x, REALSXP));
// nprotect = 3;
// }
// else if (Rf_isVectorList(x) || isObject(x))
// else if (Rf_isVectorList(x) || Rf_isObject(x))
// {
// if (Rf_isVectorList(x)) {
// R_len_t nv = LENGTH(x);
Expand All @@ -927,7 +927,7 @@ SEXP stri__prepare_arg_double_1(SEXP x, const char* argname, bool factors_as_str
// PROTECT(x = Rf_eval(call, R_GlobalEnv)); // this will mark its encoding manually
// nprotect = 2;
// }
// else if ((bool)isReal(x))
// else if ((bool)Rf_isReal(x))
// nprotect = 0;
// else if (Rf_isVectorAtomic(x) || Rf_isNull(x)) {
// PROTECT(x = Rf_coerceVector(x, REALSXP));
Expand Down Expand Up @@ -1007,7 +1007,7 @@ SEXP stri__prepare_arg_integer_1(SEXP x, const char* argname, bool factors_as_st
// PROTECT(x = Rf_coerceVector(x, INTSXP));
// nprotect = 3;
// }
// else if (Rf_isVectorList(x) || isObject(x))
// else if (Rf_isVectorList(x) || Rf_isObject(x))
// {
// if (Rf_isVectorList(x)) {
// R_len_t nv = LENGTH(x);
Expand Down Expand Up @@ -1110,7 +1110,7 @@ SEXP stri__prepare_arg_logical_1(SEXP x, const char* argname)
// PROTECT(x = Rf_eval(call, R_GlobalEnv)); // this will mark its encoding manually
// nprotect = 2;
// }
// else if (Rf_isVectorList(x) || isObject(x))
// else if (Rf_isVectorList(x) || Rf_isObject(x))
// {
// if (Rf_isVectorList(x)) {
// R_len_t nv = LENGTH(x);
Expand All @@ -1127,7 +1127,7 @@ SEXP stri__prepare_arg_logical_1(SEXP x, const char* argname)
// PROTECT(x = Rf_eval(call, R_GlobalEnv)); // this will mark its encoding manually
// nprotect = 2;
// }
// else if ((bool)isLogical(x)) {
// else if ((bool)Rf_isLogical(x)) {
// nprotect = 0;
// // do nothing
// }
Expand Down
2 changes: 1 addition & 1 deletion src/stri_sub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ R_len_t stri__sub_prepare_from_to_length(SEXP& from, SEXP& to, SEXP& length,
SEXP t2;
PROTECT(t2 = VECTOR_ELT(t, 1));
if (
isString(t2) && LENGTH(t2) == 2 &&
Rf_isString(t2) && LENGTH(t2) == 2 &&
strcmp("length", CHAR(STRING_ELT(t2, 1))) == 0
) {
fromlength_matrix = true;
Expand Down

0 comments on commit 1c413a3

Please sign in to comment.