Skip to content

Commit fb848c6

Browse files
committed
revert some styler changes to make the changes more clear
1 parent c750115 commit fb848c6

File tree

2 files changed

+68
-68
lines changed

2 files changed

+68
-68
lines changed

R/register.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ generate_r_functions <- function(funs, package = "cpp11", use_package = FALSE) {
220220
package_call <- glue::glue(', PACKAGE = "{package}"')
221221
package_names <- glue::glue_data(funs, '"_{package}_{name}"')
222222
} else {
223-
package_names <- glue::glue_data(funs, "`_{package}_{name}`")
223+
package_names <- glue::glue_data(funs, '`_{package}_{name}`')
224224
package_call <- ""
225225
}
226226

@@ -229,8 +229,8 @@ generate_r_functions <- function(funs, package = "cpp11", use_package = FALSE) {
229229
funs$params <- vcapply(funs$list_params, function(x) if (nzchar(x)) paste0(", ", x) else x)
230230
is_void <- funs$return_type == "void"
231231
funs$calls <- ifelse(is_void,
232-
glue::glue_data(funs, "invisible(.Call({package_names}{params}{package_call}))"),
233-
glue::glue_data(funs, ".Call({package_names}{params}{package_call})")
232+
glue::glue_data(funs, 'invisible(.Call({package_names}{params}{package_call}))'),
233+
glue::glue_data(funs, '.Call({package_names}{params}{package_call})')
234234
)
235235

236236
# Parse and associate Roxygen comments
@@ -252,7 +252,7 @@ generate_r_functions <- function(funs, package = "cpp11", use_package = FALSE) {
252252
if (nzchar(roxygen_comment)) {
253253
glue::glue("{roxygen_comment}\n{name} <- function({list_params}) {{\n\t{calls}\n}}")
254254
} else {
255-
glue::glue("{name} <- function({list_params}) {{\n\t{calls}\n}}")
255+
glue::glue("{name} <- function({list_params}) {{\n {calls}\n}}")
256256
}
257257
}, funs$name, funs$list_params, funs$calls, funs$roxygen_comment, SIMPLIFY = FALSE)
258258

cpp11test/R/cpp11.R

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,163 +1,163 @@
11
# Generated by cpp11: do not edit by hand
22

33
cpp11_add_vec_for_ <- function(x, num) {
4-
.Call(`_cpp11test_cpp11_add_vec_for_`, x, num)
4+
.Call(`_cpp11test_cpp11_add_vec_for_`, x, num)
55
}
66

77
data_frame_ <- function() {
8-
.Call(`_cpp11test_data_frame_`)
8+
.Call(`_cpp11test_data_frame_`)
99
}
1010

1111
my_stop_n1fmt <- function(mystring) {
12-
invisible(.Call(`_cpp11test_my_stop_n1fmt`, mystring))
12+
invisible(.Call(`_cpp11test_my_stop_n1fmt`, mystring))
1313
}
1414

1515
my_stop_n2fmt <- function(mystring, myarg) {
16-
invisible(.Call(`_cpp11test_my_stop_n2fmt`, mystring, myarg))
16+
invisible(.Call(`_cpp11test_my_stop_n2fmt`, mystring, myarg))
1717
}
1818

1919
my_warning_n1fmt <- function(mystring) {
20-
invisible(.Call(`_cpp11test_my_warning_n1fmt`, mystring))
20+
invisible(.Call(`_cpp11test_my_warning_n1fmt`, mystring))
2121
}
2222

2323
my_warning_n2fmt <- function(mystring, myarg) {
24-
invisible(.Call(`_cpp11test_my_warning_n2fmt`, mystring, myarg))
24+
invisible(.Call(`_cpp11test_my_warning_n2fmt`, mystring, myarg))
2525
}
2626

2727
my_message_n1fmt <- function(mystring) {
28-
invisible(.Call(`_cpp11test_my_message_n1fmt`, mystring))
28+
invisible(.Call(`_cpp11test_my_message_n1fmt`, mystring))
2929
}
3030

3131
my_message_n2fmt <- function(mystring, myarg) {
32-
invisible(.Call(`_cpp11test_my_message_n2fmt`, mystring, myarg))
32+
invisible(.Call(`_cpp11test_my_message_n2fmt`, mystring, myarg))
3333
}
3434

3535
my_stop <- function(mystring, myarg) {
36-
invisible(.Call(`_cpp11test_my_stop`, mystring, myarg))
36+
invisible(.Call(`_cpp11test_my_stop`, mystring, myarg))
3737
}
3838

3939
my_stop_n1 <- function(mystring) {
40-
invisible(.Call(`_cpp11test_my_stop_n1`, mystring))
40+
invisible(.Call(`_cpp11test_my_stop_n1`, mystring))
4141
}
4242

4343
my_warning <- function(mystring, myarg) {
44-
invisible(.Call(`_cpp11test_my_warning`, mystring, myarg))
44+
invisible(.Call(`_cpp11test_my_warning`, mystring, myarg))
4545
}
4646

4747
my_warning_n1 <- function(mystring) {
48-
invisible(.Call(`_cpp11test_my_warning_n1`, mystring))
48+
invisible(.Call(`_cpp11test_my_warning_n1`, mystring))
4949
}
5050

5151
my_message <- function(mystring, myarg) {
52-
invisible(.Call(`_cpp11test_my_message`, mystring, myarg))
52+
invisible(.Call(`_cpp11test_my_message`, mystring, myarg))
5353
}
5454

5555
my_message_n1 <- function(mystring) {
56-
invisible(.Call(`_cpp11test_my_message_n1`, mystring))
56+
invisible(.Call(`_cpp11test_my_message_n1`, mystring))
5757
}
5858

5959
remove_altrep <- function(x) {
60-
.Call(`_cpp11test_remove_altrep`, x)
60+
.Call(`_cpp11test_remove_altrep`, x)
6161
}
6262

6363
upper_bound <- function(x, breaks) {
64-
.Call(`_cpp11test_upper_bound`, x, breaks)
64+
.Call(`_cpp11test_upper_bound`, x, breaks)
6565
}
6666

6767
findInterval2 <- function(x, breaks) {
68-
.Call(`_cpp11test_findInterval2`, x, breaks)
68+
.Call(`_cpp11test_findInterval2`, x, breaks)
6969
}
7070

7171
findInterval2_5 <- function(x, breaks) {
72-
.Call(`_cpp11test_findInterval2_5`, x, breaks)
72+
.Call(`_cpp11test_findInterval2_5`, x, breaks)
7373
}
7474

7575
findInterval3 <- function(x, breaks) {
76-
.Call(`_cpp11test_findInterval3`, x, breaks)
76+
.Call(`_cpp11test_findInterval3`, x, breaks)
7777
}
7878

7979
findInterval4 <- function(x, breaks) {
80-
.Call(`_cpp11test_findInterval4`, x, breaks)
80+
.Call(`_cpp11test_findInterval4`, x, breaks)
8181
}
8282

8383
grow_ <- function(n) {
84-
.Call(`_cpp11test_grow_`, n)
84+
.Call(`_cpp11test_grow_`, n)
8585
}
8686

8787
cpp11_insert_ <- function(num_sxp) {
88-
.Call(`_cpp11test_cpp11_insert_`, num_sxp)
88+
.Call(`_cpp11test_cpp11_insert_`, num_sxp)
8989
}
9090

9191
gibbs_cpp <- function(N, thin) {
92-
.Call(`_cpp11test_gibbs_cpp`, N, thin)
92+
.Call(`_cpp11test_gibbs_cpp`, N, thin)
9393
}
9494

9595
gibbs_cpp2 <- function(N, thin) {
96-
.Call(`_cpp11test_gibbs_cpp2`, N, thin)
96+
.Call(`_cpp11test_gibbs_cpp2`, N, thin)
9797
}
9898

9999
gibbs_rcpp <- function(N, thin) {
100-
.Call(`_cpp11test_gibbs_rcpp`, N, thin)
100+
.Call(`_cpp11test_gibbs_rcpp`, N, thin)
101101
}
102102

103103
gibbs_rcpp2 <- function(N, thin) {
104-
.Call(`_cpp11test_gibbs_rcpp2`, N, thin)
104+
.Call(`_cpp11test_gibbs_rcpp2`, N, thin)
105105
}
106106

107107
row_sums <- function(x) {
108-
.Call(`_cpp11test_row_sums`, x)
108+
.Call(`_cpp11test_row_sums`, x)
109109
}
110110

111111
col_sums <- function(x) {
112-
.Call(`_cpp11test_col_sums`, x)
112+
.Call(`_cpp11test_col_sums`, x)
113113
}
114114

115115
protect_one_ <- function(x, n) {
116-
invisible(.Call(`_cpp11test_protect_one_`, x, n))
116+
invisible(.Call(`_cpp11test_protect_one_`, x, n))
117117
}
118118

119119
protect_one_sexp_ <- function(x, n) {
120-
invisible(.Call(`_cpp11test_protect_one_sexp_`, x, n))
120+
invisible(.Call(`_cpp11test_protect_one_sexp_`, x, n))
121121
}
122122

123123
protect_one_cpp11_ <- function(x, n) {
124-
invisible(.Call(`_cpp11test_protect_one_cpp11_`, x, n))
124+
invisible(.Call(`_cpp11test_protect_one_cpp11_`, x, n))
125125
}
126126

127127
protect_one_preserve_ <- function(x, n) {
128-
invisible(.Call(`_cpp11test_protect_one_preserve_`, x, n))
128+
invisible(.Call(`_cpp11test_protect_one_preserve_`, x, n))
129129
}
130130

131131
protect_many_ <- function(n) {
132-
invisible(.Call(`_cpp11test_protect_many_`, n))
132+
invisible(.Call(`_cpp11test_protect_many_`, n))
133133
}
134134

135135
protect_many_cpp11_ <- function(n) {
136-
invisible(.Call(`_cpp11test_protect_many_cpp11_`, n))
136+
invisible(.Call(`_cpp11test_protect_many_cpp11_`, n))
137137
}
138138

139139
protect_many_sexp_ <- function(n) {
140-
invisible(.Call(`_cpp11test_protect_many_sexp_`, n))
140+
invisible(.Call(`_cpp11test_protect_many_sexp_`, n))
141141
}
142142

143143
protect_many_preserve_ <- function(n) {
144-
invisible(.Call(`_cpp11test_protect_many_preserve_`, n))
144+
invisible(.Call(`_cpp11test_protect_many_preserve_`, n))
145145
}
146146

147147
protect_many_rcpp_ <- function(n) {
148-
invisible(.Call(`_cpp11test_protect_many_rcpp_`, n))
148+
invisible(.Call(`_cpp11test_protect_many_rcpp_`, n))
149149
}
150150

151151
cpp11_release_ <- function(n) {
152-
invisible(.Call(`_cpp11test_cpp11_release_`, n))
152+
invisible(.Call(`_cpp11test_cpp11_release_`, n))
153153
}
154154

155155
rcpp_release_ <- function(n) {
156-
invisible(.Call(`_cpp11test_rcpp_release_`, n))
156+
invisible(.Call(`_cpp11test_rcpp_release_`, n))
157157
}
158158

159159
notroxcpp1_ <- function(x) {
160-
.Call(`_cpp11test_notroxcpp1_`, x)
160+
.Call(`_cpp11test_notroxcpp1_`, x)
161161
}
162162

163163
#' @title Roxygenise C++ function II
@@ -197,7 +197,7 @@ roxcpp5_ <- function(x) {
197197
}
198198

199199
notroxcpp6_ <- function(x) {
200-
.Call(`_cpp11test_notroxcpp6_`, x)
200+
.Call(`_cpp11test_notroxcpp6_`, x)
201201
}
202202

203203
#' @title Roxygenise C++ function VII
@@ -210,93 +210,93 @@ roxcpp7_ <- function(x) {
210210
}
211211

212212
cpp11_safe_ <- function(x_sxp) {
213-
.Call(`_cpp11test_cpp11_safe_`, x_sxp)
213+
.Call(`_cpp11test_cpp11_safe_`, x_sxp)
214214
}
215215

216216
string_proxy_assignment_ <- function() {
217-
.Call(`_cpp11test_string_proxy_assignment_`)
217+
.Call(`_cpp11test_string_proxy_assignment_`)
218218
}
219219

220220
string_push_back_ <- function() {
221-
.Call(`_cpp11test_string_push_back_`)
221+
.Call(`_cpp11test_string_push_back_`)
222222
}
223223

224224
sum_dbl_for_ <- function(x) {
225-
.Call(`_cpp11test_sum_dbl_for_`, x)
225+
.Call(`_cpp11test_sum_dbl_for_`, x)
226226
}
227227

228228
sum_dbl_for2_ <- function(x_sxp) {
229-
.Call(`_cpp11test_sum_dbl_for2_`, x_sxp)
229+
.Call(`_cpp11test_sum_dbl_for2_`, x_sxp)
230230
}
231231

232232
sum_dbl_for3_ <- function(x_sxp) {
233-
.Call(`_cpp11test_sum_dbl_for3_`, x_sxp)
233+
.Call(`_cpp11test_sum_dbl_for3_`, x_sxp)
234234
}
235235

236236
sum_dbl_foreach_ <- function(x) {
237-
.Call(`_cpp11test_sum_dbl_foreach_`, x)
237+
.Call(`_cpp11test_sum_dbl_foreach_`, x)
238238
}
239239

240240
sum_dbl_foreach2_ <- function(x_sxp) {
241-
.Call(`_cpp11test_sum_dbl_foreach2_`, x_sxp)
241+
.Call(`_cpp11test_sum_dbl_foreach2_`, x_sxp)
242242
}
243243

244244
sum_dbl_accumulate_ <- function(x) {
245-
.Call(`_cpp11test_sum_dbl_accumulate_`, x)
245+
.Call(`_cpp11test_sum_dbl_accumulate_`, x)
246246
}
247247

248248
sum_dbl_accumulate2_ <- function(x_sxp) {
249-
.Call(`_cpp11test_sum_dbl_accumulate2_`, x_sxp)
249+
.Call(`_cpp11test_sum_dbl_accumulate2_`, x_sxp)
250250
}
251251

252252
sum_int_for_ <- function(x) {
253-
.Call(`_cpp11test_sum_int_for_`, x)
253+
.Call(`_cpp11test_sum_int_for_`, x)
254254
}
255255

256256
sum_int_for2_ <- function(x_) {
257-
.Call(`_cpp11test_sum_int_for2_`, x_)
257+
.Call(`_cpp11test_sum_int_for2_`, x_)
258258
}
259259

260260
sum_int_foreach_ <- function(x) {
261-
.Call(`_cpp11test_sum_int_foreach_`, x)
261+
.Call(`_cpp11test_sum_int_foreach_`, x)
262262
}
263263

264264
sum_int_accumulate_ <- function(x) {
265-
.Call(`_cpp11test_sum_int_accumulate_`, x)
265+
.Call(`_cpp11test_sum_int_accumulate_`, x)
266266
}
267267

268268
rcpp_sum_dbl_for_ <- function(x_sxp) {
269-
.Call(`_cpp11test_rcpp_sum_dbl_for_`, x_sxp)
269+
.Call(`_cpp11test_rcpp_sum_dbl_for_`, x_sxp)
270270
}
271271

272272
rcpp_sum_int_for_ <- function(x_sxp) {
273-
.Call(`_cpp11test_rcpp_sum_int_for_`, x_sxp)
273+
.Call(`_cpp11test_rcpp_sum_int_for_`, x_sxp)
274274
}
275275

276276
rcpp_sum_dbl_foreach_ <- function(x_sxp) {
277-
.Call(`_cpp11test_rcpp_sum_dbl_foreach_`, x_sxp)
277+
.Call(`_cpp11test_rcpp_sum_dbl_foreach_`, x_sxp)
278278
}
279279

280280
rcpp_sum_dbl_accumulate_ <- function(x_sxp) {
281-
.Call(`_cpp11test_rcpp_sum_dbl_accumulate_`, x_sxp)
281+
.Call(`_cpp11test_rcpp_sum_dbl_accumulate_`, x_sxp)
282282
}
283283

284284
rcpp_grow_ <- function(n_sxp) {
285-
.Call(`_cpp11test_rcpp_grow_`, n_sxp)
285+
.Call(`_cpp11test_rcpp_grow_`, n_sxp)
286286
}
287287

288288
rcpp_push_and_truncate_ <- function(size_sxp) {
289-
.Call(`_cpp11test_rcpp_push_and_truncate_`, size_sxp)
289+
.Call(`_cpp11test_rcpp_push_and_truncate_`, size_sxp)
290290
}
291291

292292
test_destruction_inner <- function() {
293-
invisible(.Call(`_cpp11test_test_destruction_inner`))
293+
invisible(.Call(`_cpp11test_test_destruction_inner`))
294294
}
295295

296296
test_destruction_outer <- function() {
297-
invisible(.Call(`_cpp11test_test_destruction_outer`))
297+
invisible(.Call(`_cpp11test_test_destruction_outer`))
298298
}
299299

300300
cpp11_push_and_truncate_ <- function(size_sexp) {
301-
.Call(`_cpp11test_cpp11_push_and_truncate_`, size_sexp)
301+
.Call(`_cpp11test_cpp11_push_and_truncate_`, size_sexp)
302302
}

0 commit comments

Comments
 (0)