Skip to content

Commit acd91c3

Browse files
author
ripley
committed
fix the prototypes for no-arg calls
git-svn-id: https://svn.r-project.org/R/trunk@83029 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent 3af9011 commit acd91c3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/library/tools/R/sotools.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,27 +1008,27 @@ function(nrdb, align = TRUE, include_declarations = FALSE)
10081008
"*/")
10091009

10101010
if(include_declarations) {
1011+
prepare <- function(nargs)
1012+
if(nargs > 0) paste(rep.int("void *", nargs), collapse=", ")
1013+
else "void"
10111014
decls <- c(
10121015
"/* FIXME: ",
10131016
" Check these declarations against the C/Fortran source code.",
10141017
"*/",
10151018
if(NROW(y <- nrdb$.C)) {
1016-
args <- sapply(y$n, function(n) if(n >= 0)
1017-
paste(rep.int("void *", n), collapse=", ")
1019+
args <- sapply(y$n, function(n) if(n >= 0) prepare(n)
10181020
else "/* FIXME */")
10191021
c("", "/* .C calls */",
10201022
paste0("extern void ", y$s, "(", args, ");"))
10211023
},
10221024
if(NROW(y <- nrdb$.Call)) {
1023-
args <- sapply(y$n, function(n) if(n >= 0)
1024-
paste(rep.int("SEXP", n), collapse=", ")
1025+
args <- sapply(y$n, function(n) if(n >= 0) prepare(n)
10251026
else "/* FIXME */")
10261027
c("", "/* .Call calls */",
10271028
paste0("extern SEXP ", y$s, "(", args, ");"))
10281029
},
10291030
if(NROW(y <- nrdb$.Fortran)) {
1030-
args <- sapply(y$n, function(n) if(n >= 0)
1031-
paste(rep.int("void *", n), collapse=", ")
1031+
args <- sapply(y$n, function(n) if(n >= 0) prepare(n)
10321032
else "/* FIXME */")
10331033
c("", "/* .Fortran calls */",
10341034
paste0("extern void F77_NAME(", y$s, ")(", args, ");"))

0 commit comments

Comments
 (0)