search for: checkarity

Displaying 18 results from an estimated 18 matches for "checkarity".

Did you mean: check_arity
2005 Jun 17
1
(PR#7951) DispatchOrEval missing in do_isfinite and do_isinfinite
...: >> >> SEXP do_isfinite(SEXP call, SEXP op, SEXP args, SEXP rho) >> { >> SEXP ans, x, names, dims; >> int i, n; >> >> if (DispatchOrEval(call, op, "is.finite", args, rho, &ans, 1, 1)) >> return(ans); >> >> checkArity(op, args); >> ... >> >> SEXP do_isinfinite(SEXP call, SEXP op, SEXP args, SEXP rho) >> { >> SEXP ans, x, names, dims; >> double xr, xi; >> int i, n; >> >> if (DispatchOrEval(call, op, "is.infinite", args, rho, &ans,...
2003 Dec 30
1
Accuracy: Correct sums in rowSums(), colSums() (PR#6196)
...against R-1.7.1/src/main/array.c --------- Cut here ---------- *** array.c.old Mon Dec 15 17:33:23 2003 --- array.c Mon Dec 15 17:33:45 2003 *************** *** 1016,1022 **** int OP, n, p, cnt = 0, i, j, type; Rboolean NaRm, keepNA; int *ix; ! double *rx, sum = 0.0; checkArity(op, args); x = CAR(args); args = CDR(args); --- 1016,1022 ---- int OP, n, p, cnt = 0, i, j, type; Rboolean NaRm, keepNA; int *ix; ! double *rx, sum = 0.0, correction = 0.0; checkArity(op, args); x = CAR(args); args = CDR(args); *************** *** 1046,106...
2005 Jun 16
0
DispatchOrEval missing in do_isfinite and do_isinfinite (PR#7951)
...dded in the call fixed the problem. My functions no look like this: Form coerce.c: SEXP do_isfinite(SEXP call, SEXP op, SEXP args, SEXP rho) { SEXP ans, x, names, dims; int i, n; if (DispatchOrEval(call, op, "is.finite", args, rho, &ans, 1, 1)) return(ans); checkArity(op, args); ... SEXP do_isinfinite(SEXP call, SEXP op, SEXP args, SEXP rho) { SEXP ans, x, names, dims; double xr, xi; int i, n; if (DispatchOrEval(call, op, "is.infinite", args, rho, &ans, 1, 1)) return(ans); checkArity(op, args); ... Thanks you...
2005 Jun 17
0
(PR#7951) DispatchOrEval missing in do_isfinite and
...look like this: > > Form coerce.c: > > SEXP do_isfinite(SEXP call, SEXP op, SEXP args, SEXP rho) > { > SEXP ans, x, names, dims; > int i, n; > > if (DispatchOrEval(call, op, "is.finite", args, rho, &ans, 1, 1)) > return(ans); > > checkArity(op, args); > ... > > SEXP do_isinfinite(SEXP call, SEXP op, SEXP args, SEXP rho) > { > SEXP ans, x, names, dims; > double xr, xi; > int i, n; > > if (DispatchOrEval(call, op, "is.infinite", args, rho, &ans, 1, 1)) > return(ans); >...
2002 May 28
0
(PR#1605)When dev.list() is NULL, dev.control() causes core dump
...c) corrects the problem, > when applied to src/main/plot.c: > > PATCH BEGIN > *** plot.c.orig Tue Dec 4 23:43:43 2001 > --- plot.c Sun May 26 11:06:25 2002 > *************** > *** 52,58 **** > SEXP do_devcontrol(SEXP call, SEXP op, SEXP args, SEXP env) > { > checkArity(op, args); > ! inhibitDisplayList(CurrentDevice()); > return R_NilValue; > } > > --- 52,60 ---- > SEXP do_devcontrol(SEXP call, SEXP op, SEXP args, SEXP env) > { > checkArity(op, args); > ! if(!NoDevices()){ > ! inhibitDisplayList(CurrentDevi...
2006 Jan 21
1
A patch for do_sample: check replace arg
...b/src/main/random.c Sat Jan 21 11:17:20 2006 -0800 @@ -453,15 +453,18 @@ /* with/without replacement according to r. */ SEXP attribute_hidden do_sample(SEXP call, SEXP op, SEXP args, SEXP rho) { - SEXP x, y, prob; + SEXP x, y, prob, sreplace; int k, n, replace; double *p; checkArity(op, args); n = asInteger(CAR(args)); args = CDR(args); k = asInteger(CAR(args)); args = CDR(args); - replace = asLogical(CAR(args)); args = CDR(args); + sreplace = CAR(args); args = CDR(args); prob = CAR(args); + if (length(sreplace) != 1) + errorcall(call, _("in...
2016 Sep 16
1
getGraphicsEvent() questions, minor feature/tweak request, and patch(es).
...t timer here and new to R in general. ;-) - Richard Bodewits -------------- next part -------------- Index: src/main/gevents.c =================================================================== --- src/main/gevents.c (revision 71269) +++ src/main/gevents.c (working copy) @@ -135,7 +135,7 @@ checkArity(op, args); prompt = CAR(args); - if (!isString(prompt) || !length(prompt)) error(_("invalid prompt")); + if ((!isString(prompt) || !length(prompt)) && (TYPEOF(prompt) != LGLSXP || asChar(prompt) != R_NaString)) error(_("invalid prompt")); /* NB: clea...
2006 Aug 30
0
Debugging with gdb
...t_nocancel () from /lib/tls/libc.so.6 (gdb) b do_get Breakpoint 1 at 0x80ca4f5: file envir.c, line 1615. (gdb) signal 0 Continuing with no signal. > x <- 1 > get("x") Breakpoint 1, do_get (call=0x9443878, op=0x934bd54, args=0x9416408, rho=0x9417a54) at envir.c:1615 1615 checkArity(op, args); (gdb) p $1 History has not yet reached $1. (gdb) p R_PV(x) No symbol "x" in current context. (gdb)
2001 Oct 09
0
RE: [R] List of functions with debug() and trace()
...orig//src/include/Internal.h R-1.3.1/src/include/Internal.h 208a209 > SEXP do_isdebug(SEXP, SEXP, SEXP, SEXP); diff -r R-1.3.1-orig//src/main/debug.c R-1.3.1/src/main/debug.c 74a75,95 > > > SEXP do_isdebug(SEXP call, SEXP op, SEXP args, SEXP rho) > { > SEXP ans; > > checkArity(op,args); > find_char_fun > > PROTECT(ans = allocVector(LGLSXP, 1)); > > if (TYPEOF(CAR(args)) != CLOSXP) > LOGICAL(ans)[0] = 0; /* False if not function */ > else > LOGICAL(ans)[0] = DEBUG(CAR(args)); > > UNPROTECT(1); > >...
2011 Mar 18
1
[Patch suggestion] Adding 3rd arg to tempfile() to set extension
...idden do_tempfile(SEXP call, SEXP op, SEXP args, SEXP env) { - SEXP ans, pattern, tempdir; - const char *tn, *td; + SEXP ans, pattern, fileext, tempdir; + const char *tn, *td, *te; char *tm; - int i, n1, n2, slen; + int i, n1, n2, n3, slen; + char tmp1[PATH_MAX]; checkArity(op, args); - pattern = CAR(args); n1 = length(pattern); - tempdir = CADR(args); n2 = length(tempdir); + pattern = CAR(args); n1 = length(pattern); args = CDR(args); + tempdir = CAR(args); n2 = length(tempdir); args = CDR(args); + fileext = CAR(args); n3 = length(fileext); if (!i...
2010 May 24
1
Functioning and source code location of .Primitive()
Hi all. I began examining the R source code in the last few days, for a better understanding of its structure. I read the manuals and digged deeply (maybe not enough?) into the source code, but I couldn't totally understand how .Primitive() works. Its effects, if I understand well, are quite clear to me (calling the C compiled counterpart of a "primitive" function), but where is its
2014 Jun 17
0
PATCH: Avoiding extra copies (NAMED bumped) with source(..., print.eval=FALSE) ...and with print.eval=TRUE?
...lt;- 0L tracemem[0x000000001c5675c0 -> 0x000000001c564ad0]: eval eval withVisible source FURTHER IMPROVEMENTS: Looking at the internals of withVisible(): /* This is a special .Internal */ SEXP attribute_hidden do_withVisible(SEXP call, SEXP op, SEXP args, SEXP rho) { SEXP x, nm, ret; checkArity(op, args); x = CAR(args); x = eval(x, rho); PROTECT(x); PROTECT(ret = allocVector(VECSXP, 2)); PROTECT(nm = allocVector(STRSXP, 2)); SET_STRING_ELT(nm, 0, mkChar("value")); SET_STRING_ELT(nm, 1, mkChar("visible")); SET_VECTOR_ELT(ret, 0, x); S...
2003 Jul 07
0
feature enhancement request & patch: dev.control(displaylist='en (PR#3424)
...-- R-patched/src/main/plot.c 2003-02-25 18:08:41.000000000 -0500=0A= +++ R-patched-grw/src/main/plot.c 2003-07-07 11:47:16.000000000 = -0400=0A= @@ -51,9 +51,13 @@=0A= =0A= SEXP do_devcontrol(SEXP call, SEXP op, SEXP args, SEXP env)=0A= {=0A= + int listFlag =3D LOGICAL(CAR(args))[0];=0A= checkArity(op, args);=0A= - inhibitDisplayList(CurrentDevice());=0A= - return R_NilValue;=0A= + if(listFlag)=0A= + enableDisplayList(CurrentDevice());=0A= + else=0A= + inhibitDisplayList(CurrentDevice());=0A= + return ScalarLogical(listFlag);=0A= }=0A= =0A= SEXP do_devcopy(SEXP cal...
1999 Mar 25
4
readline() (PR#147)
Dear R developers, I have found the following bug with readline() in R 0.63.3: if you execute the menu-function and then the readline() function, then readline() prompts "Selection:" > a <- readline() hello > a [1] "hallo" > a <- menu(c("a", "b"), title="bitte:") bitte: 1:a 2:b Selection: 2 > a <- readline() Selection:
2012 Mar 13
0
111 FIXMEs in main/src
...ex.c:/* FIXME: maybe add full IEC60559 support */ complex.c-static double complex clog(double complex x) -- complex.c:/* FIXME: check/add full IEC60559 support */ complex.c-static double complex cexp(double complex x) -- connections.c: /* FIXME: is this correct for consoles? */ connections.c- checkArity(op, args); -- connections.c:/* FIXME: could do any MBCS locale, but would need pushback */ connections.c-static SEXP -- connections.c: outlen = 1.01 * inlen + 600; /* FIXME, copied from bzip2 */ connections.c- buf = (unsigned char *) R_alloc(outlen, sizeof(unsigned char)); -- datetime.c: /* FI...
2005 Sep 18
0
Updated rawConnection() patch
...w->private); +f4: free(new->description); +f3: free(new->class); +f2: free(new); +f1: error(_("allocation of %s connection failed"), + isText ? "text" : "raw"); +} + +SEXP do_graboutput(SEXP call, SEXP op, SEXP args, SEXP env) +{ + Routtextconn this; + checkArity(op, args); + if(!inherits(CAR(args), "textConnection") && + !inherits(CAR(args), "rawConnection")) + errorcall(call, _("not a text or raw connection")); + this = getConnection(asInteger(CAR(args)))->private; + return lengthgets(this->data,...
2011 Aug 14
0
Improved version of Rprofmem
...uot;), filename); + } + else + R_MemReportingOutfile = NULL; + R_IsMemReporting = 1; + return; } SEXP attribute_hidden do_Rprofmem(SEXP call, SEXP op, SEXP args, SEXP rho) { - SEXP filename; - R_size_t threshold; + SEXP filename, ap; int append_mode; checkArity(op, args); - if (!isString(CAR(args)) || (LENGTH(CAR(args))) != 1) + + ap = args; + if (!isString(CAR(ap)) || (LENGTH(CAR(ap))) != 1) error(_("invalid '%s' argument"), "filename"); - append_mode = asLogical(CADR(args)); - filename = STRING_ELT(CAR(args),...
2006 Jul 27
6
Any interest in "merge" and "by" implementations specifically for sorted data?
Hi Developers, I am looking for another new project to help me get more up to speed on R and to learn something outside of R internals. One recent R issue I have run into is finding a fast implementations of the equivalent to the following SAS code: /* MDPC is an integer sort key made from two integer columns */ MDPC = (MD * 100000) + PCO; /* sort the dataset by the key */ PROC SORT;