Skip to content

Commit

Permalink
some cleaning up
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@60078 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
ripley committed Aug 2, 2012
1 parent 439848b commit e3b0cde
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 37 deletions.
2 changes: 1 addition & 1 deletion src/appl/strsignif.c
Expand Up @@ -102,7 +102,7 @@ int trio_sprintf(char *buffer, const char *format, ...);
use the argument type matching
*/
attribute_hidden
void str_signif(char *x, int *n, const char **type, int *width, int *digits,
void str_signif(void *x, int *n, const char **type, int *width, int *digits,
const char **format, const char **flag, char **result)
{
int wid = *width;
Expand Down
22 changes: 14 additions & 8 deletions src/include/R_ext/Applic.h
Expand Up @@ -85,6 +85,12 @@ void lbfgsb(int n, int m, double *x, double *l, double *u, int *nbd,
void samin(int n, double *pb, double *yb, optimfn fn, int maxit,
int tmax, double ti, int trace, void *ex);

/* appl/interv.c:
Also in Utils.h, used in package eco */
int findInterval(double *xt, int n, double x,
Rboolean rightmost_closed, Rboolean all_inside, int ilo,
int *mflag);



/* Entry points NOT in the R API */
Expand Down Expand Up @@ -147,22 +153,20 @@ void fft_factor(int n, int *pmaxf, int *pmaxp);
Rboolean fft_work(double *a, double *b, int nseg, int n, int nspn,
/* TRUE: success */ int isn, double *work, int *iwork);

/* appl/fmin.c : non-API, but used in package ape */
/* appl/fmin.c : */
double Brent_fmin(double ax, double bx, double (*f)(double, void *),
void *info, double tol);

#ifdef OLD
/* appl/interv.c: also in Utils.h */
/* used in packages gam and mda */
/* used from Fortran in packages gam and mda */
int F77_SUB(interv)(double *xt, int *n, double *x,
Rboolean *rightmost_closed, Rboolean *all_inside,
int *ilo, int *mflag);
/* Non-API No longer used */
void find_interv_vec(double *xt, int *n, double *x, int *nx,
int *rightmost_closed, int *all_inside, int *indx);
/* API, used in package eco */
int findInterval(double *xt, int n, double x,
Rboolean rightmost_closed, Rboolean all_inside, int ilo,
int *mflag);
#endif

/* appl/lbfgsb.c */
void setulb(int n, int m, double *x, double *l, double *u, int *nbd,
Expand All @@ -187,11 +191,13 @@ void R_pretty(double *lo, double *up, int *ndiv, int *min_n,
double *shrink_sml, double *high_u_fact,
int *eps_correction);

#ifdef OLD
/* appl/rowsum.c */
void R_rowsum(int *dim, double *na_x, double *x, double *group);
#endif

/* appl/strsignif.c */
void str_signif(char *x, int *n, const char **type, int *width, int *digits,
void str_signif(void *x, int *n, const char **type, int *width, int *digits,
const char **format, const char **flag, char **result);

#ifdef OLD
Expand Down Expand Up @@ -224,7 +230,7 @@ void optif0(int nr, int n, double *x, fcn_p fcn, void *state,
double *xpls, double *fpls, double *gpls, int *itrmcd,
double *a, double *wrk);

/* appl/zeroin.c : non API, but used in packages ape and qtl */
/* appl/zeroin.c : non API, but used in package qtl */
double R_zeroin(double ax, double bx, double (*f)(double, void *), void *info,
double *Tol, int *Maxit);
/* R_zeroin2() is faster for "expensive" f(), in those typical cases where
Expand Down
1 change: 0 additions & 1 deletion src/library/base/R/files.R
Expand Up @@ -229,6 +229,5 @@ Sys.setFileTime <- function(path, time)
stop("invalid 'path' argument")
time <- as.POSIXct(time)
if (is.na(time)) stop("invalid 'time' argument")
# invisible(.Call("R_setFileTime", path, time, PACKAGE = "base"))
.Internal(setFileTime(path, time))
}
3 changes: 2 additions & 1 deletion src/library/base/R/format.R
Expand Up @@ -98,7 +98,8 @@ format.pval <- function(pv, digits = max(1, getOption("digits")-2),
r
}

## Martin Maechler <maechler@stat.math.ethz.ch> , 1994-1998 :
## Martin Maechler <maechler@stat.math.ethz.ch> , 1994-1998,
## many corrections by R-core.
formatC <- function (x, digits = NULL, width = NULL,
format = NULL, flag = "", mode = NULL,
big.mark = "", big.interval = 3L,
Expand Down
27 changes: 1 addition & 26 deletions src/main/registration.c
Expand Up @@ -62,9 +62,6 @@

/* FIXME: bincode is no longer used in R, but is still used by
packages misc3d mixOmics spam
find_interv_vec is used in IDBsim and timeSeries:
dangerously because of NAOK = TRUE.
*/
void bincode (double *x, int *n, double *breaks, int *nb,
int *code, int *right, int *include_border, int *naok);
Expand All @@ -75,23 +72,9 @@ static R_NativePrimitiveArgType bincode_t[] = {REALSXP, INTSXP, REALSXP, INTSXP,

static R_NativePrimitiveArgType R_cumsum_t[] = {REALSXP, INTSXP, REALSXP, REALSXP};

//static R_NativePrimitiveArgType find_interv_vec_t[] = {REALSXP, INTSXP, REALSXP, INTSXP, LGLSXP, LGLSXP, INTSXP};


static R_NativePrimitiveArgType R_max_col_t[] = {REALSXP, INTSXP, INTSXP, INTSXP, INTSXP};

static R_NativePrimitiveArgType R_pretty_t[] = {REALSXP, REALSXP, INTSXP, INTSXP, REALSXP, REALSXP, INTSXP};
static R_NativePrimitiveArgType R_rowsum_t[] = {INTSXP, REALSXP, REALSXP, REALSXP};


/* Note the ANYSXP in the first place.
Doesn't quite work. Needs investigation.
See the odd first argument in the routine's definition.
static R_NativePrimitiveArgType str_signif_t[] = {ANYSXP, INTSXP, STRSXP, INTSXP, INTSXP, STRSXP, STRSXP, STRSXP};
*/

// static R_NativePrimitiveArgType R_tabulate_t[] = {INTSXP, INTSXP, INTSXP, INTSXP};

static R_NativePrimitiveArgType Rsockconnect_t[] = {INTSXP, STRSXP};
static R_NativePrimitiveArgType Rsockopen_t[] = {INTSXP};
Expand All @@ -114,17 +97,9 @@ static R_CMethodDef cMethods [] = {
CDEF(bakslv),
CDEF(bincode),
CDEF(R_cumsum),
// CDEF(find_interv_vec),
CDEF(R_max_col),
CDEF(R_pretty),
/* this is called by Hmisc, although no longer used in R */
CDEF(R_rowsum),
#if 0
CDEF(str_signif),
#else
{"str_signif", (DL_FUNC) &str_signif, 8, NULL},
#endif
// CDEF(R_tabulate),
{"str_signif", (DL_FUNC) &str_signif, 8, NULL}, // mutable first arg

/* Sockets */
CDEF(Rsockconnect),
Expand Down

0 comments on commit e3b0cde

Please sign in to comment.