Skip to content

Commit 10f3f75

Browse files
committed
Use R_xlen_t for size() method
1 parent 33561d8 commit 10f3f75

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/xml2_url.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ const xmlChar* to_xml_chr(cpp11::strings x, const char* arg) {
1717

1818
[[cpp11::register]]
1919
cpp11::strings url_absolute_(cpp11::strings x_sxp, cpp11::strings base_sxp) {
20-
int n = x_sxp.size();
20+
R_xlen_t n = x_sxp.size();
2121
cpp11::writable::strings out(n);
2222

2323
const xmlChar* base_uri = to_xml_chr(base_sxp, "Base URL");
2424

25-
for (int i = 0; i < n; ++i) {
25+
for (R_xlen_t i = 0; i < n; ++i) {
2626
const xmlChar* uri = (xmlChar*) Rf_translateCharUTF8(x_sxp[i]);
2727
out[i] = Xml2String(xmlBuildURI(uri, base_uri)).asRString();
2828
}
@@ -32,12 +32,12 @@ cpp11::strings url_absolute_(cpp11::strings x_sxp, cpp11::strings base_sxp) {
3232

3333
[[cpp11::register]]
3434
cpp11::strings url_relative_(cpp11::strings x_sxp, cpp11::strings base_sxp) {
35-
int n = x_sxp.size();
35+
R_xlen_t n = x_sxp.size();
3636
cpp11::writable::strings out(n);
3737

3838
const xmlChar* base_uri = to_xml_chr(base_sxp, "Base URL");
3939

40-
for (int i = 0; i < n; ++i) {
40+
for (R_xlen_t i = 0; i < n; ++i) {
4141
const xmlChar* uri = (xmlChar*) Rf_translateCharUTF8(x_sxp[i]);
4242
out[i] = Xml2String(xmlBuildRelativeURI(uri, base_uri)).asRString();
4343
}
@@ -47,7 +47,7 @@ cpp11::strings url_relative_(cpp11::strings x_sxp, cpp11::strings base_sxp) {
4747

4848
[[cpp11::register]]
4949
cpp11::data_frame url_parse_(cpp11::strings x_sxp) {
50-
int n = x_sxp.size();
50+
R_xlen_t n = x_sxp.size();
5151

5252
cpp11::writable::strings scheme(n);
5353
cpp11::writable::strings server(n);
@@ -58,7 +58,7 @@ cpp11::data_frame url_parse_(cpp11::strings x_sxp) {
5858

5959
cpp11::writable::integers port(n);
6060

61-
for (int i = 0; i < n; ++i) {
61+
for (R_xlen_t i = 0; i < n; ++i) {
6262
const char* raw = Rf_translateCharUTF8(x_sxp[i]);
6363
xmlURI* uri = xmlParseURI(raw);
6464
if (uri == NULL) {
@@ -103,12 +103,12 @@ cpp11::data_frame url_parse_(cpp11::strings x_sxp) {
103103

104104
[[cpp11::register]]
105105
cpp11::strings url_escape_(cpp11::strings x_sxp, cpp11::strings reserved_sxp) {
106-
int n = x_sxp.size();
106+
R_xlen_t n = x_sxp.size();
107107
cpp11::writable::strings out(n);
108108

109109
const xmlChar* xReserved = to_xml_chr(reserved_sxp, "`reserved`");
110110

111-
for (int i = 0; i < n; ++i) {
111+
for (R_xlen_t i = 0; i < n; ++i) {
112112
const xmlChar* xx = (xmlChar*) Rf_translateCharUTF8(x_sxp[i]);
113113
out[i] = Xml2String(xmlURIEscapeStr(xx, xReserved)).asRString();
114114
}
@@ -118,10 +118,10 @@ cpp11::strings url_escape_(cpp11::strings x_sxp, cpp11::strings reserved_sxp) {
118118

119119
[[cpp11::register]]
120120
cpp11::strings url_unescape_(cpp11::strings x_sxp) {
121-
int n = x_sxp.size();
121+
R_xlen_t n = x_sxp.size();
122122
cpp11::writable::strings out(n);
123123

124-
for (int i = 0; i < n; ++i) {
124+
for (R_xlen_t i = 0; i < n; ++i) {
125125
const char* xx = Rf_translateCharUTF8(x_sxp[i]);
126126

127127
char* unescaped = xmlURIUnescapeString(xx, 0, NULL);

0 commit comments

Comments
 (0)