The R Project SVN R

Rev

Rev 75532 | Rev 75601 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 75532 Rev 75533
Line 1980... Line 1980...
1980
void attribute_hidden
1980
void attribute_hidden
1981
R_BadValueInRCode(SEXP value, SEXP call, SEXP rho, const char *rawmsg,
1981
R_BadValueInRCode(SEXP value, SEXP call, SEXP rho, const char *rawmsg,
1982
                  const char *errmsg, const char *warnmsg,
1982
                  const char *errmsg, const char *warnmsg,
1983
                  const char *varname, Rboolean warnByDefault)
1983
                  const char *varname, Rboolean warnByDefault)
1984
{
1984
{
-
 
1985
    /* disable GC so that use of this temporary checking code does not
-
 
1986
       introduce new PROTECT errors e.g. in asLogical() use */
-
 
1987
    int enabled = R_GCEnabled;
-
 
1988
    R_GCEnabled = FALSE;
1985
    int nprotect = 0;
1989
    int nprotect = 0;
1986
    char *check = getenv(varname);
1990
    char *check = getenv(varname);
1987
    const void *vmax = vmaxget();
1991
    const void *vmax = vmaxget();
1988
    Rboolean err = check && StringTrue(check);
1992
    Rboolean err = check && StringTrue(check);
1989
    if (!err && check && StringFalse(check))
1993
    if (!err && check && StringFalse(check))
Line 2106... Line 2110...
2106
	errorcall(call, errmsg);
2110
	errorcall(call, errmsg);
2107
    else if (warn || warnByDefault)
2111
    else if (warn || warnByDefault)
2108
	warningcall(call, warnmsg);
2112
	warningcall(call, warnmsg);
2109
    vmaxset(vmax);
2113
    vmaxset(vmax);
2110
    UNPROTECT(nprotect);
2114
    UNPROTECT(nprotect);
-
 
2115
    R_GCEnabled = enabled;
2111
}
2116
}
2112
 
2117
 
2113
 
2118
 
2114
/* These functions are to be used in error messages, and available for others to use in the API
2119
/* These functions are to be used in error messages, and available for others to use in the API
2115
   GetCurrentSrcref returns the first non-NULL srcref after skipping skip of them.  If it
2120
   GetCurrentSrcref returns the first non-NULL srcref after skipping skip of them.  If it