@@ -1008,27 +1008,27 @@ function(nrdb, align = TRUE, include_declarations = FALSE)
1008
1008
" */" )
1009
1009
1010
1010
if (include_declarations ) {
1011
+ prepare <- function (nargs )
1012
+ if (nargs > 0 ) paste(rep.int(" void *" , nargs ), collapse = " , " )
1013
+ else " void"
1011
1014
decls <- c(
1012
1015
" /* FIXME: " ,
1013
1016
" Check these declarations against the C/Fortran source code." ,
1014
1017
" */" ,
1015
1018
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 )
1018
1020
else " /* FIXME */" )
1019
1021
c(" " , " /* .C calls */" ,
1020
1022
paste0(" extern void " , y $ s , " (" , args , " );" ))
1021
1023
},
1022
1024
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 )
1025
1026
else " /* FIXME */" )
1026
1027
c(" " , " /* .Call calls */" ,
1027
1028
paste0(" extern SEXP " , y $ s , " (" , args , " );" ))
1028
1029
},
1029
1030
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 )
1032
1032
else " /* FIXME */" )
1033
1033
c(" " , " /* .Fortran calls */" ,
1034
1034
paste0(" extern void F77_NAME(" , y $ s , " )(" , args , " );" ))
0 commit comments